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: Item { | 28 | header: Item { | ||
29 | width: subCategoryColumn.width | 29 | width: subCategoryColumn.width | ||
30 | height: topLayout.height + Kirigami.Units.smallSpacing * 2 | 30 | height: topLayout.implicitHeight + Kirigami.Units.smallSpacing * 2 | ||
31 | RowLayout { | 31 | RowLayout { | ||
32 | id: topLayout | 32 | id: topLayout | ||
33 | height: Math.max(backButton.height, Kirigami.Units.gridUnit * 2) | 33 | height: backButton.height | ||
34 | spacing: Kirigami.Units.smallSpacing | ||||
34 | anchors { | 35 | anchors { | ||
35 | fill: parent | 36 | fill: parent | ||
36 | margins: Kirigami.Units.smallSpacing | 37 | margins: Kirigami.Units.smallSpacing | ||
38 | leftMargin: backButton.visible ? Kirigami.Units.smallSpacing : Kirigami.Units.smallSpacing * 2 | ||||
37 | } | 39 | } | ||
38 | QtControls.ToolButton { | 40 | QtControls.ToolButton { | ||
39 | id: backButton | 41 | id: backButton | ||
42 | Layout.maximumWidth: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | ||||
43 | Layout.maximumHeight: width | ||||
40 | visible: !applicationWindow().wideScreen | 44 | visible: !applicationWindow().wideScreen | ||
41 | iconName: "go-previous" | 45 | iconName: "go-previous" | ||
42 | onClicked: root.pageStack.currentIndex = 0; | 46 | onClicked: root.pageStack.currentIndex = 0; | ||
43 | } | 47 | } | ||
44 | Kirigami.Label { | 48 | Kirigami.Label { | ||
45 | Layout.fillWidth: true | 49 | Layout.fillWidth: true | ||
50 | Layout.minimumHeight: Layout.maximumHeight | ||||
51 | Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | ||||
46 | text: subCategoryColumn.title | 52 | text: subCategoryColumn.title | ||
47 | elide: Text.ElideRight | 53 | elide: Text.ElideRight | ||
48 | opacity: 0.3 | 54 | opacity: 0.3 | ||
49 | //FIXME: kirigami bug, why? | 55 | //FIXME: kirigami bug, why? | ||
50 | Component.onCompleted: font.bold = true | 56 | Component.onCompleted: font.bold = true | ||
51 | } | 57 | } | ||
52 | } | 58 | } | ||
53 | Kirigami.Separator { | 59 | Kirigami.Separator { | ||
54 | anchors { | 60 | anchors { | ||
55 | left: parent.left | 61 | left: parent.left | ||
56 | right: parent.right | 62 | right: parent.right | ||
57 | bottom: parent.bottom | 63 | top: parent.bottom | ||
58 | } | 64 | } | ||
59 | } | 65 | } | ||
60 | } | 66 | } | ||
61 | background: Rectangle { | 67 | background: Rectangle { | ||
62 | color: Kirigami.Theme.viewBackgroundColor | 68 | color: Kirigami.Theme.viewBackgroundColor | ||
63 | } | 69 | } | ||
64 | ListView { | 70 | ListView { | ||
65 | id: subCategoryView | 71 | id: subCategoryView | ||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |