update locations when dock changes location

--updates the available locations in the configuration
window when any dock updates its location
pull/1/head
Michail Vourlakos 8 years ago
parent 2c0e536cf9
commit fd40ef7f4d

@ -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 {
@ -317,9 +317,9 @@ PlasmaComponents.Page {
Layout.leftMargin: units.smallSpacing * 2 Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2 Layout.rightMargin: units.smallSpacing * 2
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
spacing: units.smallSpacing spacing: units.smallSpacing
PlasmaComponents.Label { PlasmaComponents.Label {
Layout.fillWidth: false Layout.fillWidth: false
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
@ -328,7 +328,7 @@ PlasmaComponents.Page {
LatteTextField { LatteTextField {
Layout.preferredWidth: width Layout.preferredWidth: width
enabled: dock.visibility.mode !== Latte.Dock.AlwaysVisible enabled: dock.visibility.mode !== Latte.Dock.AlwaysVisible
text: dock.visibility.timerShow text: dock.visibility.timerShow
onValueChanged: { onValueChanged: {
@ -345,7 +345,7 @@ PlasmaComponents.Page {
LatteTextField{ LatteTextField{
Layout.preferredWidth: width Layout.preferredWidth: width
enabled: dock.visibility.mode !== Latte.Dock.AlwaysVisible enabled: dock.visibility.mode !== Latte.Dock.AlwaysVisible
text: dock.visibility.timerHide text: dock.visibility.timerHide
onValueChanged: { onValueChanged: {

Loading…
Cancel
Save