diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-31 14:12:48 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-31 14:12:48 -0500 |
commit | 884e5fa2022260e446ed13b9ed082023311442d2 (patch) | |
tree | 7893b2f5ae5b6181537877066d679d7cb2d18d9c /kstyles/asteroid/asteroid.cpp | |
parent | d26d6ac23685063d532f0195499e617b2442350b (diff) | |
download | tdelibs-884e5fa2022260e446ed13b9ed082023311442d2.tar.gz tdelibs-884e5fa2022260e446ed13b9ed082023311442d2.zip |
Update to new style API
Diffstat (limited to 'kstyles/asteroid/asteroid.cpp')
-rw-r--r-- | kstyles/asteroid/asteroid.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/kstyles/asteroid/asteroid.cpp b/kstyles/asteroid/asteroid.cpp index 432756032..05a669e18 100644 --- a/kstyles/asteroid/asteroid.cpp +++ b/kstyles/asteroid/asteroid.cpp @@ -316,6 +316,10 @@ int AsteroidStyle::styleHint( TQ_StyleHint stylehint, // case SH_ComboBox_ListMouseTracking: // case SH_ScrollBar_StopMouseOverSlider: return 1; + + case SH_MenuIndicatorColumnWidth: { + return TQMAX(option.maxIconWidth(), 12); + } default: return KStyle::styleHint(stylehint, ceData, elementFlags, option, returnData, widget); @@ -937,9 +941,16 @@ void AsteroidStyle::drawPrimitive(TQ_PrimitiveElement pe, break; } + case PE_MenuItemIndicatorIconFrame: + case PE_MenuItemIndicatorFrame: { + // Draw nothing + break; + } + case PE_MenuItemIndicatorCheck: { int x, y, w, h; r.rect( &x, &y, &w, &h ); + int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, o, NULL, NULL); bool active = sf & Style_Active; bool disabled = !(sf & Style_Enabled); @@ -955,7 +966,7 @@ void AsteroidStyle::drawPrimitive(TQ_PrimitiveElement pe, p->setPen(active ? cg.highlightedText() : cg.buttonText()); - TQRect rr = TQRect(xp, y, w, h); + TQRect rr = TQRect(xp, y, checkcol, h); if (backwards) { rr = visualRect(rr, r); } @@ -1600,7 +1611,7 @@ void AsteroidStyle::drawControl(TQ_ControlElement ce, p->drawPixmap(pmr.topLeft(), pixmap); } else if (checkable) { if (mi->isChecked()) { - drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, sh), cg, sf); + drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, r, cg, sf, o); } } @@ -2327,6 +2338,12 @@ int AsteroidStyle::pixelMetric(PixelMetric pm, TQStyleControlElementData ceData, case PM_SplitterWidth: return TQMAX( 4, TQApplication::globalStrut().width() ); + case PM_MenuIndicatorFrameHBorder: + case PM_MenuIndicatorFrameVBorder: + case PM_MenuIconIndicatorFrameHBorder: + case PM_MenuIconIndicatorFrameVBorder: + return 0; + default: { return KStyle::pixelMetric(pm, ceData, elementFlags, w); } |