Commit 1365f044 authored by Thomas Lübking's avatar Thomas Lübking
Browse files

Try to keep the labels in the expanded geometry

and ensure to repaint labels for very tiny windows
Also move to LayerRepaints

BUG: 278137
FIXED-IN: 4.10.1
REVIEW: 108676
parent e2c86921
...@@ -116,7 +116,10 @@ void WindowGeometry::slotWindowFinishUserMovedResized(EffectWindow *w) ...@@ -116,7 +116,10 @@ void WindowGeometry::slotWindowFinishUserMovedResized(EffectWindow *w)
if (iAmActive && w == myResizeWindow) { if (iAmActive && w == myResizeWindow) {
iAmActive = false; iAmActive = false;
myResizeWindow = 0L; myResizeWindow = 0L;
effects->addRepaint(myCurrentGeometry.adjusted(-20, -20, 20, 20)); w->addRepaintFull();
if (myExtraDirtyArea.isValid())
w->addLayerRepaint(myExtraDirtyArea);
myExtraDirtyArea = QRect();
} }
} }
...@@ -139,6 +142,11 @@ static inline QString number(int n) ...@@ -139,6 +142,11 @@ static inline QString number(int n)
void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect &geometry) void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect &geometry)
{ {
if (iAmActivated && iAmActive && w == myResizeWindow) { if (iAmActivated && iAmActive && w == myResizeWindow) {
if (myExtraDirtyArea.isValid())
w->addLayerRepaint(myExtraDirtyArea);
myExtraDirtyArea = QRect();
myCurrentGeometry = geometry; myCurrentGeometry = geometry;
const QRect &r = geometry; const QRect &r = geometry;
const QRect &r2 = myOriginalGeometry; const QRect &r2 = myOriginalGeometry;
...@@ -152,7 +160,7 @@ void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect ...@@ -152,7 +160,7 @@ void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect
myMeasure[0]->setText( i18nc(myCoordString_1, r.x(), r.y(), number(dx), number(dy) ) ); myMeasure[0]->setText( i18nc(myCoordString_1, r.x(), r.y(), number(dx), number(dy) ) );
else else
myMeasure[0]->setText( i18nc(myCoordString_0, r.x(), r.y() ) ); myMeasure[0]->setText( i18nc(myCoordString_0, r.x(), r.y() ) );
myMeasure[0]->setPosition(geometry.topLeft()); myMeasure[0]->setPosition(w->expandedGeometry().topLeft() + QPoint(6,6)); // "6" is magic number because the unstyled effectframe has 5px padding
// center ---------------------- // center ----------------------
if (w->isUserResize()) { if (w->isUserResize()) {
...@@ -181,9 +189,17 @@ void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect ...@@ -181,9 +189,17 @@ void WindowGeometry::slotWindowStepUserMovedResized(EffectWindow *w, const QRect
myMeasure[2]->setText( i18nc(myCoordString_1, r.right(), r.bottom(), number(dx), number(dy) ) ); myMeasure[2]->setText( i18nc(myCoordString_1, r.right(), r.bottom(), number(dx), number(dy) ) );
else else
myMeasure[2]->setText( i18nc(myCoordString_0, r.right(), r.bottom() ) ); myMeasure[2]->setText( i18nc(myCoordString_0, r.right(), r.bottom() ) );
myMeasure[2]->setPosition(geometry.bottomRight()); myMeasure[2]->setPosition(w->expandedGeometry().bottomRight() - QPoint(6,6)); // "6" is magic number because the unstyled effectframe has 5px padding
myExtraDirtyArea |= myMeasure[0]->geometry();
myExtraDirtyArea |= myMeasure[1]->geometry();
myExtraDirtyArea |= myMeasure[2]->geometry();
myExtraDirtyArea.adjust(-6,-6,6,6);
if (w->expandedGeometry().contains(myExtraDirtyArea))
myExtraDirtyArea = QRect();
effects->addRepaint(geometry.adjusted(-20, -20, 20, 20)); if (myExtraDirtyArea.isValid())
w->addLayerRepaint(myExtraDirtyArea);
} }
} }
......
...@@ -58,6 +58,7 @@ private: ...@@ -58,6 +58,7 @@ private:
EffectWindow *myResizeWindow; EffectWindow *myResizeWindow;
EffectFrame *myMeasure[3]; EffectFrame *myMeasure[3];
QRect myOriginalGeometry, myCurrentGeometry; QRect myOriginalGeometry, myCurrentGeometry;
QRect myExtraDirtyArea;
bool iAmActive, iAmActivated, iHandleMoves, iHandleResizes; bool iAmActive, iAmActivated, iHandleMoves, iHandleResizes;
QString myCoordString[2], myResizeString; QString myCoordString[2], myResizeString;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment