Changeset View
Changeset View
Standalone View
Standalone View
sidebar/package/contents/ui/SubCategoryPage.qml
Show All 21 Lines | |||||
22 | import QtQuick.Controls 2.0 as QtControls2 | 22 | import QtQuick.Controls 2.0 as QtControls2 | ||
23 | import org.kde.kirigami 2.1 as Kirigami | 23 | import org.kde.kirigami 2.1 as Kirigami | ||
24 | 24 | | |||
25 | 25 | | |||
26 | Kirigami.ScrollablePage { | 26 | Kirigami.ScrollablePage { | ||
27 | id: subCategoryColumn | 27 | id: subCategoryColumn | ||
28 | header: MouseArea { | 28 | header: MouseArea { | ||
29 | width: subCategoryColumn.width | 29 | width: subCategoryColumn.width | ||
30 | height: topLayout.implicitHeight + Kirigami.Units.smallSpacing * 2 | 30 | height: toolButtonIcon.height + Kirigami.Units.smallSpacing * 4 | ||
31 | enabled: !applicationWindow().wideScreen | 31 | enabled: !applicationWindow().wideScreen | ||
32 | cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor | | |||
33 | onClicked: root.pageStack.currentIndex = 0; | 32 | onClicked: root.pageStack.currentIndex = 0; | ||
34 | Accessible.role: Accessible.Button | 33 | Accessible.role: Accessible.Button | ||
35 | Accessible.name: i18n("Back") | 34 | Accessible.name: i18n("Back") | ||
36 | RowLayout { | 35 | | ||
37 | id: topLayout | 36 | Item { | ||
38 | height: backButton.height | 37 | id: headerControls | ||
39 | spacing: Kirigami.Units.smallSpacing | 38 | | ||
40 | anchors { | 39 | anchors.fill: parent | ||
41 | fill: parent | 40 | anchors.margins: Kirigami.Units.smallSpacing | ||
42 | margins: Kirigami.Units.smallSpacing | 41 | | ||
43 | leftMargin: backButton.visible ? Kirigami.Units.smallSpacing : Kirigami.Units.smallSpacing * 2 | | |||
44 | } | | |||
45 | QtControls.ToolButton { | 42 | QtControls.ToolButton { | ||
46 | id: backButton | 43 | id: backButton | ||
47 | Layout.maximumWidth: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | 44 | anchors.fill: parent | ||
48 | Layout.maximumHeight: width | | |||
49 | visible: !applicationWindow().wideScreen | 45 | visible: !applicationWindow().wideScreen | ||
50 | iconName: "go-previous" | | |||
51 | onClicked: root.pageStack.currentIndex = 0; | 46 | onClicked: root.pageStack.currentIndex = 0; | ||
47 | | ||||
48 | Item { | ||||
49 | anchors.fill: parent | ||||
50 | opacity: 0.3 | ||||
51 | | ||||
52 | Kirigami.Icon { | ||||
53 | id: toolButtonIcon | ||||
54 | anchors { | ||||
55 | left: parent.left | ||||
56 | verticalCenter: parent.verticalCenter | ||||
57 | } | ||||
58 | height: Kirigami.Units.iconSizes.small | ||||
59 | width: height | ||||
60 | source: "go-previous" | ||||
52 | } | 61 | } | ||
62 | | ||||
53 | Kirigami.Label { | 63 | Kirigami.Label { | ||
54 | Layout.fillWidth: true | 64 | anchors { | ||
55 | Layout.minimumHeight: Layout.maximumHeight | 65 | left: toolButtonIcon.right | ||
56 | Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | 66 | right: parent.right | ||
67 | leftMargin: Kirigami.Units.smallSpacing | ||||
68 | verticalCenter: parent.verticalCenter | ||||
69 | } | ||||
70 | height: toolButtonIcon.height | ||||
71 | text: subCategoryColumn.title | ||||
72 | elide: Text.ElideRight | ||||
73 | //FIXME: kirigami bug, why? | ||||
74 | Component.onCompleted: font.bold = true | ||||
75 | } | ||||
76 | } | ||||
77 | } | ||||
78 | Kirigami.Label { | ||||
79 | anchors { | ||||
80 | fill: parent | ||||
81 | leftMargin: Kirigami.Units.smallSpacing | ||||
82 | } | ||||
57 | text: subCategoryColumn.title | 83 | text: subCategoryColumn.title | ||
58 | elide: Text.ElideRight | 84 | elide: Text.ElideRight | ||
85 | visible: !backButton.visible | ||||
59 | opacity: 0.3 | 86 | opacity: 0.3 | ||
60 | //FIXME: kirigami bug, why? | 87 | //FIXME: kirigami bug, why? | ||
61 | Component.onCompleted: font.bold = true | 88 | Component.onCompleted: font.bold = true | ||
62 | } | 89 | } | ||
63 | } | 90 | } | ||
64 | Kirigami.Separator { | 91 | Kirigami.Separator { | ||
65 | anchors { | 92 | anchors { | ||
66 | left: parent.left | 93 | left: parent.left | ||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |