Complete Phase 4: Basic UI with QML - MailListPage with folder/email navigation, models connected to DAOs, placeholder pages for Calendar/Contacts/Settings

This commit is contained in:
Padrino
2026-05-17 01:52:34 +02:00
parent acec320222
commit 822ed5db47
7 changed files with 235 additions and 43 deletions
+27 -4
View File
@@ -6,6 +6,14 @@ Item {
id: mailListPage
anchors.fill: parent
// Models
FolderListModel {
id: folderModel
}
EmailListModel {
id: emailModel
}
// Layout: SplitView for resizable panes
SplitView {
anchors.fill: parent
@@ -18,7 +26,7 @@ Item {
id: folderListView
anchors.fill: parent
clip: true
model: FolderModel {}
model: folderModel
delegate: Item {
height: 40
Layout.fillWidth: true
@@ -38,7 +46,18 @@ Item {
anchors.fill: parent
onClicked: {
folderListView.currentIndex = index
// TODO: Load emails for selected folder
// Load emails for selected folder
// For now, we'll map folder names to IDs (hardcoded for demo)
var folderId = 0; // Inbox
switch (folderName) {
case "Inbox": folderId = 0; break;
case "Sent": folderId = 1; break;
case "Drafts": folderId = 2; break;
case "Trash": folderId = 3; break;
case "Spam": folderId = 4; break;
default: folderId = 0;
}
emailModel.setFolderId(folderId);
}
}
}
@@ -60,7 +79,7 @@ Item {
id: emailListView
anchors.fill: parent
clip: true
model: EmailModel {}
model: emailModel
delegate: Item {
height: 60
Layout.fillWidth: true
@@ -111,7 +130,11 @@ Item {
anchors.fill: parent
onClicked: {
emailListView.currentIndex = index
// TODO: Show email preview in the bottom pane
// Show email preview in the bottom pane
// For demo, we'll show some basic info
emailPreview.text = "From: " + senderName + "\n" +
"Subject: " + subject + "\n" +
"Date: " + time.toString()
}
}
}