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

View File

@ -2631,22 +2631,8 @@ var
lclPlatform: TLCLPlatform;
X, Y: Integer;
NameBgColor: TColor;
procedure DrawTreeIcon(X, Y: Integer; Minus: Boolean);
const
PlusMinusDetail: array[Boolean] of TThemedTreeview =
(
ttGlyphClosed,
ttGlyphOpened
);
var
Details: TThemedElementDetails;
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;
Details: TThemedElementDetails;
Size: TSize;
// PaintRow
begin
@ -2679,7 +2665,6 @@ begin
end;
IconX:=GetTreeIconX(ARow);
IconY:=((NameRect.Bottom-NameRect.Top-9) div 2)+NameRect.Top;
NameIconRect := NameRect;
NameIconRect.Right := IconX + Indent;
NameTextRect := NameRect;
@ -2720,8 +2705,13 @@ begin
end;
// 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
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
Canvas.Draw(IconX, IconY, FActiveRowBmp);