Compare commits
2
Commits
a75143628b
...
e0ce893d06
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0ce893d06 | ||
|
|
8767d66b2a |
@@ -254,6 +254,10 @@ void MailListView::setupUI()
|
||||
m_treeView->header()->setSectionResizeMode(EmailTreeModel::ColSubject, QHeaderView::Stretch);
|
||||
m_treeView->header()->setSectionResizeMode(EmailTreeModel::ColSender, QHeaderView::Stretch);
|
||||
m_treeView->header()->setSectionResizeMode(EmailTreeModel::ColDate, QHeaderView::ResizeToContents);
|
||||
|
||||
// Allow shrinking by setting minimum section sizes
|
||||
m_treeView->header()->setMinimumSectionSize(50);
|
||||
m_treeView->header()->setStretchLastSection(false);
|
||||
|
||||
connect(m_treeView->selectionModel(), &QItemSelectionModel::selectionChanged,
|
||||
this, &MailListView::onSelectionChanged);
|
||||
@@ -572,10 +576,11 @@ void MailListView::onRowsInserted(const QModelIndex &parent, int first, int last
|
||||
}
|
||||
}
|
||||
|
||||
void MailListView::onRowSelected(const QModelIndex &index)
|
||||
void MailListView::onRowSelected(const QModelIndex ¤t, const QModelIndex &previous)
|
||||
{
|
||||
if (!index.isValid()) return;
|
||||
QModelIndex proxyIdx = m_proxyModel->mapToSource(index);
|
||||
Q_UNUSED(previous);
|
||||
if (!current.isValid()) return;
|
||||
QModelIndex proxyIdx = m_proxyModel->mapToSource(current);
|
||||
if (proxyIdx.isValid() && proxyIdx.data(EmailTreeModel::MailIdRole).isValid()) {
|
||||
int mailId = proxyIdx.data(EmailTreeModel::MailIdRole).toInt();
|
||||
emit emailSelected(mailId);
|
||||
|
||||
@@ -54,7 +54,7 @@ public slots:
|
||||
void setFolderType(const QString& folderType); // "inbox", "sent", "drafts", etc.
|
||||
|
||||
private slots:
|
||||
void onRowSelected(const QModelIndex &index);
|
||||
void onRowSelected(const QModelIndex ¤t, const QModelIndex &previous);
|
||||
void onSearchTextChanged(const QString &text);
|
||||
void onFilterChanged();
|
||||
void onGroupByChanged(int index);
|
||||
|
||||
@@ -224,7 +224,7 @@ void MainMainWindow::setupMailPage()
|
||||
m_folderTree = new QTreeView();
|
||||
m_folderTree->setHeaderHidden(true);
|
||||
m_folderTree->setIndentation(20);
|
||||
m_folderTree->setMinimumWidth(220);
|
||||
m_folderTree->setMinimumWidth(160); // Reduced from 220
|
||||
m_folderTree->setMaximumWidth(350);
|
||||
m_folderTree->setFrameShape(QFrame::NoFrame);
|
||||
m_folderTree->setExpandsOnDoubleClick(true);
|
||||
@@ -291,7 +291,7 @@ void MainMainWindow::setupMailPage()
|
||||
|
||||
// Reader view
|
||||
m_emailViewer = new ReaderView();
|
||||
m_emailViewer->setMinimumWidth(350);
|
||||
m_emailViewer->setMinimumWidth(280); // Reduced from 350
|
||||
connect(m_emailViewer, &ReaderView::replyRequested, this, &MainMainWindow::onReaderReplyRequested);
|
||||
connect(m_emailViewer, &ReaderView::forwardRequested, this, &MainMainWindow::onReaderForwardRequested);
|
||||
connect(m_emailViewer, &ReaderView::deleteRequested, this, &MainMainWindow::onReaderDeleteRequested);
|
||||
@@ -320,6 +320,10 @@ void MainMainWindow::setupMailPage()
|
||||
|
||||
// Default sizes: left pane (folders+categories) 300, list 380, viewer flex
|
||||
m_folderSplitter->setSizes({300, 380, 600});
|
||||
|
||||
// Allow each pane to shrink further
|
||||
m_folderSplitter->setHandleWidth(1);
|
||||
m_folderSplitter->setChildrenCollapsible(false);
|
||||
|
||||
mailLayout->addWidget(m_folderSplitter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user