Salome HOME
Improvement(the active viewer tab was not very well visible).
authormzn <mzn@opencascade.com>
Wed, 6 Jul 2005 12:21:02 +0000 (12:21 +0000)
committermzn <mzn@opencascade.com>
Wed, 6 Jul 2005 12:21:02 +0000 (12:21 +0000)
src/Style/SalomeStyle.cxx

index c53feb6e8dab6e91bd8b386226a21ea384d1582c..2635697d24f3674cf8410f9c51ffbbbdb02fcbef 100644 (file)
@@ -404,32 +404,33 @@ void SalomeStyle::drawPrimitive( PrimitiveElement pe, QPainter* p, const QRect&
 
         drawGradient( p, rr, act ? cg.highlight() : cg.dark(), col,
                       horiz ? LeftToRight : UpToDown, linear );
-
-       QRect rt = rr;
-        if ( flags & Style_Horizontal )
-          rt.addCoords( 0, 20, 0, 0 );
-        else
-          rt.addCoords( 0, 0, -20, 0 );
-
-        int textW = flags & Style_Horizontal ? rt.height() : rt.width();
-        int textH = flags & Style_Horizontal ? rt.width() : rt.height();
-
-        QString title = titleText( wnd->caption(), textW, p->fontMetrics() );
-
-       if ( wnd )
-       {
-         p->setPen( act ? cg.highlightedText() : cg.text() );
-         
-         if ( flags & Style_Horizontal )
-         {
-           p->rotate( 270.0 );
-           p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) );
-           p->drawText( 0, 0, title );
-         }
-          else
-           p->drawText( 2, 2, textW, textH, AlignLeft, title );
-       }
-      }
+\r
+                   QRect rt = rr;\r
+        if ( flags & Style_Horizontal )\r
+          rt.addCoords( 0, 20, 0, 0 );\r
+        else\r
+          rt.addCoords( 0, 0, -20, 0 );\r
+\r
+        int textW = flags & Style_Horizontal ? rt.height() : rt.width();\r
+        int textH = flags & Style_Horizontal ? rt.width() : rt.height();\r
+\r
+        QString title = titleText( wnd->caption(), textW, p->fontMetrics() );\r
+\r
+                   if ( wnd )\r
+        {\r
+                     QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive();\r
+                     p->setPen( cgroup.highlightedText() );\r
+\r
+                     if ( flags & Style_Horizontal )\r
+          {\r
+                       p->rotate( 270.0 );\r
+                       p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) );\r
+                       p->drawText( 0, 0, title );\r
+                     }\r
+          else\r
+                       p->drawText( 2, 2, textW, textH, AlignLeft, title );\r
+             }\r
+      }\r
       break;
     }
 
@@ -994,8 +995,10 @@ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidge
         r2.setRect( r2.left(), r2.top(), r2.width() - 2, r2.height() - 1 );
 
       p->setPen( cg.foreground() );
-      QBrush brsh = cg.brush( selected ? QColorGroup::Base : QColorGroup::Background );
-      p->fillRect( r2.left(), r2.top(), r2.width(), r2.height() - 1, brsh );
+      drawGradient( p, QRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 ),\r
+                    selected ? cg.highlight() : cg.dark(), cg.background(), UpToDown, linear );\r
+
+//      p->fillRect( r2.left(), r2.top(), r2.width(), r2.height() - 1, selected ? cg.highlight() : cg.background() );\r
       p->drawRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 );
 
       if ( selected )
@@ -1007,6 +1010,15 @@ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidge
 
            break;
     }
+\r
+    case CE_TabBarLabel:\r
+      {\r
+        QColorGroup tmp( cg );\r
+        if ( flags & Style_Selected )\r
+          tmp.setColor( QColorGroup::Foreground, tmp.highlightedText() );\r
+        PARENT_STYLE::drawControl( element, p, widget, r, tmp, flags, opt );\r
+      }\r
+      break;\r
 
     case CE_PushButton:
          {