|
|
@ -336,7 +336,7 @@ void Positioner::screenChanged(QScreen *scr)
|
|
|
|
|
|
|
|
|
|
|
|
void Positioner::syncGeometry()
|
|
|
|
void Positioner::syncGeometry()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!(m_view->screen() && m_view->containment()) || m_inDelete) {
|
|
|
|
if (!(m_view->screen() && m_view->containment()) || m_inDelete || m_slideOffset!=0) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -418,7 +418,7 @@ void Positioner::syncGeometry()
|
|
|
|
|
|
|
|
|
|
|
|
void Positioner::validateDockGeometry()
|
|
|
|
void Positioner::validateDockGeometry()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (m_view->geometry() != m_validGeometry) {
|
|
|
|
if (m_slideOffset==0 && m_view->geometry() != m_validGeometry) {
|
|
|
|
m_validateGeometryTimer.start();
|
|
|
|
m_validateGeometryTimer.start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -536,6 +536,49 @@ void Positioner::updatePosition(QRect availableScreenRect)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Positioner::slideOffset() const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return m_slideOffset;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Positioner::setSlideOffset(int offset)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (m_slideOffset == offset) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_slideOffset = offset;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QPoint slidedTopLeft;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_view->location() == Plasma::Types::TopEdge) {
|
|
|
|
|
|
|
|
int boundedY = qMax(m_view->screenGeometry().top() - (m_validGeometry.height() - 1), m_validGeometry.y() - qAbs(m_slideOffset));
|
|
|
|
|
|
|
|
slidedTopLeft = {m_validGeometry.x(), boundedY};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (m_view->location() == Plasma::Types::BottomEdge) {
|
|
|
|
|
|
|
|
int boundedY = qMin(m_view->screenGeometry().bottom() - 1, m_validGeometry.y() + qAbs(m_slideOffset));
|
|
|
|
|
|
|
|
slidedTopLeft = {m_validGeometry.x(), boundedY};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (m_view->location() == Plasma::Types::RightEdge) {
|
|
|
|
|
|
|
|
int boundedX = qMax(m_view->screenGeometry().right() - 1, m_validGeometry.x() + qAbs(m_slideOffset));
|
|
|
|
|
|
|
|
slidedTopLeft = {boundedX, m_validGeometry.y()};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (m_view->location() == Plasma::Types::LeftEdge) {
|
|
|
|
|
|
|
|
int boundedX = qMax(m_view->screenGeometry().left() - (m_validGeometry.width() - 1), m_validGeometry.x() - qAbs(m_slideOffset));
|
|
|
|
|
|
|
|
slidedTopLeft = {boundedX, m_validGeometry.y()};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_view->setPosition(slidedTopLeft);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (m_view->surface()) {
|
|
|
|
|
|
|
|
m_view->surface()->setPosition(slidedTopLeft);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
emit slideOffsetChanged();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Positioner::resizeWindow(QRect availableScreenRect)
|
|
|
|
void Positioner::resizeWindow(QRect availableScreenRect)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QSize screenSize = m_view->screen()->size();
|
|
|
|
QSize screenSize = m_view->screen()->size();
|
|
|
|