qt: implement themed drawing of +/- tree signs

git-svn-id: trunk@17231 -
This commit is contained in:
paul 2008-11-05 03:55:15 +00:00
parent 0f81182102
commit c50c24cb56
2 changed files with 16 additions and 1 deletions

View File

@ -290,6 +290,13 @@ begin
((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;
if (Details.Element = teTreeview) and (Details.Part = TVP_GLYPH) then
begin
Result := Result or QStyleState_Children;
if Details.State = GLPS_OPENED then
Result := Result or QStyleState_Open;
end;
end;
function TQtThemeServices.GetDetailSize(Details: TThemedElementDetails): Integer;
@ -449,6 +456,14 @@ begin
Result.SubControls := QStyleSC_None;
end;
end;
teTreeView:
begin
if Details.Part = TVP_GLYPH then
begin
Result.DrawVariant := qdvPrimitive;
Result.PrimitiveElement := QStylePE_IndicatorBranch
end;
end;
end;
end;

View File

@ -1974,7 +1974,7 @@ begin
Tmp := (ARect.Bottom + ARect.Top) shr 1;
MoveToEx(DC, ARect.Left + 2, Tmp, nil);
LineTo(DC, ARect.Right - 2, Tmp);
if Details.State = 1 then
if Details.State = GLPS_CLOSED then
begin
Tmp := (ARect.Left + ARect.Right) shr 1;
MoveToEx(DC, Tmp, ARect.Top + 2, nil);