Set up structure for Phase 5: ReaderPage and ComposePage placeholders, updated MailListPage and Shell for navigation to reader and composer
This commit is contained in:
+105
-78
@@ -14,9 +14,62 @@ Item {
|
||||
id: emailModel
|
||||
}
|
||||
|
||||
// Layout: SplitView for resizable panes
|
||||
// Signals
|
||||
signal emailSelected(int emailId)
|
||||
signal composeRequested
|
||||
|
||||
// Header
|
||||
Rectangle {
|
||||
id: header
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 50
|
||||
color: "#1976D2"
|
||||
|
||||
// Title
|
||||
Text {
|
||||
text: qsTr("Wino Mail")
|
||||
color: "white"
|
||||
font.pointSize: 18
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 16
|
||||
}
|
||||
|
||||
// Compose button
|
||||
Rectangle {
|
||||
id: composeButton
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.margins: 10
|
||||
width: 40
|
||||
height: 40
|
||||
color: "#e0e0e0"
|
||||
radius: 5
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
mailListPage.composeRequested()
|
||||
}
|
||||
}
|
||||
Text {
|
||||
text: "✎"
|
||||
anchors.centerIn: parent
|
||||
font.pointSize: 20
|
||||
color: "#333"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Main content: SplitView for folder list and email list
|
||||
SplitView {
|
||||
anchors.fill: parent
|
||||
anchors {
|
||||
top: header.bottom
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
// Left pane: Folder list
|
||||
Rectangle {
|
||||
@@ -64,93 +117,67 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Right pane: Email list and preview
|
||||
// Right pane: Email list (full height)
|
||||
Rectangle {
|
||||
color: "#fafafa"
|
||||
SplitView {
|
||||
orientation: Qt.Vertical
|
||||
ListView {
|
||||
id: emailListView
|
||||
anchors.fill: parent
|
||||
|
||||
// Email list (top)
|
||||
Rectangle {
|
||||
Layout.minimumHeight: 200
|
||||
color: "#fafafa"
|
||||
ListView {
|
||||
id: emailListView
|
||||
clip: true
|
||||
model: emailModel
|
||||
delegate: Item {
|
||||
height: 60
|
||||
Layout.fillWidth: true
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
model: emailModel
|
||||
delegate: Item {
|
||||
height: 60
|
||||
Layout.fillWidth: true
|
||||
color: ListView.isCurrentItem ? "#e3f2fd" : "transparent"
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 8
|
||||
// Sender avatar/initial
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: ListView.isCurrentItem ? "#e3f2fd" : "transparent"
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 8
|
||||
// Sender avatar/initial
|
||||
Rectangle {
|
||||
width: 40
|
||||
height: 40
|
||||
color: "#cccccc"
|
||||
Text {
|
||||
text: senderInitial
|
||||
anchors.centerIn: parent
|
||||
font.pointSize: 16
|
||||
color: "#666"
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 4
|
||||
Text {
|
||||
text: senderName
|
||||
font.pointSize: 14
|
||||
color: "#333"
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: subject
|
||||
font.pointSize: 13
|
||||
color: "#666"
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: time
|
||||
font.pointSize: 12
|
||||
color: "#999"
|
||||
}
|
||||
}
|
||||
width: 40
|
||||
height: 40
|
||||
color: "#cccccc"
|
||||
Text {
|
||||
text: senderInitial
|
||||
anchors.centerIn: parent
|
||||
font.pointSize: 16
|
||||
color: "#666"
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
emailListView.currentIndex = index
|
||||
// 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()
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: 4
|
||||
Text {
|
||||
text: senderName
|
||||
font.pointSize: 14
|
||||
color: "#333"
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: subject
|
||||
font.pointSize: 13
|
||||
color: "#666"
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: time
|
||||
font.pointSize: 12
|
||||
color: "#999"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Email preview (bottom)
|
||||
Rectangle {
|
||||
Layout.minimumHeight: 200
|
||||
color: "#ffffff"
|
||||
Text {
|
||||
id: emailPreview
|
||||
text: "Select an email to preview"
|
||||
anchors.centerIn: parent
|
||||
font.pointSize: 14
|
||||
color: "#666"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
emailListView.currentIndex = index
|
||||
// Emit signal with email id
|
||||
emailSelected(model.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user