diff --git a/app/dockview.cpp b/app/dockview.cpp index 2e105cb07..3c2eb9243 100644 --- a/app/dockview.cpp +++ b/app/dockview.cpp @@ -492,7 +492,12 @@ void DockView::resizeWindow(QRect availableScreenRect) } } -void DockView::setLocalDockGeometry(const QRect &geometry) +QRect DockView::localGeometry() const +{ + return m_localGeometry; +} + +void DockView::setLocalGeometry(const QRect &geometry) { if (m_localGeometry == geometry) { return; @@ -500,6 +505,8 @@ void DockView::setLocalDockGeometry(const QRect &geometry) m_localGeometry = geometry; + emit localGeometryChanged(); + updateAbsDockGeometry(); } diff --git a/app/dockview.h b/app/dockview.h index 7f665d8ec..a8c76ed44 100644 --- a/app/dockview.h +++ b/app/dockview.h @@ -68,6 +68,7 @@ class DockView : public PlasmaQuick::ContainmentView { Q_PROPERTY(VisibilityManager *visibility READ visibility NOTIFY visibilityChanged) Q_PROPERTY(QQmlListProperty screens READ screens) + Q_PROPERTY(QRect localGeometry READ localGeometry WRITE setLocalGeometry NOTIFY localGeometryChanged) Q_PROPERTY(QRect screenGeometry READ screenGeometry NOTIFY screenGeometryChanged) public: @@ -117,6 +118,9 @@ public: QString currentScreen() const; + QRect localGeometry() const; + void setLocalGeometry(const QRect &geometry); + VisibilityManager *visibility() const; QQmlListProperty screens(); @@ -131,7 +135,6 @@ public slots: Q_INVOKABLE QList freeEdges() const; Q_INVOKABLE QVariantList containmentActions(); Q_INVOKABLE int docksWithTasks(); - Q_INVOKABLE void setLocalDockGeometry(const QRect &geometry); Q_INVOKABLE bool setCurrentScreen(const QString id); Q_INVOKABLE bool tasksPresent(); Q_INVOKABLE void updateEnabledBorders(); @@ -161,6 +164,7 @@ signals: void enabledBordersChanged(); void widthChanged(); void heightChanged(); + void localGeometryChanged(); void maxLengthChanged(); void maxThicknessChanged(); void normalThicknessChanged(); diff --git a/containment/contents/ui/DebugWindow.qml b/containment/contents/ui/DebugWindow.qml index 283f3e47c..e7007fb74 100644 --- a/containment/contents/ui/DebugWindow.qml +++ b/containment/contents/ui/DebugWindow.qml @@ -126,8 +126,8 @@ Window{ } Text{ - text: visibilityManager.localGeometry.x + ", " + visibilityManager.localGeometry.y + " " + - visibilityManager.localGeometry.width + "x" + visibilityManager.localGeometry.height + text: dock.localGeometry.x + ", " + dock.localGeometry.y + " " + + dock.localGeometry.width + "x" + dock.localGeometry.height } Text{ diff --git a/containment/contents/ui/VisibilityManager.qml b/containment/contents/ui/VisibilityManager.qml index 226705d01..43246ed19 100644 --- a/containment/contents/ui/VisibilityManager.qml +++ b/containment/contents/ui/VisibilityManager.qml @@ -337,7 +337,7 @@ Item{ } //console.log("update geometry ::: "+tempGeometry); - dock.setLocalDockGeometry(tempGeometry); + dock.localGeometry = tempGeometry; } }