aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksei Korkov <akorkov@luxoft.com>2020-03-13 16:55:49 +0300
committerAleksei Korkov <akorkov@luxoft.com>2020-03-27 15:50:10 +0000
commit45c26d53735cba7ec831309ac88de77d4bb64d18 (patch)
tree97686454cdf100ad61ed21fce061f85043606f85
parent2c3140c6e9c2fddb64731956f4f539678b4d5635 (diff)
[sysui] fix moving widget in Lucee theme
- was added one more handle over the widget to move it Fixes: AUTOSUITE-1506 Change-Id: I7201cda6d53886f9601e0f0f919224d1e3ddb8f3 Reviewed-by: Grigorii Zimin <gzimin@luxoft.com> Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r--sysui/centerconsole/MainContentArea.qml15
-rw-r--r--sysui/centerconsole/WidgetDrawer.qml44
2 files changed, 34 insertions, 25 deletions
diff --git a/sysui/centerconsole/MainContentArea.qml b/sysui/centerconsole/MainContentArea.qml
index 3a221758..b664243c 100644
--- a/sysui/centerconsole/MainContentArea.qml
+++ b/sysui/centerconsole/MainContentArea.qml
@@ -90,7 +90,7 @@ Item {
// widgets will reparent themselves to the active application slot when active
activeApplicationParent: activeApplicationSlot
moveBottomWidgetToDrawer: !widgetDrawer.showingHomePage
- widgetDrawer: widgetDrawerSlot
+ widgetDrawer: widgetDrawer.slot
popupParent: root.popupParent
exposedRectTopMargin: launcher.y + Sizes.dp(Config.launcherHeight)
exposedRectBottomMargin: root.activeAppBottomMargin
@@ -123,16 +123,9 @@ Item {
height: homePage.rowHeight
anchors.bottom: homePage.bottom
- dragEnabled: false
- visible: !showingHomePage && !widgetDrawerSlot.empty
-
- Item {
- id: widgetDrawerSlot
- width: homePage.widgetWidth
- height: homePage.rowHeight
- anchors.horizontalCenter: widgetDrawer.horizontalCenter
- readonly property bool empty: children.length === 0
- }
+ slotWidth: homePage.widgetWidth
+ slotHeight: homePage.rowHeight
+ visible: !showingHomePage && !widgetDrawer.empty
property bool showingHomePage: !root.applicationModel || root.applicationModel.activeAppInfo === null
onShowingHomePageChanged: {
diff --git a/sysui/centerconsole/WidgetDrawer.qml b/sysui/centerconsole/WidgetDrawer.qml
index 4eb549ed..a9334dc9 100644
--- a/sysui/centerconsole/WidgetDrawer.qml
+++ b/sysui/centerconsole/WidgetDrawer.qml
@@ -49,31 +49,47 @@ import shared.Sizes 1.0
SomeItem {}
}
*/
-MouseArea {
+Item {
id: root
- drag.target: root
- drag.axis: Drag.XAxis
- drag.filterChildren: dragEnabled
- drag.minimumX: d.layoutMirroringEnabled ? - d.widthWithoutStick : 0
- drag.maximumX: d.layoutMirroringEnabled ? 0 : d.widthWithoutStick
-
- opacity: 0.5 + 0.5 * (1 - Math.abs(root.x) / d.widthWithoutStick)
-
- // Whether the drag behavior is enabled.
- property bool dragEnabled: true
// how much of it should be sticking out from the right side of the display when
// the widget drawer has been closed
readonly property real stickOutWidth: Sizes.dp(90)
+ property Item slot: widgetDrawerSlot
+ property alias slotWidth: widgetDrawerSlot.width
+ property alias slotHeight: widgetDrawerSlot.height
+ property alias empty: widgetDrawerSlot.empty
+
// true if in full view, false if it's tucked away on the right side of the display
property bool open: true
onOpenChanged: d.applyOpenState()
+ opacity: 0.5 + 0.5 * (1 - Math.abs(root.x) / d.widthWithoutStick)
+
+ Item {
+ id: widgetDrawerSlot
+ anchors.horizontalCenter: root.horizontalCenter
+ readonly property bool empty: children.length === 0
+ }
+
+ MouseArea {
+ id: handl
+ width: root.stickOutWidth
+ height: root.height
+ anchors.left: root.left
+
+ drag.target: root
+ drag.axis: Drag.XAxis
+
+ drag.minimumX: d.layoutMirroringEnabled ? - d.widthWithoutStick : 0
+ drag.maximumX: d.layoutMirroringEnabled ? 0 : d.widthWithoutStick
+ }
+
Connections {
- target: drag
+ target: handl.drag
onActiveChanged: {
- if (root.drag.active) {
+ if (handl.drag.active) {
d.lastX = root.x;
d.direction = 0;
d.dragging = true;
@@ -102,7 +118,7 @@ MouseArea {
property int direction
property bool dragging: false
readonly property real minimumDrag: Sizes.dp(90)
- readonly property real widthWithoutStick: root.width - stickOutWidth
+ readonly property real widthWithoutStick: root.width - root.stickOutWidth
readonly property bool layoutMirroringEnabled: root.LayoutMirroring.enabled
onLayoutMirroringEnabledChanged: {