mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 15:28:14 +02:00
themes: add size of drop down part of toolbutton
git-svn-id: trunk@12570 -
This commit is contained in:
parent
1d7db6a607
commit
0c359236ac
@ -6,7 +6,7 @@ interface
|
||||
|
||||
uses
|
||||
// os
|
||||
Windows, Win32UxTheme, Win32Proc, Win32Extra,
|
||||
Windows, Win32UxTheme, Win32Proc, Win32Extra, TmSchema,
|
||||
// rtl
|
||||
Classes, SysUtils,
|
||||
// lcl
|
||||
@ -33,6 +33,8 @@ type
|
||||
public
|
||||
destructor Destroy; override;
|
||||
|
||||
function GetDetailSize(Details: TThemedElementDetails): Integer; override;
|
||||
|
||||
procedure DrawElement(DC: HDC; Details: TThemedElementDetails; const R: TRect;
|
||||
ClipRect: PRect = nil); override;
|
||||
procedure DrawEdge(DC: HDC; Details: TThemedElementDetails; const R: TRect; Edge, Flags: Cardinal;
|
||||
@ -109,6 +111,21 @@ begin
|
||||
FreeThemeLibrary;
|
||||
end;
|
||||
|
||||
function TWin32ThemeServices.GetDetailSize(Details: TThemedElementDetails
|
||||
): Integer;
|
||||
begin
|
||||
if ThemesEnabled then
|
||||
case Details.Element of
|
||||
teToolBar:
|
||||
if Details.Part = TP_SPLITBUTTONDROPDOWN then
|
||||
Result := 12;
|
||||
else
|
||||
Result:=inherited GetDetailSize(Details);
|
||||
end
|
||||
else
|
||||
Result:=inherited GetDetailSize(Details);
|
||||
end;
|
||||
|
||||
function TWin32ThemeServices.UseThemes: Boolean;
|
||||
begin
|
||||
Result := Win32UxTheme.UseThemes and (GetFileVersion(comctl32) >= ComCtlVersionIE6);
|
||||
|
@ -1743,9 +1743,12 @@ begin
|
||||
teButton:
|
||||
if Details.Part in [BP_RADIOBUTTON, BP_CHECKBOX] then
|
||||
Result := 13;
|
||||
teRebar :
|
||||
teRebar:
|
||||
if Details.Part in [RP_GRIPPER, RP_GRIPPERVERT] then
|
||||
Result := 30;
|
||||
teToolBar:
|
||||
if Details.Part = TP_SPLITBUTTONDROPDOWN then
|
||||
Result := 10;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user