From 6a6339a7f022fffd5d7962e44fe1802274dcd7c9 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 4 Nov 2008 15:31:36 +0000 Subject: [PATCH] widgetsets: if Widgetset ThemeServices cannot draw some element then use default ThemeServices painting git-svn-id: trunk@17220 - --- lcl/interfaces/carbon/carbonthemes.pas | 2 ++ lcl/interfaces/gtk/gtkthemes.pas | 5 +++-- lcl/interfaces/qt/qtthemes.pas | 29 +++++++++++++++++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/lcl/interfaces/carbon/carbonthemes.pas b/lcl/interfaces/carbon/carbonthemes.pas index ee40b62ba6..198b4d8b58 100644 --- a/lcl/interfaces/carbon/carbonthemes.pas +++ b/lcl/interfaces/carbon/carbonthemes.pas @@ -355,6 +355,8 @@ begin teHeader: DrawHeaderElement(Context, Details, R, ClipRect); teRebar: DrawRebarElement(Context, Details, R, ClipRect); teToolBar: DrawToolBarElement(Context, Details, R, ClipRect); + else + inherited DrawElement(DC, Details, R, ClipRect); end; end; end; diff --git a/lcl/interfaces/gtk/gtkthemes.pas b/lcl/interfaces/gtk/gtkthemes.pas index bb79728f41..875e8f3290 100644 --- a/lcl/interfaces/gtk/gtkthemes.pas +++ b/lcl/interfaces/gtk/gtkthemes.pas @@ -452,8 +452,9 @@ begin with StyleParams do begin case Painter of - gptBox, - gptDefault: gtk_paint_box( + gptDefault: inherited DrawElement(DC, Details, R, ClipRect); + gptBox: + gtk_paint_box( Style, Window, State, Shadow, @Area, Widget, PChar(Detail), diff --git a/lcl/interfaces/qt/qtthemes.pas b/lcl/interfaces/qt/qtthemes.pas index 45593a46a6..312d5b52e8 100644 --- a/lcl/interfaces/qt/qtthemes.pas +++ b/lcl/interfaces/qt/qtthemes.pas @@ -121,6 +121,8 @@ begin ARect := R; Element := GetDrawElement(Details); case Element.DrawVariant of + qdvNone: + inherited DrawElement(DC, Details, R, ClipRect); qdvControl: begin if (Element.ControlElement in [QStyleCE_PushButton, QStyleCE_RadioButton, QStyleCE_CheckBox]) then @@ -167,6 +169,12 @@ begin Context.translate(ARect.Left, ARect.Top); OffsetRect(ARect, -ARect.Left, -ARect.Top); end; + QStyleCC_Slider, QStyleCC_ScrollBar: + begin + opt := QStyleOptionSlider_create(); + QStyleOptionSlider_setMinimum(QStyleOptionSliderH(opt), 0); + QStyleOptionSlider_setMaximum(QStyleOptionSliderH(opt), 100); + end; else opt := QStyleOptionComplex_create(LongInt(QStyleOptionVersion), LongInt(QStyleOptionSO_Default)); end; @@ -279,7 +287,8 @@ begin // define orientations if ((Details.Element = teRebar) and (Details.Part = RP_GRIPPER)) or - ((Details.Element = teToolBar) and (Details.Part = TP_SEPARATOR)) then + ((Details.Element = teToolBar) and (Details.Part = TP_SEPARATOR)) or + ((Details.Element = teScrollBar) and (Details.Part in [SBP_UPPERTRACKHORZ, SBP_LOWERTRACKHORZ, SBP_THUMBBTNHORZ, SBP_GRIPPERHORZ])) then Result := Result or QStyleState_Horizontal; end; @@ -422,6 +431,24 @@ begin Result.PrimitiveElement := QStylePE_FrameTabWidget; end; end; + teScrollBar: + begin + Result.DrawVariant := qdvComplexControl; + Result.ComplexControl := QStyleCC_ScrollBar; + case Details.Part of + SBP_ARROWBTN: Result.SubControls := QStyleSC_ScrollBarAddLine; + SBP_THUMBBTNHORZ, + SBP_THUMBBTNVERT, + SBP_GRIPPERHORZ, + SBP_GRIPPERVERT: Result.SubControls := QStyleSC_ScrollBarSlider; + SBP_LOWERTRACKHORZ, + SBP_LOWERTRACKVERT: Result.SubControls := QStyleSC_ScrollBarAddPage; + SBP_UPPERTRACKHORZ, + SBP_UPPERTRACKVERT: Result.SubControls := QStyleSC_ScrollBarSubPage; + else + Result.SubControls := QStyleSC_None; + end; + end; end; end;