spktoolbar: Option to draw selection in TSpkToolbar with rounded corners.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8749 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-27 15:09:47 +00:00
parent d3a9ebb97a
commit 7d9529a164
7 changed files with 177 additions and 47 deletions

View File

@ -28,7 +28,6 @@ const
// ****************
// *** Elements ***
// ****************
LARGEBUTTON_DROPDOWN_FIELD_SIZE = 29;
LARGEBUTTON_GLYPH_MARGIN = 2;
LARGEBUTTON_CAPTION_HMARGIN = 3;
@ -58,7 +57,6 @@ const
// ***********************
// *** Tab page layout ***
// ***********************
/// <summary>Maximum area height that can be used by an element</summary>
MAX_ELEMENT_HEIGHT = 67;
@ -96,7 +94,6 @@ const
// *******************
// *** Pane layout ***
// *******************
/// <summary>Pane caption height</summary>
PANE_CAPTION_HEIGHT = 15;
/// <summary>Pane corner radius</summary>
@ -115,7 +112,6 @@ const
// ************
// *** Tabs ***
// ************
/// <summary>Tab corner radius</summary>
TAB_CORNER_RADIUS = 4;
/// <summary>Tab page left margin</summary>
@ -135,7 +131,6 @@ const
// *******************
// *** Menu button ***
// *******************
/// <summary>Menu button corner radius</summary>
MENUBUTTON_CORNER_RADIUS = 4;
/// <summary>Menu button minimum width</summary>
@ -145,7 +140,6 @@ const
// ***************
// *** Toolbar ***
// ***************
/// <summary>Pane padding?</summary>
TOOLBAR_BORDER_WIDTH = 1;
TOOLBAR_CORNER_RADIUS = 0; //was: 3;
@ -160,8 +154,8 @@ const
// *********************
// *** Dropdown menu ***
// *********************
DROPDOWN_MENU_MARGIN = 3;
DROPDOWN_SELECTION_RADIUS = 4;
var
// ****************
@ -200,6 +194,7 @@ var
// *********************
DropDownMenuMargin: Integer;
DropDownSelectionRadius: Integer;
// ***********************
@ -358,6 +353,7 @@ begin
DropdownArrowHeight := SpkScaleY(DROPDOWN_ARROW_HEIGHT, FromDPI, ToDPI);
DropdownMenuMargin := SpkScaleX(DROPDOWN_MENU_MARGIN, FromDPI, ToDpi);
DropdownSelectionRadius := DROPDOWN_SELECTION_RADIUS;
MaxElementHeight := SpkScaleY(MAX_ELEMENT_HEIGHT, FromDPI, ToDPI);
PaneRowHeight := SpkScaleY(PANE_ROW_HEIGHT, FromDPI, ToDPI);
@ -411,6 +407,9 @@ begin
if SmallButtonRadius > 1 then
SmallButtonRadius := SpkScaleX(SmallButtonRadius, FromDPI, ToDPI);
if DropDownSelectionRadius > 1 then
DropDownSelectionRadius := SpkScaleX(DropDownSelectionRadius, FromDPI, ToDPI);
if PaneCornerRadius > 1 then
PaneCornerRadius := SpkScaleX(PaneCornerRadius, FromDPI, ToDPI);