on xenial help sign in
fixed up some min/max issues
7fd10f2Nick Dedekind
qml/ApplicationMenus/MenuPopup.qml+9−14
@@ -28,18 +28,6 @@ UbuntuShape {
28
28
29 property alias unityMenuModel: repeater.model
29 property alias unityMenuModel: repeater.model
30
30
31− readonly property real __ajustedMinimumHeight: {
32− if (listView.contentHeight > __minimumHeight) {
33− return __minimumHeight;
34− }
35− return Math.max(listView.contentHeight, units.gu(2));
36− }
37−
38− readonly property real __minimumWidth: units.gu(20)
39− readonly property real __maximumWidth: Screen.width * 0.7
40− readonly property real __minimumHeight: units.gu(30)
41− readonly property real __maximumHeight: Screen.height * 0.7
42−
43 function show() {
31 function show() {
44 visible = true;
32 visible = true;
45 focusScope.forceActiveFocus();
33 focusScope.forceActiveFocus();
@@ -75,6 +63,11 @@ UbuntuShape {
75 property Item hoveredItem: null
63 property Item hoveredItem: null
76 readonly property int currentIndex: currentItem ? currentItem.__ownIndex : -1
64 readonly property int currentIndex: currentItem ? currentItem.__ownIndex : -1
77
65
66+ property real __minimumWidth: units.gu(20)
67+ property real __maximumWidth: Screen.width * 0.7
68+ property real __minimumHeight: units.gu(2)
69+ property real __maximumHeight: Screen.height * 0.7
70+
78 signal dismissAll()
71 signal dismissAll()
79
72
80 onCurrentItemChanged: {
73 onCurrentItemChanged: {
@@ -121,7 +114,7 @@ UbuntuShape {
121 id: container
114 id: container
122 objectName: "container"
115 objectName: "container"
123
116
124− height: MathUtils.clamp(listView.contentHeight, __ajustedMinimumHeight, __maximumHeight)
117+ height: MathUtils.clamp(listView.contentHeight, d.__minimumHeight, d.__maximumHeight)
125 width: menuColumn.width
118 width: menuColumn.width
126 spacing: 0
119 spacing: 0
127
120
@@ -221,6 +214,8 @@ UbuntuShape {
221 id: menuColumn
214 id: menuColumn
222 spacing: 0
215 spacing: 0
223
216
217+ width: MathUtils.clamp(implicitWidth, d.__minimumWidth, d.__maximumWidth)
218+
224 Repeater {
219 Repeater {
225 id: repeater
220 id: repeater
226
221
@@ -251,7 +246,7 @@ UbuntuShape {
251 menuData: model
246 menuData: model
252 objectName: loader.objectName + "-actionItem"
247 objectName: loader.objectName + "-actionItem"
253
248
254− width: MathUtils.clamp(implicitWidth, __minimumWidth, __maximumWidth)
249+ width: MathUtils.clamp(implicitWidth, d.__minimumWidth, d.__maximumWidth)
255
250
256 action.onTriggered: {
251 action.onTriggered: {
257 d.currentItem = loader;
252 d.currentItem = loader;