diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-17 15:05:01 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-17 15:05:01 -0500 |
commit | fb2b1442644d0b35d004f3896efc0afa5a5b81a5 (patch) | |
tree | 438e47c523108f72d81fda90df29238da32b05f0 /kstyles/light/lightstyle-v3.cpp | |
parent | 2ed8f9ade70bd38a541d7e62e02962a1311aabb5 (diff) | |
download | tdelibs-fb2b1442644d0b35d004f3896efc0afa5a5b81a5.tar.gz tdelibs-fb2b1442644d0b35d004f3896efc0afa5a5b81a5.zip |
Do not use direct widget access when drawing tabs and popup menus
Diffstat (limited to 'kstyles/light/lightstyle-v3.cpp')
-rw-r--r-- | kstyles/light/lightstyle-v3.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/kstyles/light/lightstyle-v3.cpp b/kstyles/light/lightstyle-v3.cpp index 97c9d2e0b..565b8ac2c 100644 --- a/kstyles/light/lightstyle-v3.cpp +++ b/kstyles/light/lightstyle-v3.cpp @@ -819,10 +819,9 @@ void LightStyleV3::drawControl( TQ_ControlElement control, switch (control) { case CE_TabBarTab: { - const TQTabBar *tb = (const TQTabBar *) widget; TQRect br = r; - if ( tb->shape() == TQTabBar::RoundedAbove ) { + if ( ceData.tabBarData.shape == TQTabBar::RoundedAbove ) { if ( ! ( flags & Style_Selected ) ) { p->setPen( cg.background() ); p->drawLine( br.left(), br.bottom(), @@ -857,7 +856,7 @@ void LightStyleV3::drawControl( TQ_ControlElement control, else br.addCoords( 1, 1, -1, 0 ); p->fillRect( br, cg.background() ); - } else if ( tb->shape() == TQTabBar::RoundedBelow ) { + } else if ( ceData.tabBarData.shape == TQTabBar::RoundedBelow ) { if ( ! ( flags & Style_Selected ) ) { p->setPen( cg.background() ); p->drawLine( br.left(), br.top(), @@ -906,7 +905,6 @@ void LightStyleV3::drawControl( TQ_ControlElement control, if (! widget || data.isDefault()) break; - const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; TQMenuItem *mi = data.menuItem(); int tab = data.tabWidth(); int maxpmw = data.maxIconWidth(); @@ -967,7 +965,7 @@ void LightStyleV3::drawControl( TQ_ControlElement control, if ((flags & Style_Active) && (flags & Style_Enabled)) mode = TQIconSet::Active; TQPixmap pixmap; - if (popupmenu->isCheckable() && mi->isChecked()) + if ((elementFlags & CEF_IsCheckable) && mi->isChecked()) pixmap = mi->iconSet()->pixmap( TQIconSet::Small, mode, TQIconSet::On ); else @@ -977,7 +975,7 @@ void LightStyleV3::drawControl( TQ_ControlElement control, pmr.moveCenter(cr.center()); p->setPen(cg.text()); p->drawPixmap(pmr.topLeft(), pixmap); - } else if (popupmenu->isCheckable() && mi->isChecked()) + } else if ((elementFlags & CEF_IsCheckable) && mi->isChecked()) drawPrimitive(PE_CheckMark, p, ceData, elementFlags, cr, cg, (flags & Style_Enabled) | Style_On); @@ -1765,7 +1763,6 @@ TQSize LightStyleV3::sizeFromContents( ContentsType contents, break; TQMenuItem *mi = data.menuItem(); - const TQPopupMenu *popupmenu = (const TQPopupMenu *) widget; int maxpmw = data.maxIconWidth(); int w = contentsSize.width(), h = contentsSize.height(); @@ -1785,7 +1782,7 @@ TQSize LightStyleV3::sizeFromContents( ContentsType contents, if (mi->pixmap()) h = QMAX(h, mi->pixmap()->height()); else if (! mi->text().isNull()) - h = QMAX(h, popupmenu->fontMetrics().height() + 2); + h = QMAX(h, TQFontMetrics(ceData.font).height() + 2); if (mi->iconSet() != 0) h = QMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height()); |