feat: responsive compact mail view + folder unread badges
- CompactMailDelegate: card-based view for narrow panels (<420px) * Avatar with hash-based color, sender + date (relative format) * Subject line with attachment icon * Action buttons: flag, delete, category, more (context menu) * Unread highlight with light blue background + bold sender - MailListView: automatic switch between tree/table (wide) and list/cards (narrow) * QStackedWidget with QTreeView + QListView sharing same proxy model * resizeEvent threshold at 420px * Signals forwarded to MainMainWindow for actions - FolderTreeDelegate: custom paint for folder tree * Unread count badge (blue pill) right-aligned on folder nodes * Account nodes bold, folder nodes normal weight * Proper indentation per depth level - MailItemDao::countUnreadByFolderId() for real-time unread counts - MainMainWindow handlers for compact actions (flag, delete, category, more menu)
This commit is contained in:
@@ -50,8 +50,8 @@ template <> constexpr inline auto MainMainWindow::qt_create_metaobjectdata<qt_me
|
||||
"mailId",
|
||||
"onComposeRequested",
|
||||
"onReaderReplyRequested",
|
||||
"const MailItem*",
|
||||
"item",
|
||||
"onReaderForwardRequested",
|
||||
"onReaderDeleteRequested",
|
||||
"onNewMessage",
|
||||
"openMailInIndependentWindow",
|
||||
"onAddAccountRequested",
|
||||
@@ -61,7 +61,43 @@ template <> constexpr inline auto MainMainWindow::qt_create_metaobjectdata<qt_me
|
||||
"onProgressChanged",
|
||||
"percent",
|
||||
"onStatusMessage",
|
||||
"msg"
|
||||
"msg",
|
||||
"onSyncRequested",
|
||||
"onSettingsRequested",
|
||||
"updateMaximizeButtonIcon",
|
||||
"onCategorySelected",
|
||||
"Category",
|
||||
"cat",
|
||||
"onCategoryDoubleClicked",
|
||||
"onAssignCategoryRequested",
|
||||
"categoryId",
|
||||
"onCategoryCreated",
|
||||
"onCategoryEdited",
|
||||
"onCategoryDeleted",
|
||||
"onRulesChanged",
|
||||
"onRunRulesOnFolder",
|
||||
"onRunRulesOnSelected",
|
||||
"showRulesManager",
|
||||
"showTemplatesManager",
|
||||
"onFlagRequested",
|
||||
"onDeleteRequested",
|
||||
"onCategoryRequested",
|
||||
"onMoreRequested",
|
||||
"QPoint",
|
||||
"globalPos",
|
||||
"onEmbeddedSendRequested",
|
||||
"to",
|
||||
"cc",
|
||||
"bcc",
|
||||
"subject",
|
||||
"body",
|
||||
"scheduleTime",
|
||||
"fromAddress",
|
||||
"attachmentPaths",
|
||||
"onEmbeddedDiscardRequested",
|
||||
"onEmbeddedDetachRequested",
|
||||
"QWidget*",
|
||||
"widget"
|
||||
};
|
||||
|
||||
QtMocHelpers::UintData qt_methods {
|
||||
@@ -80,8 +116,16 @@ template <> constexpr inline auto MainMainWindow::qt_create_metaobjectdata<qt_me
|
||||
// Slot 'onComposeRequested'
|
||||
QtMocHelpers::SlotData<void()>(8, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'onReaderReplyRequested'
|
||||
QtMocHelpers::SlotData<void(const MailItem *)>(9, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ 0x80000000 | 10, 11 },
|
||||
QtMocHelpers::SlotData<void(int)>(9, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::Int, 7 },
|
||||
}}),
|
||||
// Slot 'onReaderForwardRequested'
|
||||
QtMocHelpers::SlotData<void(int)>(10, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::Int, 7 },
|
||||
}}),
|
||||
// Slot 'onReaderDeleteRequested'
|
||||
QtMocHelpers::SlotData<void(int)>(11, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::Int, 7 },
|
||||
}}),
|
||||
// Slot 'onNewMessage'
|
||||
QtMocHelpers::SlotData<void()>(12, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
@@ -107,6 +151,73 @@ template <> constexpr inline auto MainMainWindow::qt_create_metaobjectdata<qt_me
|
||||
QtMocHelpers::SlotData<void(const QString &)>(20, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::QString, 21 },
|
||||
}}),
|
||||
// Slot 'onSyncRequested'
|
||||
QtMocHelpers::SlotData<void()>(22, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'onSettingsRequested'
|
||||
QtMocHelpers::SlotData<void()>(23, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'updateMaximizeButtonIcon'
|
||||
QtMocHelpers::SlotData<void()>(24, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'onCategorySelected'
|
||||
QtMocHelpers::SlotData<void(const Category &)>(25, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ 0x80000000 | 26, 27 },
|
||||
}}),
|
||||
// Slot 'onCategoryDoubleClicked'
|
||||
QtMocHelpers::SlotData<void(const Category &)>(28, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ 0x80000000 | 26, 27 },
|
||||
}}),
|
||||
// Slot 'onAssignCategoryRequested'
|
||||
QtMocHelpers::SlotData<void(qint64, qint64)>(29, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::LongLong, 7 }, { QMetaType::LongLong, 30 },
|
||||
}}),
|
||||
// Slot 'onCategoryCreated'
|
||||
QtMocHelpers::SlotData<void(const Category &)>(31, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ 0x80000000 | 26, 27 },
|
||||
}}),
|
||||
// Slot 'onCategoryEdited'
|
||||
QtMocHelpers::SlotData<void(const Category &)>(32, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ 0x80000000 | 26, 27 },
|
||||
}}),
|
||||
// Slot 'onCategoryDeleted'
|
||||
QtMocHelpers::SlotData<void(qint64)>(33, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::LongLong, 30 },
|
||||
}}),
|
||||
// Slot 'onRulesChanged'
|
||||
QtMocHelpers::SlotData<void()>(34, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'onRunRulesOnFolder'
|
||||
QtMocHelpers::SlotData<void()>(35, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'onRunRulesOnSelected'
|
||||
QtMocHelpers::SlotData<void()>(36, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'showRulesManager'
|
||||
QtMocHelpers::SlotData<void()>(37, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'showTemplatesManager'
|
||||
QtMocHelpers::SlotData<void()>(38, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'onFlagRequested'
|
||||
QtMocHelpers::SlotData<void(int)>(39, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::Int, 7 },
|
||||
}}),
|
||||
// Slot 'onDeleteRequested'
|
||||
QtMocHelpers::SlotData<void(int)>(40, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::Int, 7 },
|
||||
}}),
|
||||
// Slot 'onCategoryRequested'
|
||||
QtMocHelpers::SlotData<void(int)>(41, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::Int, 7 },
|
||||
}}),
|
||||
// Slot 'onMoreRequested'
|
||||
QtMocHelpers::SlotData<void(int, const QPoint &)>(42, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::Int, 7 }, { 0x80000000 | 43, 44 },
|
||||
}}),
|
||||
// Slot 'onEmbeddedSendRequested'
|
||||
QtMocHelpers::SlotData<void(const QString &, const QString &, const QString &, const QString &, const QString &, const QDateTime &, const QString &, const QStringList &)>(45, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ QMetaType::QString, 46 }, { QMetaType::QString, 47 }, { QMetaType::QString, 48 }, { QMetaType::QString, 49 },
|
||||
{ QMetaType::QString, 50 }, { QMetaType::QDateTime, 51 }, { QMetaType::QString, 52 }, { QMetaType::QStringList, 53 },
|
||||
}}),
|
||||
// Slot 'onEmbeddedDiscardRequested'
|
||||
QtMocHelpers::SlotData<void()>(54, 2, QMC::AccessPrivate, QMetaType::Void),
|
||||
// Slot 'onEmbeddedDetachRequested'
|
||||
QtMocHelpers::SlotData<void(QWidget *)>(55, 2, QMC::AccessPrivate, QMetaType::Void, {{
|
||||
{ 0x80000000 | 56, 57 },
|
||||
}}),
|
||||
};
|
||||
QtMocHelpers::UintData qt_properties {
|
||||
};
|
||||
@@ -134,17 +245,52 @@ void MainMainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _
|
||||
case 1: _t->onFolderSelected((*reinterpret_cast<std::add_pointer_t<QModelIndex>>(_a[1]))); break;
|
||||
case 2: _t->onEmailSelected((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 3: _t->onComposeRequested(); break;
|
||||
case 4: _t->onReaderReplyRequested((*reinterpret_cast<std::add_pointer_t<const MailItem*>>(_a[1]))); break;
|
||||
case 5: _t->onNewMessage(); break;
|
||||
case 6: _t->openMailInIndependentWindow((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 7: _t->onAddAccountRequested(); break;
|
||||
case 8: _t->onAccountEditRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 9: _t->onAccountDeleteRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 10: _t->onProgressChanged((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 11: _t->onStatusMessage((*reinterpret_cast<std::add_pointer_t<QString>>(_a[1]))); break;
|
||||
case 4: _t->onReaderReplyRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 5: _t->onReaderForwardRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 6: _t->onReaderDeleteRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 7: _t->onNewMessage(); break;
|
||||
case 8: _t->openMailInIndependentWindow((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 9: _t->onAddAccountRequested(); break;
|
||||
case 10: _t->onAccountEditRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 11: _t->onAccountDeleteRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 12: _t->onProgressChanged((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 13: _t->onStatusMessage((*reinterpret_cast<std::add_pointer_t<QString>>(_a[1]))); break;
|
||||
case 14: _t->onSyncRequested(); break;
|
||||
case 15: _t->onSettingsRequested(); break;
|
||||
case 16: _t->updateMaximizeButtonIcon(); break;
|
||||
case 17: _t->onCategorySelected((*reinterpret_cast<std::add_pointer_t<Category>>(_a[1]))); break;
|
||||
case 18: _t->onCategoryDoubleClicked((*reinterpret_cast<std::add_pointer_t<Category>>(_a[1]))); break;
|
||||
case 19: _t->onAssignCategoryRequested((*reinterpret_cast<std::add_pointer_t<qint64>>(_a[1])),(*reinterpret_cast<std::add_pointer_t<qint64>>(_a[2]))); break;
|
||||
case 20: _t->onCategoryCreated((*reinterpret_cast<std::add_pointer_t<Category>>(_a[1]))); break;
|
||||
case 21: _t->onCategoryEdited((*reinterpret_cast<std::add_pointer_t<Category>>(_a[1]))); break;
|
||||
case 22: _t->onCategoryDeleted((*reinterpret_cast<std::add_pointer_t<qint64>>(_a[1]))); break;
|
||||
case 23: _t->onRulesChanged(); break;
|
||||
case 24: _t->onRunRulesOnFolder(); break;
|
||||
case 25: _t->onRunRulesOnSelected(); break;
|
||||
case 26: _t->showRulesManager(); break;
|
||||
case 27: _t->showTemplatesManager(); break;
|
||||
case 28: _t->onFlagRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 29: _t->onDeleteRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 30: _t->onCategoryRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1]))); break;
|
||||
case 31: _t->onMoreRequested((*reinterpret_cast<std::add_pointer_t<int>>(_a[1])),(*reinterpret_cast<std::add_pointer_t<QPoint>>(_a[2]))); break;
|
||||
case 32: _t->onEmbeddedSendRequested((*reinterpret_cast<std::add_pointer_t<QString>>(_a[1])),(*reinterpret_cast<std::add_pointer_t<QString>>(_a[2])),(*reinterpret_cast<std::add_pointer_t<QString>>(_a[3])),(*reinterpret_cast<std::add_pointer_t<QString>>(_a[4])),(*reinterpret_cast<std::add_pointer_t<QString>>(_a[5])),(*reinterpret_cast<std::add_pointer_t<QDateTime>>(_a[6])),(*reinterpret_cast<std::add_pointer_t<QString>>(_a[7])),(*reinterpret_cast<std::add_pointer_t<QStringList>>(_a[8]))); break;
|
||||
case 33: _t->onEmbeddedDiscardRequested(); break;
|
||||
case 34: _t->onEmbeddedDetachRequested((*reinterpret_cast<std::add_pointer_t<QWidget*>>(_a[1]))); break;
|
||||
default: ;
|
||||
}
|
||||
}
|
||||
if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||
switch (_id) {
|
||||
default: *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType(); break;
|
||||
case 34:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType(); break;
|
||||
case 0:
|
||||
*reinterpret_cast<QMetaType *>(_a[0]) = QMetaType::fromType< QWidget* >(); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QMetaObject *MainMainWindow::metaObject() const
|
||||
@@ -166,14 +312,14 @@ int MainMainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 12)
|
||||
if (_id < 35)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 12;
|
||||
_id -= 35;
|
||||
}
|
||||
if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||
if (_id < 12)
|
||||
*reinterpret_cast<QMetaType *>(_a[0]) = QMetaType();
|
||||
_id -= 12;
|
||||
if (_id < 35)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 35;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user