feat: Focused/Other pivot for Inbox
- MailListView: new m_pivotCombo (Principal/Otros) visible only for Inbox folders - MailListView::setFolderType(folderType) called from MainMainWindow::onFolderSelected() - Folder::type() returns 'inbox', 'sent', 'drafts', 'trash', 'custom' - onPivotChanged() placeholder for future AI-based filtering (Focused vs Other) - UI hidden for non-Inbox folders
This commit is contained in:
@@ -77,6 +77,22 @@ void MailListView::setupUI()
|
||||
|
||||
filterLayout->addStretch();
|
||||
|
||||
// Pivot control (Focused/Other) - only shown for Inbox folders
|
||||
m_pivotCombo = new QComboBox();
|
||||
m_pivotCombo->addItem("Principal"); // Focused
|
||||
m_pivotCombo->addItem("Otros"); // Other
|
||||
m_pivotCombo->setFixedWidth(140);
|
||||
m_pivotCombo->setStyleSheet(
|
||||
"QComboBox { border: 1px solid #d1d1d6; border-radius: 4px; padding: 4px 8px; "
|
||||
"background: white; min-height: 20px; }"
|
||||
"QComboBox:hover { border-color: #bdbdbd; }"
|
||||
"QComboBox:focus { border-color: #1976D2; }"
|
||||
);
|
||||
m_pivotCombo->setVisible(false); // Only visible for Inbox
|
||||
connect(m_pivotCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &MailListView::onPivotChanged);
|
||||
filterLayout->addWidget(m_pivotCombo);
|
||||
|
||||
// Display mode combo (Compact/Medium/Spacious)
|
||||
m_displayModeCombo = new QComboBox();
|
||||
m_displayModeCombo->addItem("Compacto");
|
||||
@@ -581,4 +597,26 @@ void MailListView::onBatchDeleteClicked()
|
||||
if (m_selectedMailIds.isEmpty()) return;
|
||||
emit batchDeleteRequested(m_selectedMailIds);
|
||||
exitMultiSelectMode();
|
||||
}
|
||||
|
||||
void MailListView::setFolderType(const QString& folderType)
|
||||
{
|
||||
m_pivotCombo->setVisible(folderType == "inbox");
|
||||
}
|
||||
|
||||
void MailListView::onPivotChanged(int index)
|
||||
{
|
||||
// 0 = Focused (Principal), 1 = Other (Otros)
|
||||
// TODO: Implement pivot filtering logic
|
||||
// For now, just update the model filter
|
||||
if (!m_sourceModel) return;
|
||||
|
||||
if (index == 0) {
|
||||
// Focused: important emails (could be based on sender frequency, AI, etc.)
|
||||
// m_sourceModel->setShowFocusedOnly(true);
|
||||
} else {
|
||||
// Other: promotional, notifications, etc.
|
||||
// m_sourceModel->setShowFocusedOnly(false);
|
||||
}
|
||||
refreshViews();
|
||||
}
|
||||
Reference in New Issue
Block a user