widgetsets: if Widgetset ThemeServices cannot draw some element then use default ThemeServices painting

git-svn-id: trunk@17220 -
This commit is contained in:
paul 2008-11-04 15:31:36 +00:00
parent 0165c3dd12
commit 6a6339a7f0
3 changed files with 33 additions and 3 deletions

View File

@ -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;

View File

@ -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),

View File

@ -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;