[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kstyles/keramik
From:       Maks Orlovich <maksim () kde ! org>
Date:       2004-04-04 22:34:57
Message-ID: 20040404223457.9EC4090BD () office ! kde ! org
[Download RAW message or body]

CVS commit by orlovich: 

Clarify the tab code quite a bit with a long comment with lots of ASCII art. Remove \
undeeded and confusing  extra row mode inits. Fix a line-doubling bug in RTL mode \
while I am at it.


  M +5 -3      keramik.cpp   1.124
  M +37 -7     pixmaploader.cpp   1.42


--- kdelibs/kstyles/keramik/keramik.cpp  #1.123:1.124
@@ -1459,7 +1459,9 @@ void KeramikStyle::drawControl( ControlE
                         {
                                 QRect tabRect = r;
-                                //If not the last tab, readjust the painting to be \
one pixel wider +                                //If not the right-most tab, \
readjust the painting to be one pixel wider  //to avoid a doubled line
-                                if (tabBar->indexOf( opt.tab()->identifier() ) != \
(tabBar->count() - 1)) +                                int rightMost = \
QApplication::reverseLayout() ? 0 : tabBar->count() - 1; +
+                                if (tabBar->indexOf( opt.tab()->identifier() ) != \
                rightMost)
                                         tabRect.setWidth( tabRect.width() + 1);
                                 Keramik::ActiveTabPainter( bottom ).draw( p, \
tabRect, cg.button().light(110), cg.background(), !tabBar->isEnabled(), pmode());

--- kdelibs/kstyles/keramik/pixmaploader.cpp  #1.41:1.42
@@ -528,22 +528,52 @@ InactiveTabPainter::InactiveTabPainter( 
         if (m_bottom)
         {
-                rowMde[0] = rowMde[2] = rowMde[3] = Scaled;
+                rowMde[0] = Scaled;
                 rowMde[1] = Fixed;
         }
         else
         {
-                rowMde[0] = rowMde[2] = rowMde[3] = Fixed;
+                rowMde[0] = Fixed;
                 rowMde[1] = Scaled;
         }
 
+        /**
+         Most fully, inactive tabs look like this:
+         L  C  R
+         / --- \
+         | === |
 
-        Mode check = QApplication::reverseLayout() ? First : Last;
-        m_columns = (m_mode == check ? 3 : 2);
+         Where L,C, and R denote the tile positions. Of course, we don't want to \
draw all of the rounding for all the tabs. +
+         We want the left-most tab to look like this:
+
+         L C
+         / --
+         | ==
+
+         "Middle" tabs look like this:
+
+         L C
+         | --
+         | ==
+
+         And the right most tab looks like this:
+
+         L C  R
+         | -- \
+         | == |
+
+        So we have to vary the number of columns, and for everything but left-most \
tab, the L tab gets the special separator +        tile.
+    */
+
+        Mode rightMost = QApplication::reverseLayout() ? First : Last;
+        m_columns = (m_mode == rightMost ? 3 : 2);
 }
 
 int InactiveTabPainter::tileName( unsigned int column, unsigned int row ) const
 {
-        Mode check = QApplication::reverseLayout() ? Last : First;
-        if ( column == 0 && m_mode != check ) return KeramikTileSeparator;
+        Mode leftMost = QApplication::reverseLayout() ? Last : First;
+        if ( column == 0 && m_mode != leftMost )
+                return KeramikTileSeparator;
         if ( m_bottom )
                 return RectTilePainter::tileName( column, row + 1 );


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic