From 2d6147eb1811218a5e50e2f5747b7b4e22fbe279 Mon Sep 17 00:00:00 2001 From: juha Date: Mon, 15 Sep 2014 15:39:49 +0000 Subject: [PATCH] ObjectInspector: locate the arrow on left side vertically better. Issue #26258, patch from Howardpc. git-svn-id: trunk@46239 - --- components/ideintf/objectinspector.lfm | 20 ++++++++++---------- components/ideintf/objectinspector.pp | 26 ++++++++------------------ 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/components/ideintf/objectinspector.lfm b/components/ideintf/objectinspector.lfm index db68bdce3c..e3ff9e65d2 100644 --- a/components/ideintf/objectinspector.lfm +++ b/components/ideintf/objectinspector.lfm @@ -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 diff --git a/components/ideintf/objectinspector.pp b/components/ideintf/objectinspector.pp index 2976f9f666..c8d384feb0 100644 --- a/components/ideintf/objectinspector.pp +++ b/components/ideintf/objectinspector.pp @@ -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);