From 9f3e9f47de754c245b8dc9590f3af80822f5cfde Mon Sep 17 00:00:00 2001 From: stv Date: Tue, 10 Jan 2006 14:25:04 +0000 Subject: [PATCH] no message --- src/Style/SalomeStyle.cxx | 78 +++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Style/SalomeStyle.cxx b/src/Style/SalomeStyle.cxx index bcdc6f1ac..8126eb8ec 100644 --- a/src/Style/SalomeStyle.cxx +++ b/src/Style/SalomeStyle.cxx @@ -422,33 +422,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 ) - { - QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive(); - p->setPen( cgroup.highlightedText() ); - - 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 ); - } - } + + 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 ) + { + QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive(); + p->setPen( cgroup.highlightedText() ); + + 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 ); + } + } break; } @@ -1013,10 +1013,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() ); - drawGradient( p, QRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 ), - selected ? cg.highlight() : cg.dark(), cg.background(), UpToDown, linear ); + drawGradient( p, QRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 ), + selected ? cg.highlight() : cg.dark(), cg.background(), UpToDown, linear ); -// p->fillRect( r2.left(), r2.top(), r2.width(), r2.height() - 1, selected ? cg.highlight() : cg.background() ); +// p->fillRect( r2.left(), r2.top(), r2.width(), r2.height() - 1, selected ? cg.highlight() : cg.background() ); p->drawRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 ); if ( selected ) @@ -1028,15 +1028,15 @@ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidge break; } - - case CE_TabBarLabel: - { - QColorGroup tmp( cg ); - if ( flags & Style_Selected ) - tmp.setColor( QColorGroup::Foreground, tmp.highlightedText() ); - PARENT_STYLE::drawControl( element, p, widget, r, tmp, flags, opt ); - } - break; + + case CE_TabBarLabel: + { + QColorGroup tmp( cg ); + if ( flags & Style_Selected ) + tmp.setColor( QColorGroup::Foreground, tmp.highlightedText() ); + PARENT_STYLE::drawControl( element, p, widget, r, tmp, flags, opt ); + } + break; case CE_PushButton: { -- 2.39.2