Changeset View
Changeset View
Standalone View
Standalone View
src/controls/GlobalDrawer.qml
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | 66 | OverlayDrawer { | |||
---|---|---|---|---|---|
181 | * On the actions menu, whenever a leaf action is triggered, the menu | 181 | * On the actions menu, whenever a leaf action is triggered, the menu | ||
182 | * will reset to its parent. | 182 | * will reset to its parent. | ||
183 | */ | 183 | */ | ||
184 | property bool resetMenuOnTriggered: true | 184 | property bool resetMenuOnTriggered: true | ||
185 | 185 | | |||
186 | /** | 186 | /** | ||
187 | * currentSubMenu: Action | 187 | * currentSubMenu: Action | ||
188 | * | 188 | * | ||
189 | * Points to the action acting as a submenu | 189 | * Points to the action acting as a submenu | ||
mart: bannerClicked() | |||||
190 | */ | 190 | */ | ||
191 | readonly property Action currentSubMenu: stackView.currentItem ? stackView.currentItem.current: null | 191 | readonly property Action currentSubMenu: stackView.currentItem ? stackView.currentItem.current: null | ||
192 | 192 | | |||
193 | /** | 193 | /** | ||
194 | * Notifies that the banner has been clicked | ||||
195 | */ | ||||
196 | signal bannerClicked() | ||||
197 | | ||||
198 | /** | ||||
194 | * Reverts the menu back to its initial state | 199 | * Reverts the menu back to its initial state | ||
195 | */ | 200 | */ | ||
196 | function resetMenu() { | 201 | function resetMenu() { | ||
197 | stackView.pop(stackView.initialItem); | 202 | stackView.pop(stackView.initialItem); | ||
198 | if (root.modal) { | 203 | if (root.modal) { | ||
199 | root.opened = false; | 204 | root.opened = false; | ||
200 | } | 205 | } | ||
201 | } | 206 | } | ||
Show All 17 Lines | 223 | Image { | |||
219 | id: bannerImage | 224 | id: bannerImage | ||
220 | 225 | | |||
221 | Layout.fillWidth: true | 226 | Layout.fillWidth: true | ||
222 | 227 | | |||
223 | Layout.preferredWidth: title.implicitWidth | 228 | Layout.preferredWidth: title.implicitWidth | ||
224 | Layout.preferredHeight: bannerImageSource != "" ? Math.max(title.implicitHeight, Math.floor(width / (sourceSize.width/sourceSize.height))) : title.implicitHeight | 229 | Layout.preferredHeight: bannerImageSource != "" ? Math.max(title.implicitHeight, Math.floor(width / (sourceSize.width/sourceSize.height))) : title.implicitHeight | ||
225 | Layout.minimumHeight: Math.max(headingIcon.height, heading.height) + Units.smallSpacing * 2 | 230 | Layout.minimumHeight: Math.max(headingIcon.height, heading.height) + Units.smallSpacing * 2 | ||
226 | 231 | | |||
232 | MouseArea { | ||||
233 | anchors.fill: parent | ||||
234 | onClicked: root.bannerClicked() | ||||
235 | } | ||||
236 | | ||||
227 | fillMode: Image.PreserveAspectCrop | 237 | fillMode: Image.PreserveAspectCrop | ||
228 | asynchronous: true | 238 | asynchronous: true | ||
229 | 239 | | |||
230 | anchors { | 240 | anchors { | ||
231 | left: parent.left | 241 | left: parent.left | ||
232 | right: parent.right | 242 | right: parent.right | ||
233 | top: parent.top | 243 | top: parent.top | ||
234 | } | 244 | } | ||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |
bannerClicked()