Changeset View
Changeset View
Standalone View
Standalone View
sidebar/package/contents/ui/SubCategoryPage.qml
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Line(s) | 141 | Connections { | |||
---|---|---|---|---|---|
150 | } | 150 | } | ||
151 | onIntroPageVisibleChanged: { | 151 | onIntroPageVisibleChanged: { | ||
152 | if (systemsettings.introPageVisible) { | 152 | if (systemsettings.introPageVisible) { | ||
153 | root.pageStack.pop(mainColumn) | 153 | root.pageStack.pop(mainColumn) | ||
154 | } | 154 | } | ||
155 | } | 155 | } | ||
156 | } | 156 | } | ||
157 | 157 | | |||
158 | delegate: Kirigami.BasicListItem { | 158 | delegate: Kirigami.AbstractListItem { | ||
159 | id: delegate | 159 | id: delegate | ||
160 | icon: model.decoration | | |||
161 | label: model.display | | |||
162 | separatorVisible: false | 160 | separatorVisible: false | ||
163 | onClicked: { | 161 | onClicked: { | ||
164 | systemsettings.loadModule(subCategoryView.model.index(index, 0)); | 162 | systemsettings.loadModule(subCategoryView.model.index(index, 0)); | ||
165 | } | 163 | } | ||
166 | onHoveredChanged: { | 164 | onHoveredChanged: { | ||
167 | if (hovered) { | 165 | if (hovered) { | ||
168 | systemsettings.requestToolTip(subCategoryView.model.index(index, 0), delegate.mapToItem(root, 0, 0, width, height)); | 166 | systemsettings.requestToolTip(subCategoryView.model.index(index, 0), delegate.mapToItem(root, 0, 0, width, height)); | ||
169 | } else { | 167 | } else { | ||
170 | systemsettings.hideToolTip(); | 168 | systemsettings.hideToolTip(); | ||
171 | } | 169 | } | ||
172 | } | 170 | } | ||
173 | onFocusChanged: { | 171 | onFocusChanged: { | ||
174 | if (focus) { | 172 | if (focus) { | ||
175 | onCurrentIndexChanged: subCategoryView.positionViewAtIndex(index, ListView.Contain); | 173 | onCurrentIndexChanged: subCategoryView.positionViewAtIndex(index, ListView.Contain); | ||
176 | } | 174 | } | ||
177 | } | 175 | } | ||
178 | highlighted: systemsettings.activeSubCategoryRow == index | 176 | highlighted: systemsettings.activeSubCategoryRow == index | ||
179 | Keys.onEnterPressed: clicked(); | 177 | Keys.onEnterPressed: clicked(); | ||
180 | Keys.onReturnPressed: clicked(); | 178 | Keys.onReturnPressed: clicked(); | ||
179 | contentItem: CategoryItem {} | ||||
181 | } | 180 | } | ||
182 | } | 181 | } | ||
183 | } | 182 | } | ||
mart: width: Kirigami.Units.iconSizes.small | |||||
bport: Thanks I will fix that | |||||
ervin: Spaces missing around * | |||||
This is twice the same Rectangle item, what about we make a reusable element and use it at both places to reduce code duplication? ervin: This is twice the same Rectangle item, what about we make a reusable element and use it at both… |
width: Kirigami.Units.iconSizes.small