resync geometry for avoids that config ui covers the dock #38

pull/1/head
Johan Smith Agudelo Rodriguez 8 years ago
parent 0f5699a5e1
commit 34772cdc21

@ -58,6 +58,10 @@ DockConfigView::DockConfigView(Plasma::Containment *containment, DockView *dockV
syncSlideEffect(); syncSlideEffect();
}); });
connect(dockView, &QQuickView::widthChanged, this, &DockConfigView::syncGeometry);
connect(dockView, &QQuickView::heightChanged, this, &DockConfigView::syncGeometry);
connect(dockView->visibility(), &VisibilityManager::modeChanged, this, &DockConfigView::syncGeometry);
connect(containment, &Plasma::Containment::immutabilityChanged, this, &DockConfigView::immutabilityChanged); connect(containment, &Plasma::Containment::immutabilityChanged, this, &DockConfigView::immutabilityChanged);
} }
@ -100,10 +104,10 @@ void DockConfigView::syncGeometry()
resize(size); resize(size);
if (location == Plasma::Types::TopEdge) { if (location == Plasma::Types::TopEdge) {
setPosition(sGeometry.center().x() - size.width() / 2 - 1 setPosition(sGeometry.center().x() - size.width() / 2
, m_dockView->currentThickness()); , m_dockView->currentThickness() + 1);
} else if (location == Plasma::Types::BottomEdge) { } else if (location == Plasma::Types::BottomEdge) {
setPosition(sGeometry.center().x() - size.width() / 2 - 1 setPosition(sGeometry.center().x() - size.width() / 2
, sGeometry.height() - m_dockView->currentThickness() - size.height() - 1); , sGeometry.height() - m_dockView->currentThickness() - size.height() - 1);
} }
} }
@ -117,10 +121,10 @@ void DockConfigView::syncGeometry()
if (location == Plasma::Types::LeftEdge) { if (location == Plasma::Types::LeftEdge) {
setPosition(m_dockView->currentThickness() setPosition(m_dockView->currentThickness()
, sGeometry.center().y() - size.height() / 2); , sGeometry.center().y() - size.height() / 2 + 1);
} else if (location == Plasma::Types::RightEdge) { } else if (location == Plasma::Types::RightEdge) {
setPosition(sGeometry.width() - m_dockView->currentThickness() - size.width() - 1 setPosition(sGeometry.width() - m_dockView->currentThickness() - size.width() - 1
, sGeometry.center().y() - size.height() / 2 - 1); , sGeometry.center().y() - size.height() / 2);
} }
} }
break; break;
@ -181,6 +185,8 @@ void DockConfigView::showEvent(QShowEvent *ev)
m_screenSyncTimer.start(); m_screenSyncTimer.start();
m_deleterTimer.stop(); m_deleterTimer.stop();
QTimer::singleShot(400, this, &DockConfigView::syncGeometry);
ConfigView::showEvent(ev); ConfigView::showEvent(ev);
} }

Loading…
Cancel
Save