[Kst] extragear/graphics/kst/kst

George Staikos staikos at kde.org
Fri Nov 25 05:06:40 CET 2005


SVN commit 483096 by staikos:

- US english for names
- reuse a painter to avoid constructing a new one
- move a clear up a bit


 M  +7 -13     ksttoplevelview.cpp  
 M  +1 -1      kstviewellipse.cpp  
 M  +1 -1      kstviewobject.h  


--- trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp #483095:483096
@@ -201,19 +201,16 @@
     p.fillRect(geometry(), QBrush(_backgroundColor));
     p.setClipping(false);
   }
-  p.end();
 
   // now, check what has the focus and repaint the focus rect, as all focus rects are now lost
   if (_hoverFocus) {
-    QPainter p;
-    p.begin(_w);
-    p.setViewXForm(true);
+    p.setClipping(false);
     p.setRasterOp(Qt::NotROP);
     p.setPen(QPen(Qt::black, 0, Qt::SolidLine));
     p.setBrush(Qt::NoBrush);
     _hoverFocus->drawFocusRect(p);
-    p.end();
   }
+  p.end();
 }
 
 
@@ -262,6 +259,7 @@
     }
     if (_focusOn) { // something else has the focus, clear it
       p->setFocus(true);
+      clearFocus();
       QPainter painter;
       painter.begin(_w);
       painter.setRasterOp(Qt::NotROP);
@@ -269,7 +267,6 @@
       painter.setBrush(Qt::NoBrush);
       p->drawFocusRect(painter);
       painter.end();
-      clearFocus();
       _focusOn = true;
     } else {
       p->setFocus(true);
@@ -330,11 +327,9 @@
 
 
 void KstTopLevelView::setCursorFor(const QPoint& pos, KstViewObjectPtr p) {
-  char direction = p->directionFor(pos);
-
   // cursor directions are the same for centred resize
-  direction = direction & ~CENTREDRESIZE;
-  
+  signed direction = p->directionFor(pos) & ~CENTEREDRESIZE;
+
   if (direction & ENDPOINT) {
     _cursor.setShape(Qt::CrossCursor);  
   } else {
@@ -685,7 +680,7 @@
     } else if (_pressDirection & ENDPOINT) {
       // moving an endpoint of an object
       pressMoveLayoutModeEndPoint(pos, shift);
-    } else if (_pressDirection & CENTREDRESIZE) {
+    } else if (_pressDirection & CENTEREDRESIZE) {
       // resizing an object with fixed centre
       pressMoveLayoutModeCentredResize(pos, shift);
     } else {
@@ -913,7 +908,6 @@
 
 
 void KstTopLevelView::releasePressLayoutMode(const QPoint& pos, bool shift) {
-
   if (_pressTarget) {
     KstApp::inst()->document()->setModified();
     if (_pressDirection == 0) {
@@ -922,7 +916,7 @@
     } else if (_pressDirection & ENDPOINT) {
       // moving an endpoint of an object
       releasePressLayoutModeEndPoint(pos, shift);
-    } else if (_pressDirection & CENTREDRESIZE) {
+    } else if (_pressDirection & CENTEREDRESIZE) {
       // resizing an object whose centre is fixed
       releasePressLayoutModeCentredResize(pos, shift);
     } else {
--- trunk/extragear/graphics/kst/kst/kstviewellipse.cpp #483095:483096
@@ -144,7 +144,7 @@
   signed int direction = KstViewObject::directionFor(pos);
   if (direction != 0) {
     // not moving, so in any resize direction, we want it centred
-    direction |= CENTREDRESIZE;  
+    direction |= CENTEREDRESIZE;  
   }  
   return direction;
 }
--- trunk/extragear/graphics/kst/kst/kstviewobject.h #483095:483096
@@ -212,7 +212,7 @@
                     DOWN = 2, 
                     LEFT = 4, 
                     RIGHT = 8, 
-                    CENTREDRESIZE = 16,
+                    CENTEREDRESIZE = 16,
                     ENDPOINT = 32};
     virtual signed int directionFor(const QPoint& pos);
     


More information about the Kst mailing list