diff options
author | Timothy Pearson <[email protected]> | 2012-10-30 22:42:44 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-10-30 22:42:44 -0500 |
commit | 0836d4649ca26cc4e6e867ca5a4a3eafd995f807 (patch) | |
tree | 4b4a28e15a3be4a17fdf5025a46ff0f104fd91d8 /src/styles/qcompactstyle.cpp | |
parent | 970116b129a0dfd4ac8e90f1788ad7e81e3f6d71 (diff) | |
download | tqt3-0836d4649ca26cc4e6e867ca5a4a3eafd995f807.tar.gz tqt3-0836d4649ca26cc4e6e867ca5a4a3eafd995f807.zip |
Automated update from Qt3
Diffstat (limited to 'src/styles/qcompactstyle.cpp')
-rw-r--r-- | src/styles/qcompactstyle.cpp | 74 |
1 files changed, 55 insertions, 19 deletions
diff --git a/src/styles/qcompactstyle.cpp b/src/styles/qcompactstyle.cpp index 30f219ed0..54b120851 100644 --- a/src/styles/qcompactstyle.cpp +++ b/src/styles/qcompactstyle.cpp @@ -189,13 +189,7 @@ void TQCompactStyle::drawControl( ControlElement element, TQPainter *p, TQStyleC return; if ( mi->isChecked() ) { - if ( act && !dis ) { - qDrawShadePanel( p, x, y, checkcol, h, - g, TRUE, 1, &g.brush( TQColorGroup::Button ) ); - } else { - qDrawShadePanel( p, x, y, checkcol, h, - g, TRUE, 1, &g.brush( TQColorGroup::Midlight ) ); - } + drawPrimitive( PE_MenuItemIndicatorFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), itemg, flags, opt ); } else if ( !act ) { p->fillRect(x, y, checkcol , h, g.brush( TQColorGroup::Button )); @@ -214,7 +208,7 @@ void TQCompactStyle::drawControl( ControlElement element, TQPainter *p, TQStyleC int pixh = pixmap.height(); if ( act && !dis ) { if ( !mi->isChecked() ) - qDrawShadePanel( p, x, y, checkcol, h, g, FALSE, 1, &g.brush( TQColorGroup::Button ) ); + drawPrimitive( PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), itemg, flags, opt ); } TQRect cr( x, y, checkcol, h ); TQRect pmr( 0, 0, pixw, pixh ); @@ -226,18 +220,8 @@ void TQCompactStyle::drawControl( ControlElement element, TQPainter *p, TQStyleC g.brush( TQColorGroup::Button ); p->fillRect( x+checkcol + 1, y, w - checkcol - 1, h, fill); } else if ( checkable ) { // just "checking"... - int mw = checkcol + motifItemFrame; - int mh = h - 2*motifItemFrame; if ( mi->isChecked() ) { - - SFlags cflags = Style_Default; - if (! dis) - cflags |= Style_Enabled; - if (act) - cflags |= Style_On; - - drawPrimitive( PE_CheckMark, p, ceData, elementFlags, TQRect(x + motifItemFrame + 2, y + motifItemFrame, - mw, mh), itemg, cflags, opt ); + drawPrimitive( PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), itemg, flags, opt ); } } @@ -319,4 +303,56 @@ void TQCompactStyle::drawControl( ControlElement element, TQPainter *p, TQStyleC } } +/*! \reimp */ +void TQCompactStyle::drawPrimitive( PrimitiveElement pe, + TQPainter *p, + TQStyleControlElementData ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags, + const TQStyleOption& opt ) const +{ + bool dis = !(flags & Style_Enabled); + bool act = flags & Style_Active; + + int x, y, w, h; + r.rect( &x, &y, &w, &h ); + + switch (pe) { + case PE_MenuItemIndicatorFrame: + { + if ( act && !dis ) { + qDrawShadePanel( p, x, y, w, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Button ) ); + } else { + qDrawShadePanel( p, x, y, w, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) ); + } + } + break; + case PE_MenuItemIndicatorIconFrame: + { + qDrawShadePanel( p, x, y, w, h, cg, FALSE, 1, &cg.brush( TQColorGroup::Button ) ); + } + break; + case PE_MenuItemIndicatorCheck: + { + int mw = w + motifItemFrame; + int mh = h - 2*motifItemFrame; + + SFlags cflags = Style_Default; + if (! dis) { + cflags |= Style_Enabled; + } + if (act) { + cflags |= Style_On; + } + + drawPrimitive( PE_CheckMark, p, ceData, elementFlags, TQRect(x + motifItemFrame + 2, y + motifItemFrame, mw, mh), cg, cflags, opt ); + } + break; + default: + break; + } +} + #endif |