19import QtQuick.Controls.Suru 2.2
20import Lomiri.Components 1.3
22import Dekko.Components 1.0
23import Dekko.Lomiri.Components 1.0
28 property bool actionsEnabled: false
31 function getIconForFolderType(f) {
33 case Folder.StandardFolder:
34 return Icons.InboxIcon
35 case Folder.SpecialUseInboxFolder:
36 return Icons.CombineInboxIcon
37 case Folder.SpecialUseOutboxFolder:
38 return Icons.InboxIcon
39 case Folder.SpecialUseDraftsFolder:
40 return Icons.DraftIcon
41 case Folder.SpecialUseSentFolder:
42 return Icons.SendIcon;
43 case Folder.SpecialUseTrashFolder:
44 return Icons.DeleteIcon
45 case Folder.SpecialUseJunkFolder:
50 property list<Action> ctxtActions: [
53 text: folder && folder.isFavourite ? qsTr(
"Un-favourite") : qsTr(
"Favourite")
54 iconSource: folder && folder.isFavourite ? Paths.actionIconUrl(Paths.UnStarredIcon) :
55 Paths.actionIconUrl(Paths.StarredIcon)
56 onTriggered: folder.isFavourite = !folder.isFavourite
61 rightSideActions: actionsEnabled ? ctxtActions : []
69 showActionHighlight:
false
74 title.text: folder ? folder.name :
""
79 name: getIconForFolderType(folder)
80 color: LomiriColors.ash
81 SlotsLayout.position: SlotsLayout.Leading
84 height: units.gu(1.75)
86 visible: folder.isFavourite
89 bottomMargin: -units.gu(1.25)
90 leftMargin: -units.gu(1.25)
94 name: Icons.StarredIcon
99 visible: folder.unreadCount > 0
100 aspect: LomiriShape.Flat
101 color: Suru.secondaryBackgroundColor
102 height: units.gu(2.2)
103 width: countLable.width < height ? height : countLable.width + units.gu(1)
106 anchors.margins: units.gu(0.5)
107 anchors.centerIn: parent
109 text: folder.unreadCount
112 padding.leading: 1 * units.gu(folder.nestingDepth) + units.gu(2)