update config window availScreenGeometry properly

pull/5/head
Michail Vourlakos 6 years ago
parent c21d355f9a
commit 11226428c6

@ -69,6 +69,7 @@ PrimaryConfigView::PrimaryConfigView(Plasma::Containment *containment, Latte::Vi
m_screenSyncTimer.setSingleShot(true);
m_screenSyncTimer.setInterval(100);
connect(this, &PrimaryConfigView::availableScreenGeometryChanged, this, &PrimaryConfigView::syncGeometry);
connect(this, &PrimaryConfigView::complexityChanged, this, &PrimaryConfigView::saveConfig);
connect(this, &PrimaryConfigView::complexityChanged, this, &PrimaryConfigView::updateShowInlineProperties);
connect(this, &PrimaryConfigView::complexityChanged, this, &PrimaryConfigView::syncGeometry);
@ -92,6 +93,10 @@ PrimaryConfigView::PrimaryConfigView(Plasma::Containment *containment, Latte::Vi
m_thicknessSyncTimer.start();
});
connections << connect(m_corona, &Latte::Corona::availableScreenRectChanged, this, [this]() {
updateAvailableScreenGeometry();
});
if (m_corona) {
connections << connect(m_corona, &Latte::Corona::raiseViewsTemporaryChanged, this, &PrimaryConfigView::raiseDocksTemporaryChanged);
}
@ -146,9 +151,7 @@ void PrimaryConfigView::init()
QByteArray tempFilePath = "lattedockconfigurationui";
updateEnabledBorders();
int currentScrId = m_latteView->positioner()->currentScreenId();
m_availableScreenGeometry = m_corona->availableScreenRect(currentScrId);
updateAvailableScreenGeometry();
auto source = QUrl::fromLocalFile(m_latteView->containment()->corona()->kPackage().filePath(tempFilePath));
setSource(source);
@ -185,6 +188,14 @@ void PrimaryConfigView::deleteSecondaryWindow()
}
}
void PrimaryConfigView::updateAvailableScreenGeometry()
{
int currentScrId = m_latteView->positioner()->currentScreenId();
m_availableScreenGeometry = m_corona->availableScreenRect(currentScrId);
emit availableScreenGeometryChanged();
}
QRect PrimaryConfigView::availableScreenGeometry() const
{
return m_availableScreenGeometry;

@ -125,6 +125,7 @@ protected:
private slots:
void immutabilityChanged(Plasma::Types::ImmutabilityType type);
void updateAvailableScreenGeometry();
void updateEnabledBorders();
void updateShowInlineProperties();

Loading…
Cancel
Save