[Kst] extragear/graphics/kst/src/libkstapp

Andrew Walker arwalker at sumusltd.com
Fri May 5 02:26:19 CEST 2006


SVN commit 537517 by arwalker:

BUG:125328 Set the cursor correctly even when switching focus objects

 M  +11 -20    ksttoplevelview.cpp  


--- trunk/extragear/graphics/kst/src/libkstapp/ksttoplevelview.cpp #537516:537517
@@ -210,33 +210,24 @@
     }
   }
   if (p) {
-    setCursorFor(pos, p);
     if (p->focused()) {
+      setCursorFor(pos, p);
       _focusOn = true; // just in case - seems to be false on occasion
       return;
     }
+    p->setFocus(true);
     if (_focusOn) { // something else has the focus, clear it
-      p->setFocus(true);
       clearFocus();
-      KstPainter painter;
-      painter.begin(_w);
-      painter.setRasterOp(Qt::NotROP);
-      painter.setPen(QPen(Qt::black, 0, Qt::SolidLine));
-      painter.setBrush(Qt::NoBrush);
-      p->drawFocusRect(painter);
-      painter.end();
-      _focusOn = true;
-    } else {
-      p->setFocus(true);
-      KstPainter painter;
-      painter.begin(_w);
-      painter.setRasterOp(Qt::NotROP);
-      painter.setPen(QPen(Qt::black, 0, Qt::SolidLine));
-      painter.setBrush(Qt::NoBrush);
-      p->drawFocusRect(painter);
-      painter.end();
-      _focusOn = true;
     }
+    setCursorFor(pos, p);
+    KstPainter painter;
+    painter.begin(_w);
+    painter.setRasterOp(Qt::NotROP);
+    painter.setPen(QPen(Qt::black, 0, Qt::SolidLine));
+    painter.setBrush(Qt::NoBrush);
+    p->drawFocusRect(painter);
+    painter.end();
+    _focusOn = true;
     _hoverFocus = p;
   } else {
     clearFocus();


More information about the Kst mailing list