Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/package/contents/ui/MenuRepresentation.qml
Show All 21 Lines | |||||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | 24 | | |||
25 | FocusScope { | 25 | FocusScope { | ||
26 | id: root | 26 | id: root | ||
27 | 27 | | |||
28 | focus: true | 28 | focus: true | ||
29 | 29 | | |||
30 | Layout.minimumWidth: sideBar.width + mainRow.spacing + Math.max(units.gridUnit * 14, runnerColumns.width) | 30 | Layout.minimumWidth: (sideBar.width + (sideBar.width ? mainRow.spacing : 0) | ||
31 | Layout.maximumWidth: sideBar.width + mainRow.spacing + Math.max(units.gridUnit * 14, runnerColumns.width) | 31 | + Math.max(units.gridUnit * 14, runnerColumns.width)) | ||
32 | Layout.maximumWidth: Layout.minimumWidth | ||||
davidedmundson: if this is the same as minimumWidth can you just bind to that, it's a bit faster and more… | |||||
32 | 33 | | |||
33 | Layout.minimumHeight: Math.max(((rootModel.count - rootModel.separatorCount) * rootList.itemHeight) | 34 | Layout.minimumHeight: Math.max(((rootModel.count - rootModel.separatorCount) * rootList.itemHeight) | ||
34 | + (rootModel.separatorCount * rootList.separatorHeight) | 35 | + (rootModel.separatorCount * rootList.separatorHeight) | ||
35 | + searchField.height + (2 * units.smallSpacing), sideBar.margins.top + sideBar.margins.bottom | 36 | + searchField.height + (2 * units.smallSpacing), sideBar.margins.top + sideBar.margins.bottom | ||
36 | + favoriteApps.contentHeight + favoriteSystemActions.contentHeight + sidebarSeparator.height | 37 | + favoriteApps.contentHeight + favoriteSystemActions.contentHeight + sidebarSeparator.height | ||
37 | + (4 * units.smallSpacing)) | 38 | + (4 * units.smallSpacing)) | ||
38 | Layout.maximumHeight: Math.max(((rootModel.count - rootModel.separatorCount) * rootList.itemHeight) | 39 | Layout.maximumHeight: Layout.minimumHeight | ||
39 | + (rootModel.separatorCount * rootList.separatorHeight) | | |||
40 | + searchField.height + (2 * units.smallSpacing), sideBar.margins.top + sideBar.margins.bottom | | |||
41 | + favoriteApps.contentHeight + favoriteSystemActions.contentHeight + sidebarSeparator.height | | |||
42 | + (4 * units.smallSpacing)) | | |||
43 | 40 | | |||
44 | signal appendSearchText(string text) | 41 | signal appendSearchText(string text) | ||
45 | 42 | | |||
46 | function reset() { | 43 | function reset() { | ||
47 | plasmoid.hideOnWindowDeactivate = true; | 44 | plasmoid.hideOnWindowDeactivate = true; | ||
48 | 45 | | |||
49 | rootList.currentIndex = -1; | 46 | rootList.currentIndex = -1; | ||
50 | 47 | | |||
Show All 9 Lines | 52 | Row { | |||
60 | spacing: units.smallSpacing | 57 | spacing: units.smallSpacing | ||
61 | 58 | | |||
62 | LayoutMirroring.enabled: ((plasmoid.location == PlasmaCore.Types.RightEdge) | 59 | LayoutMirroring.enabled: ((plasmoid.location == PlasmaCore.Types.RightEdge) | ||
63 | || (Qt.application.layoutDirection == Qt.RightToLeft && plasmoid.location != PlasmaCore.Types.LeftEdge)) | 60 | || (Qt.application.layoutDirection == Qt.RightToLeft && plasmoid.location != PlasmaCore.Types.LeftEdge)) | ||
64 | 61 | | |||
65 | PlasmaCore.FrameSvgItem { | 62 | PlasmaCore.FrameSvgItem { | ||
66 | id: sideBar | 63 | id: sideBar | ||
67 | 64 | | |||
68 | width: units.iconSizes.medium + margins.left + margins.right | 65 | visible: width > 0 | ||
66 | | ||||
67 | width: (globalFavorites && systemFavorites | ||||
68 | && (globalFavorites.count + systemFavorites.count) | ||||
69 | ? units.iconSizes.medium + margins.left + margins.right : 0) | ||||
69 | height: parent.height | 70 | height: parent.height | ||
70 | 71 | | |||
71 | imagePath: "widgets/frame" | 72 | imagePath: "widgets/frame" | ||
72 | prefix: "plain" | 73 | prefix: "plain" | ||
73 | 74 | | |||
74 | SideBarSection { | 75 | SideBarSection { | ||
75 | id: favoriteApps | 76 | id: favoriteApps | ||
76 | 77 | | |||
Show All 34 Lines | 110 | PlasmaCore.SvgItem { | |||
111 | 112 | | |||
112 | anchors.bottom: favoriteSystemActions.top | 113 | anchors.bottom: favoriteSystemActions.top | ||
113 | anchors.bottomMargin: (2 * units.smallSpacing) | 114 | anchors.bottomMargin: (2 * units.smallSpacing) | ||
114 | anchors.horizontalCenter: parent.horizontalCenter | 115 | anchors.horizontalCenter: parent.horizontalCenter | ||
115 | 116 | | |||
116 | width: units.iconSizes.medium | 117 | width: units.iconSizes.medium | ||
117 | height: lineSvg.horLineHeight | 118 | height: lineSvg.horLineHeight | ||
118 | 119 | | |||
119 | visible: favoriteApps.model.count && favoriteSystemActions.model.count | 120 | visible: (favoriteApps.model && favoriteApps.model.count | ||
121 | && favoriteSystemActions.model && favoriteSystemActions.model.count) | ||||
120 | 122 | | |||
121 | svg: lineSvg | 123 | svg: lineSvg | ||
122 | elementId: "horizontal-line" | 124 | elementId: "horizontal-line" | ||
123 | 125 | | |||
124 | states: [ State { | 126 | states: [ State { | ||
125 | name: "top" | 127 | name: "top" | ||
126 | when: (plasmoid.location == PlasmaCore.Types.TopEdge) | 128 | when: (plasmoid.location == PlasmaCore.Types.TopEdge) | ||
127 | 129 | | |||
▲ Show 20 Lines • Show All 172 Lines • ▼ Show 20 Line(s) | |||||
300 | } | 302 | } | ||
301 | } | 303 | } | ||
302 | 304 | | |||
303 | PlasmaComponents.TextField { | 305 | PlasmaComponents.TextField { | ||
304 | id: searchField | 306 | id: searchField | ||
305 | 307 | | |||
306 | anchors.bottom: mainRow.bottom | 308 | anchors.bottom: mainRow.bottom | ||
307 | anchors.left: parent.left | 309 | anchors.left: parent.left | ||
308 | anchors.leftMargin: sideBar.width + mainRow.spacing + units.smallSpacing | 310 | anchors.leftMargin: sideBar.width + (sideBar.width ? mainRow.spacing : 0) + units.smallSpacing | ||
309 | 311 | | |||
310 | width: (units.gridUnit * 14) - (2 * units.smallSpacing) | 312 | width: (units.gridUnit * 14) - (2 * units.smallSpacing) | ||
311 | 313 | | |||
312 | focus: true | 314 | focus: true | ||
313 | 315 | | |||
314 | placeholderText: i18n("Search...") | 316 | placeholderText: i18n("Search...") | ||
315 | clearButtonShown: true | 317 | clearButtonShown: true | ||
316 | 318 | | |||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |
if this is the same as minimumWidth can you just bind to that, it's a bit faster and more readable