update locations when dock changes location

--updates the available locations in the configuration
window when any dock updates its location
v0.6
Michail Vourlakos 8 years ago
parent 0e7d8a18e0
commit 56226b3dc5

@ -282,6 +282,7 @@ void DockCorona::addDock(Plasma::Containment *containment)
dockView->setContainment(containment); dockView->setContainment(containment);
connect(containment, &QObject::destroyed, this, &DockCorona::dockContainmentDestroyed); connect(containment, &QObject::destroyed, this, &DockCorona::dockContainmentDestroyed);
connect(containment, &Plasma::Applet::destroyedChanged, this, &DockCorona::destroyedChanged); connect(containment, &Plasma::Applet::destroyedChanged, this, &DockCorona::destroyedChanged);
connect(containment, &Plasma::Applet::locationChanged, this, &DockCorona::dockLocationChanged);
dockView->show(); dockView->show();
m_dockViews[containment] = dockView; m_dockViews[containment] = dockView;
emit docksCountChanged(); emit docksCountChanged();

@ -65,6 +65,7 @@ public slots:
signals: signals:
void configurationShown(PlasmaQuick::ConfigView *configView); void configurationShown(PlasmaQuick::ConfigView *configView);
void docksCountChanged(); void docksCountChanged();
void dockLocationChanged();
private slots: private slots:
void destroyedChanged(bool destroyed); void destroyedChanged(bool destroyed);

@ -83,8 +83,10 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen)
}, Qt::DirectConnection); }, Qt::DirectConnection);
auto *dockCorona = qobject_cast<DockCorona *>(this->corona()); auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
if (dockCorona) if (dockCorona) {
connect(dockCorona, &DockCorona::docksCountChanged, this, &DockView::docksCountChanged); connect(dockCorona, &DockCorona::docksCountChanged, this, &DockView::docksCountChanged);
connect(dockCorona, &DockCorona::dockLocationChanged, this, &DockView::dockLocationChanged);
}
} }
DockView::~DockView() DockView::~DockView()

@ -117,6 +117,7 @@ signals:
void removeInternalViewSplitter(); void removeInternalViewSplitter();
void eventTriggered(QEvent *ev); void eventTriggered(QEvent *ev);
void dockLocationChanged();
void docksCountChanged(); void docksCountChanged();
void widthChanged(); void widthChanged();
void heightChanged(); void heightChanged();

@ -58,10 +58,10 @@ PlasmaComponents.Page {
Layout.rightMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2
spacing: 1 spacing: 1
property int docksCount: dock.docksCount Connections{
target: dock
onDocksCountChanged: { onDockLocationChanged: locationLayout.lockReservedEdges();
lockReservedEdges() onDocksCountChanged: locationLayout.lockReservedEdges();
} }
ExclusiveGroup { ExclusiveGroup {

Loading…
Cancel
Save