From 7805ba4569548e76f3938dbea46779079f045828 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 7 Aug 2023 22:10:44 +0000 Subject: [PATCH] TvPlanIt: Minor improvements. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8917 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpnavbar.pas | 2 +- components/tvplanit/source/vpnavbarpainter.pas | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/tvplanit/source/vpnavbar.pas b/components/tvplanit/source/vpnavbar.pas index 61bdca6dc..12047725d 100644 --- a/components/tvplanit/source/vpnavbar.pas +++ b/components/tvplanit/source/vpnavbar.pas @@ -1619,7 +1619,7 @@ begin SpaceTop := TVpNavBtnItem(Folder.Items[I - 1]).FLabelRect.Bottom + 1; SpaceBottom := TVpNavBtnItem(Folder.Items[I]).FIconRect.Top - 1; if (Y >= SpaceTop) and (Y <= SpaceBottom) then begin - if SpaceTop - SpaceBottom < 6 then + if SpaceBottom - SpaceTop > 6 then nabDropY := SpaceTop + (SpaceBottom - SpaceTop) div 2 else nabDropY := SpaceTop + 3; diff --git a/components/tvplanit/source/vpnavbarpainter.pas b/components/tvplanit/source/vpnavbarpainter.pas index ac470d38c..4597d3300 100644 --- a/components/tvplanit/source/vpnavbarpainter.pas +++ b/components/tvplanit/source/vpnavbarpainter.pas @@ -156,6 +156,7 @@ var h: Integer; R: TRect; dx, dy: Integer; + buttonDistance: Integer; {$IFDEF LCL} {$IF LCL_FullVersion >= 1090000} imgres: TScaledImageListResolution; @@ -170,6 +171,7 @@ begin // horizontally dy := ScaleY(LARGE_ICON_TEXT_DISTANCE, DesignTimeDPI); dx := ScaleX(SMALL_ICON_TEXT_DISTANCE, DesignTimeDPI); + buttonDistance := ScaleY(BUTTON_DISTANCE, DesignTimeDPI); { If an image list is assigned then use the image size. If no image list is assinged then assume a 32 x 32 image size. @@ -194,7 +196,7 @@ begin exit; // Distance of top-most icon to the last upper button - Inc(CurPos, ScaleY(BUTTON_DISTANCE, DesignTimeDPI)); + Inc(CurPos, buttonDistance); with nabItemsRect^ do begin Top := CurPos;