Changeset View
Changeset View
Standalone View
Standalone View
sidebar/package/contents/ui/CategoriesPage.qml
Show All 23 Lines | |||||
24 | 24 | | |||
25 | 25 | | |||
26 | Kirigami.ScrollablePage { | 26 | Kirigami.ScrollablePage { | ||
27 | id: mainColumn | 27 | id: mainColumn | ||
28 | Component.onCompleted: searchField.forceActiveFocus() | 28 | Component.onCompleted: searchField.forceActiveFocus() | ||
29 | 29 | | |||
30 | header: Item { | 30 | header: Item { | ||
31 | width: mainColumn.width | 31 | width: mainColumn.width | ||
32 | height:searchLayout.height + Kirigami.Units.smallSpacing * 2 | 32 | height: searchLayout.implicitHeight + Kirigami.Units.smallSpacing * 2 | ||
33 | RowLayout { | 33 | RowLayout { | ||
34 | id: searchLayout | 34 | id: searchLayout | ||
35 | height: Math.max(menuButton.height, Kirigami.Units.gridUnit * 2) | 35 | height: menuButton.height | ||
36 | spacing: Kirigami.Units.smallSpacing | ||||
36 | anchors { | 37 | anchors { | ||
37 | fill: parent | 38 | fill: parent | ||
38 | margins: Kirigami.Units.smallSpacing | 39 | margins: Kirigami.Units.smallSpacing | ||
39 | } | 40 | } | ||
40 | QtControls.ToolButton { | 41 | QtControls.ToolButton { | ||
41 | id: menuButton | 42 | id: menuButton | ||
42 | iconName: "application-menu" | 43 | iconName: "application-menu" | ||
44 | Layout.maximumWidth: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | ||||
45 | Layout.maximumHeight: width | ||||
43 | menu: QtControls.Menu { | 46 | menu: QtControls.Menu { | ||
44 | id: globalMenu | 47 | id: globalMenu | ||
45 | QtControls.MenuItem { | 48 | QtControls.MenuItem { | ||
46 | text: i18n("Configure") | 49 | text: i18n("Configure") | ||
47 | iconName: "settings-configure" | 50 | iconName: "settings-configure" | ||
48 | onTriggered: systemsettings.triggerGlobalAction("configure"); | 51 | onTriggered: systemsettings.triggerGlobalAction("configure"); | ||
49 | } | 52 | } | ||
50 | QtControls.MenuItem { | 53 | QtControls.MenuItem { | ||
Show All 11 Lines | 63 | QtControls.MenuItem { | |||
62 | iconName: "kde" | 65 | iconName: "kde" | ||
63 | onTriggered: systemsettings.triggerGlobalAction("help_about_kde"); | 66 | onTriggered: systemsettings.triggerGlobalAction("help_about_kde"); | ||
64 | } | 67 | } | ||
65 | } | 68 | } | ||
66 | } | 69 | } | ||
67 | QtControls.TextField { | 70 | QtControls.TextField { | ||
68 | id: searchField | 71 | id: searchField | ||
69 | focus: true | 72 | focus: true | ||
73 | Layout.minimumHeight: Layout.maximumHeight | ||||
74 | Layout.maximumHeight: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2 | ||||
70 | Layout.fillWidth: true | 75 | Layout.fillWidth: true | ||
71 | placeholderText: i18n("Search...") | 76 | placeholderText: i18n("Search...") | ||
72 | onTextChanged: { | 77 | onTextChanged: { | ||
73 | systemsettings.categoryModel.filterRegExp = text; | 78 | systemsettings.categoryModel.filterRegExp = text; | ||
74 | } | 79 | } | ||
75 | MouseArea { | 80 | MouseArea { | ||
76 | anchors { | 81 | anchors { | ||
77 | right: parent.right | 82 | right: parent.right | ||
Show All 16 Lines | |||||
94 | } | 99 | } | ||
95 | } | 100 | } | ||
96 | } | 101 | } | ||
97 | } | 102 | } | ||
98 | Kirigami.Separator { | 103 | Kirigami.Separator { | ||
99 | anchors { | 104 | anchors { | ||
100 | left: parent.left | 105 | left: parent.left | ||
101 | right: parent.right | 106 | right: parent.right | ||
102 | bottom: parent.bottom | 107 | top: parent.bottom | ||
103 | } | 108 | } | ||
104 | } | 109 | } | ||
105 | } | 110 | } | ||
106 | background: Rectangle { | 111 | background: Rectangle { | ||
107 | color: Kirigami.Theme.viewBackgroundColor | 112 | color: Kirigami.Theme.viewBackgroundColor | ||
108 | } | 113 | } | ||
109 | Kirigami.Heading { | 114 | Kirigami.Heading { | ||
110 | anchors.centerIn: parent | 115 | anchors.centerIn: parent | ||
Show All 12 Lines | |||||
123 | ListView { | 128 | ListView { | ||
124 | id: categoryView | 129 | id: categoryView | ||
125 | anchors.fill: parent | 130 | anchors.fill: parent | ||
126 | model: systemsettings.categoryModel | 131 | model: systemsettings.categoryModel | ||
127 | currentIndex: systemsettings.activeCategory | 132 | currentIndex: systemsettings.activeCategory | ||
128 | onContentYChanged: systemsettings.hideToolTip(); | 133 | onContentYChanged: systemsettings.hideToolTip(); | ||
129 | section { | 134 | section { | ||
130 | property: "categoryDisplayRole" | 135 | property: "categoryDisplayRole" | ||
131 | delegate: Item { | 136 | delegate: Kirigami.AbstractListItem { | ||
132 | width: categoryView.width | 137 | enabled: false | ||
133 | height: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 4 | 138 | separatorVisible: false | ||
134 | Kirigami.Separator { | 139 | RowLayout { | ||
135 | anchors { | | |||
136 | left: parent.left | | |||
137 | right: parent.right | | |||
138 | bottom: sectionLabel.top | | |||
139 | } | | |||
140 | visible: parent.y > 0 | | |||
141 | } | | |||
142 | Kirigami.Label { | | |||
143 | anchors { | 140 | anchors { | ||
144 | bottom: parent.bottom | | |||
145 | left: parent.left | 141 | left: parent.left | ||
146 | right: parent.right | 142 | right: parent.right | ||
147 | leftMargin: Kirigami.Units.smallSpacing | 143 | leftMargin: Kirigami.Units.smallSpacing | ||
148 | } | 144 | } | ||
145 | Kirigami.Label { | ||||
149 | id: sectionLabel | 146 | id: sectionLabel | ||
150 | text: section | 147 | text: section | ||
151 | opacity: 0.3 | 148 | Layout.minimumHeight: Math.max(implicitHeight, Kirigami.Units.iconSizes.smallMedium) | ||
152 | elide: Text.ElideRight | 149 | elide: Text.ElideRight | ||
153 | //FIXME: kirigami bug, why? | 150 | //FIXME: kirigami bug, why? | ||
154 | Component.onCompleted: font.bold = true | 151 | Component.onCompleted: font.bold = true | ||
155 | } | 152 | } | ||
156 | } | 153 | } | ||
157 | } | 154 | } | ||
155 | } | ||||
158 | 156 | | |||
159 | delegate: Kirigami.BasicListItem { | 157 | delegate: Kirigami.BasicListItem { | ||
160 | id: delegate | 158 | id: delegate | ||
161 | icon: model.decoration | 159 | icon: model.decoration | ||
162 | label: model.display | 160 | label: model.display | ||
163 | separatorVisible: false | 161 | separatorVisible: false | ||
164 | activeFocusOnTab: root.pageStack.currentIndex == 0 | 162 | activeFocusOnTab: root.pageStack.currentIndex == 0 | ||
165 | highlighted: focus | 163 | highlighted: focus | ||
Show All 34 Lines |