on xenial help sign in
implement our own popup
942c252Michael Zanetti
qml/Stage/Spread/ScreensAndWorkspaces.qml+36−9
@@ -81,19 +81,47 @@ Item {
81 anchors.fill: parent
81 anchors.fill: parent
82
82
83 onClicked: {
83 onClicked: {
84− PopupUtils.open(contextMenu)
84+// PopupUtils.open(contextMenu)
85+ var obj = screensMenuComponent.createObject(header)
86+ obj.open(mouseX, mouseY)
85 }
87 }
86 }
88 }
87
89
88 Component {
90 Component {
89− id: contextMenu
91+ id: screensMenuComponent
90− ActionSelectionPopover {
92+ UbuntuShape {
91− actions: ActionList {
93+ id: screensMenu
92− Action {
94+ width: units.gu(20)
95+ height: contentColumn.childrenRect.height
96+ backgroundColor: "white"
97+
98+ function open(mouseX, mouseY) {
99+ x = Math.max(0, Math.min(mouseX - width / 2, parent.width - width))
100+ y = mouseY + units.gu(1)
101+ }
102+
103+ InverseMouseArea {
104+ anchors.fill: parent
105+ onClicked: {
106+ screensMenu.destroy()
107+ }
108+ }
109+
110+ Column {
111+ id: contentColumn
112+ width: parent.width
113+ ListItem {
114+ height: layout.height
115+ highlightColor: "transparent"
116+ ListItemLayout {
117+ id: layout
93− text: "Add workspace"
118+ title.text: qsTr("Add workspace")
94− onTriggered: {
119+ title.color: "black"
120+ }
121+ onClicked: {
95 screen.addWorkspace();
122 screen.addWorkspace();
96− Screens.sync(root.screensProxy)
123+ Screens.sync(root.screensProxy);
124+ screensMenu.destroy();
97 }
125 }
98 }
126 }
99 }
127 }
@@ -101,7 +129,6 @@ Item {
101 }
129 }
102 }
130 }
103
131
104−
105 Workspaces {
132 Workspaces {
106 id: workspaces
133 id: workspaces
107 height: parent.height - header.height - units.gu(2)
134 height: parent.height - header.height - units.gu(2)