Dekko
Composer.qml
1 import QtQuick 2.4
2 import QtQuick.Controls.Suru 2.2
3 import Lomiri.Components 1.3
4 import Dekko.Components 1.0
5 import Dekko.Mail 1.0
6 import Dekko.Mail.API 1.0
7 import Dekko.Mail.Stores.Composer 1.0
8 import QuickFlux 1.0
9 import PlugMan 1.0
10 import Dekko.Lomiri.Components 1.0
11 import Dekko.Lomiri.Constants 1.0
12 import Dekko.Lomiri.Helpers 1.0
13 import "../components"
14 
15 ViewState {
16  id: composer
17  anchors.fill: parent
18 
19  StretchColumn {
20  anchors.fill: parent
21 
22  Rectangle {
23  anchors {
24  top: parent.top
25  right: parent.right
26  left: parent.left
27  }
28  height: units.gu(6)
29  implicitHeight: height
30  color: Suru.secondaryBackgroundColor
31  StretchRow {
32  id: row
33  anchors.fill: parent
34  anchors.leftMargin: units.gu(1)
35  anchors.rightMargin: units.gu(1)
36  spacing: units.gu(1)
37  readonly property bool textVisible: composer.width > units.gu(60)
39  height: units.gu(4)
40  anchors.verticalCenter: parent.verticalCenter
41  action: ComposerStore.actions.discardMessageAction
42  showLabel: row.textVisible
43  }
45  height: units.gu(4)
46  anchors.verticalCenter: parent.verticalCenter
47  visible: ComposerStore.hasValidIdentity
48  action: ComposerStore.actions.saveDraftAction
49  showLabel: row.textVisible
50  }
51 
53  height: units.gu(4)
54  anchors.verticalCenter: parent.verticalCenter
55  action: Action {
56  text: qsTr("Attach")
57  iconName: Icons.AttachmentIcon
58  iconSource: Paths.actionIconUrl(Icons.AttachmentIcon)
59  onTriggered: ContentActions.pickFile(composer)
60  }
61  showLabel: row.textVisible
62  }
63 
64  Stretcher {}
65 
67  height: units.gu(4)
68  anchors.verticalCenter: parent.verticalCenter
69  visible: ComposerStore.hasValidIdentity
70  action: ComposerStore.actions.sendAction
71  showLabel: row.textVisible
72  }
73  }
74 
75  Line {
76  anchors {
77  bottom: parent.bottom
78  right: parent.right
79  left: parent.left
80  }
81  }
82  }
83 
84  Stretcher {
85  id: content
86 
87  StretchRow {
88  anchors.fill: parent
89  spacing: 0
90 
91  Stretcher {
92  implicitHeight: parent.height - attachmentPanel.height
94  id: composePanel
95  anchors.fill: parent
96  }
97  }
98 
100  id: attachmentPanel
101  attachments: ComposerStore.attachments
102  isReadOnly: false
103  anchors {
104  left: parent.left
105  bottom: parent.bottom
106  right: parent.right
107  }
108  maxHeight: parent.height / 2
109  }
110  }
111  }
112  }
113 }
Dekko::Lomiri::Components::TitledHeaderButton
Definition: TitledHeaderButton.qml:24
Dekko::Lomiri::Helpers::ViewState
Definition: ViewState.qml:22
Dekko
Definition: Dekko.qml:30
Dekko::Lomiri::Components::Line
Definition: Line.qml:22
MessageComposer
Definition: MessageComposer.qml:27
AttachmentPanel
Definition: AttachmentPanel.qml:26