expose dockview local geometry to qml

pull/1/head
Michail Vourlakos 8 years ago
parent 0e5cf91a81
commit 70e3c2bb7a

@ -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();
}

@ -68,6 +68,7 @@ class DockView : public PlasmaQuick::ContainmentView {
Q_PROPERTY(VisibilityManager *visibility READ visibility NOTIFY visibilityChanged)
Q_PROPERTY(QQmlListProperty<QScreen> 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<QScreen> screens();
@ -131,7 +135,6 @@ public slots:
Q_INVOKABLE QList<int> 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();

@ -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{

@ -337,7 +337,7 @@ Item{
}
//console.log("update geometry ::: "+tempGeometry);
dock.setLocalDockGeometry(tempGeometry);
dock.localGeometry = tempGeometry;
}
}

Loading…
Cancel
Save