diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-31 12:39:49 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-31 12:39:49 -0500 |
commit | 2fce73142f9e5c46c909934b03bca5a30512a3d0 (patch) | |
tree | 3b467ac5f1f85ff95e36c8f9de08f1954b1017d6 /src/styles/qmotifplusstyle.cpp | |
parent | 0836d4649ca26cc4e6e867ca5a4a3eafd995f807 (diff) | |
download | tqt3-2fce73142f9e5c46c909934b03bca5a30512a3d0.tar.gz tqt3-2fce73142f9e5c46c909934b03bca5a30512a3d0.zip |
Automated update from Qt3
Diffstat (limited to 'src/styles/qmotifplusstyle.cpp')
-rw-r--r-- | src/styles/qmotifplusstyle.cpp | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/src/styles/qmotifplusstyle.cpp b/src/styles/qmotifplusstyle.cpp index d0b7fe980..6b56a3462 100644 --- a/src/styles/qmotifplusstyle.cpp +++ b/src/styles/qmotifplusstyle.cpp @@ -263,6 +263,13 @@ int TQMotifPlusStyle::pixelMetric(PixelMetric metric, TQStyleControlElementData ret = 11; break; + case PM_MenuIndicatorFrameHBorder: + case PM_MenuIndicatorFrameVBorder: + case PM_MenuIconIndicatorFrameHBorder: + case PM_MenuIconIndicatorFrameVBorder: + ret = 2; + break; + default: ret = TQMotifStyle::pixelMetric(metric, ceData, elementFlags, widget); break; @@ -647,11 +654,30 @@ void TQMotifPlusStyle::drawPrimitive( PrimitiveElement pe, break; } + case PE_MenuItemIndicatorFrame: + { + // Draw nothing + break; + } + case PE_MenuItemIndicatorIconFrame: + { + int x, y, w, h; + r.rect(&x, &y, &w, &h); + int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL); + + TQRect vrect = visualRect( TQRect( x+2, y+2, checkcol, h-2 ), r ); + + qDrawShadePanel( p, vrect.x(), y+2, checkcol, h-2*2, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) ); + break; + } + case PE_MenuItemIndicatorCheck: { int x, y, w, h; r.rect(&x, &y, &w, &h); - TQRect vrect = visualRect( TQRect( x+2, y+2, w, h-2 ), r ); + int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL); + + TQRect vrect = visualRect( TQRect( x+2, y+2, checkcol, h-2 ), r ); SFlags cflags = Style_Default; if (! dis) @@ -820,8 +846,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element, TQRect vrect = visualRect( TQRect( x+2, y+2, checkcol, h-2 ), r ); if ( mi->isChecked() ) { if ( mi->iconSet() ) { - qDrawShadePanel( p, vrect.x(), y+2, checkcol, h-2*2, - cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) ); + drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, r, cg, flags, opt); } } else if ( !act ) { p->fillRect(vrect, @@ -853,7 +878,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element, } else if (checkable) { if (mi->isChecked()) { - drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags); + drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, r, cg, flags, opt); } } @@ -1582,6 +1607,17 @@ int TQMotifPlusStyle::styleHint(StyleHint hint, case SH_PopupMenu_MouseTracking: ret = 1; break; + case SH_MenuIndicatorColumnWidth: + { + int maxpmw = opt.maxIconWidth(); + bool checkable = (elementFlags & CEF_IsCheckable); + + if (checkable) + maxpmw = TQMAX(maxpmw, 15); + + ret = maxpmw; + break; + } default: ret = TQMotifStyle::styleHint(hint, ceData, elementFlags, opt, returnData, widget); break; |