ObjectInspector: locate the arrow on left side vertically better. Issue #26258, patch from Howardpc.

git-svn-id: trunk@46239 -
This commit is contained in:
juha 2014-09-15 15:39:49 +00:00
parent 90669d5591
commit 2d6147eb18
2 changed files with 18 additions and 28 deletions

View File

@ -11,8 +11,8 @@ object ObjectInspectorDlg: TObjectInspectorDlg
LCLVersion = '1.3' LCLVersion = '1.3'
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Height = 22 Height = 23
Top = 647 Top = 646
Width = 300 Width = 300
Panels = < Panels = <
item item
@ -24,11 +24,11 @@ object ObjectInspectorDlg: TObjectInspectorDlg
end end
object AvailPersistentComboBox: TComboBox object AvailPersistentComboBox: TComboBox
Left = 0 Left = 0
Height = 25 Height = 23
Top = 0 Top = 0
Width = 300 Width = 300
Align = alTop Align = alTop
ItemHeight = 0 ItemHeight = 15
OnCloseUp = AvailComboBoxCloseUp OnCloseUp = AvailComboBoxCloseUp
Style = csDropDownList Style = csDropDownList
TabOrder = 0 TabOrder = 0
@ -36,7 +36,7 @@ object ObjectInspectorDlg: TObjectInspectorDlg
object ComponentPanel: TPanel object ComponentPanel: TPanel
Left = 0 Left = 0
Height = 184 Height = 184
Top = 25 Top = 23
Width = 300 Width = 300
Align = alTop Align = alTop
ClientHeight = 184 ClientHeight = 184
@ -47,10 +47,10 @@ object ObjectInspectorDlg: TObjectInspectorDlg
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = FilterLabel AnchorSideTop.Control = FilterLabel
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 87 Left = 77
Height = 25 Height = 23
Top = 2 Top = 3
Width = 184 Width = 194
UseFormActivate = True UseFormActivate = True
ButtonWidth = 23 ButtonWidth = 23
NumGlyphs = 1 NumGlyphs = 1
@ -63,7 +63,7 @@ object ObjectInspectorDlg: TObjectInspectorDlg
Left = 3 Left = 3
Height = 15 Height = 15
Top = 7 Top = 7
Width = 79 Width = 69
Caption = 'Co&mponents' Caption = 'Co&mponents'
FocusControl = CompFilterEdit FocusControl = CompFilterEdit
ParentColor = False ParentColor = False

View File

@ -2631,22 +2631,8 @@ var
lclPlatform: TLCLPlatform; lclPlatform: TLCLPlatform;
X, Y: Integer; X, Y: Integer;
NameBgColor: TColor; NameBgColor: TColor;
procedure DrawTreeIcon(X, Y: Integer; Minus: Boolean);
const
PlusMinusDetail: array[Boolean] of TThemedTreeview =
(
ttGlyphClosed,
ttGlyphOpened
);
var
Details: TThemedElementDetails; Details: TThemedElementDetails;
Size: TSize; Size: TSize;
begin
Details := ThemeServices.GetElementDetails(PlusMinusDetail[Minus]);
Size := ThemeServices.GetDetailSize(Details);
ThemeServices.DrawElement(Canvas.Handle, Details, Rect(X, Y, X + Size.cx, Y + Size.cy), nil);
end;
// PaintRow // PaintRow
begin begin
@ -2679,7 +2665,6 @@ begin
end; end;
IconX:=GetTreeIconX(ARow); IconX:=GetTreeIconX(ARow);
IconY:=((NameRect.Bottom-NameRect.Top-9) div 2)+NameRect.Top;
NameIconRect := NameRect; NameIconRect := NameRect;
NameIconRect.Right := IconX + Indent; NameIconRect.Right := IconX + Indent;
NameTextRect := NameRect; NameTextRect := NameRect;
@ -2720,8 +2705,13 @@ begin
end; end;
// draw icon // draw icon
if CurRow.Expanded then
Details := ThemeServices.GetElementDetails(ttGlyphOpened)
else Details := ThemeServices.GetElementDetails(ttGlyphClosed);
Size := ThemeServices.GetDetailSize(Details);
IconY:=((NameRect.Bottom - NameRect.Top - Size.cy) div 2) + NameRect.Top;
if CanExpandRow(CurRow) then if CanExpandRow(CurRow) then
DrawTreeIcon(IconX, IconY, CurRow.Expanded) ThemeServices.DrawElement(Canvas.Handle, Details, Rect(IconX, IconY, IconX + Size.cx, IconY + Size.cy), nil)
else if (ARow = FItemIndex) then else if (ARow = FItemIndex) then
Canvas.Draw(IconX, IconY, FActiveRowBmp); Canvas.Draw(IconX, IconY, FActiveRowBmp);