diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-30 22:41:50 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-30 22:41:50 -0500 |
commit | 69429dcfc35d449c78b346bdce536f17d926c755 (patch) | |
tree | 6c1d1015837f0e77a8e950e38a3a24ee616e598c /src/styles/qmotifplusstyle.cpp | |
parent | 22d1ab9eccc005b0497cff131593e6b9ff96e7c2 (diff) | |
download | qt3-69429dcfc35d449c78b346bdce536f17d926c755.tar.gz qt3-69429dcfc35d449c78b346bdce536f17d926c755.zip |
Add new style primatives for enhanced third party style compatibility
Diffstat (limited to 'src/styles/qmotifplusstyle.cpp')
-rw-r--r-- | src/styles/qmotifplusstyle.cpp | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/src/styles/qmotifplusstyle.cpp b/src/styles/qmotifplusstyle.cpp index 72e28a8..86db691 100644 --- a/src/styles/qmotifplusstyle.cpp +++ b/src/styles/qmotifplusstyle.cpp @@ -282,6 +282,9 @@ void QMotifPlusStyle::drawPrimitive( PrimitiveElement pe, SFlags flags, const QStyleOption& opt ) const { + bool dis = ! (flags & Style_Enabled); + bool act = flags & Style_Active; + switch (pe) { case PE_HeaderSection: @@ -638,6 +641,28 @@ void QMotifPlusStyle::drawPrimitive( PrimitiveElement pe, break; } + case PE_PanelScrollBar: + { + drawMotifPlusShade(p, r, cg, TRUE, FALSE, &cg.brush(QColorGroup::Mid)); + break; + } + + case PE_MenuItemIndicatorCheck: + { + int x, y, w, h; + r.rect(&x, &y, &w, &h); + QRect vrect = visualRect( QRect( x+2, y+2, w, h-2 ), r ); + + SFlags cflags = Style_Default; + if (! dis) + cflags |= Style_Enabled; + if (act) + cflags |= Style_On; + + drawPrimitive(PE_CheckMark, p, ceData, elementFlags, vrect, cg, cflags); + break; + } + default: QMotifStyle::drawPrimitive(pe, p, ceData, elementFlags, r, cg, flags, opt); break; @@ -828,13 +853,7 @@ void QMotifPlusStyle::drawControl( ControlElement element, } else if (checkable) { if (mi->isChecked()) { - SFlags cflags = Style_Default; - if (! dis) - cflags |= Style_Enabled; - if (act) - cflags |= Style_On; - - drawPrimitive(PE_CheckMark, p, ceData, elementFlags, vrect, cg, cflags); + drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, QRect(x, y, checkcol, h), cg, flags); } } @@ -1147,8 +1166,12 @@ void QMotifPlusStyle::drawComplexControl(ComplexControl control, if (controls == (SC_ScrollBarAddLine | SC_ScrollBarSubLine | SC_ScrollBarAddPage | SC_ScrollBarSubPage | SC_ScrollBarFirst | SC_ScrollBarLast | SC_ScrollBarSlider)) - drawMotifPlusShade(p, widget->rect(), cg, TRUE, FALSE, - &cg.brush(QColorGroup::Mid)); + drawPrimitive(PE_PanelScrollBar, p, ceData, elementFlags, ceData.rect, cg, + ((maxedOut) ? Style_Default : Style_Enabled) | + ((active == SC_ScrollBarLast) ? + Style_Down : Style_Default) | + ((ceData.orientation == Qt::Horizontal) ? + Style_Horizontal : Style_Default)); if ((controls & SC_ScrollBarSubLine) && subline.isValid()) drawPrimitive(PE_ScrollBarSubLine, p, ceData, elementFlags, subline, cg, |