19import QtQuick.Controls.Suru 2.2
20import Lomiri.Components 1.3
21import Lomiri.Components.Popups 1.3
22import Dekko.Components 1.0
23import Dekko.Mail.API 1.0
24import Dekko.Mail.Stores.Composer 1.0
26import Dekko.Lomiri.Components 1.0
27import Dekko.Lomiri.Constants 1.0
29BottomEdgeConfiguration {
31 sourceComponent: DekkoPage {
32 width: dekkoPage.width
33 height: dekkoPage.height
36 color: Suru.backgroundColor
38 pageHeader.title: qsTr("New message")
39 pageHeader.backAction: Action {
41 onTriggered: ComposerActions.discardMessage()
43 pageHeader.primaryAction: ComposerStore.actions.attachmentsAction
44 pageHeader.secondaryActions: [
47 text: qsTr(
"Contacts")
48 onTriggered: PopupUtils.open(Qt.resolvedUrl(
"./ComposerOverflowMenu.qml"), composer)
50 ComposerStore.actions.toggleComposeModeAction,
52 iconName: ComposerStore.actions.sendAction.iconName
53 text: ComposerStore.actions.sendAction.text
54 enabled: ComposerStore.actions.sendAction.enabled
55 onTriggered: ComposerStore.actions.sendAction.trigger()
65 bottom: ap.visible ? ap.top : parent.bottom
76 maxHeight: composer.height -
Style.defaultSpacing
77 visible: ComposerStore.attachments.count > 0 && !Qt.inputMethod.visible
78 countText: ComposerStore.attachments.count
79 text: qsTr(
"Attachments")
80 iconName: Icons.AttachmentIcon
82 model: ComposerStore.attachments
85 property Component openItem: Item{}
86 property var attachment: model.qtObject
87 height: aLayout.implicitHeight
90 triggerIndex: model.index
91 leftSideAction: ComposerStore.actions.deleteAttachment
93 if (mouse.button === Qt.RightButton) {
94 PopupUtils.open(Qt.resolvedUrl(
"../popovers/AttachmentPopover.qml"),
98 attachment: model.qtObject
102 Log.logInfo(
"AttachmentList::openAttachment",
"Attachment octet size is: %1".arg(model.qtObject.sizeInBytes))
103 Qt.openUrlExternally(
"file:///%1".arg(attachment.url))
107 title.text: attachment.displayName
108 subtitle.text: attachment.size
111 source: Paths.mimeIconForUrl(
"file:///%1".arg(attachment.url))
112 color: LomiriColors.ash
113 height:
Style.largeSpacing; width: height
114 SlotsLayout.position: SlotsLayout.Leading
118 target: model.qtObject
120 Qt.openUrlExternally(url)
129 runWhen: ViewKeys.closeComposer
130 enabled: listenerEnabled
132 if (!dekko.isLargeFF) {
133 bottomEdge.collapse()
140 enabled: !dekko.isLargeFF
141 filter: ViewKeys.closeComposer
143 bottomEdge.collapse()