mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-18 03:28:32 +02:00
LCL: Call TThemeServices.GetDetailSizeForPPI with proper arguments. Revert 1138d26280
.
This commit is contained in:
parent
ee395fe65a
commit
c14934764c
@ -6998,7 +6998,9 @@ end;
|
|||||||
procedure TAnchorDockCloseButton.CalculatePreferredSize(var PreferredWidth,
|
procedure TAnchorDockCloseButton.CalculatePreferredSize(var PreferredWidth,
|
||||||
PreferredHeight: integer; WithThemeSpace: Boolean);
|
PreferredHeight: integer; WithThemeSpace: Boolean);
|
||||||
begin
|
begin
|
||||||
with ThemeServices.GetDetailSize(ThemeServices.GetElementDetails({$IFDEF LCLWIN32}twCloseButtonNormal{$ELSE}twSmallCloseButtonNormal{$ENDIF})) do
|
with ThemeServices.GetDetailSizeForPPI(ThemeServices.GetElementDetails(
|
||||||
|
{$IFDEF LCLWIN32}twCloseButtonNormal{$ELSE}twSmallCloseButtonNormal{$ENDIF}),
|
||||||
|
Font.PixelsPerInch) do
|
||||||
begin
|
begin
|
||||||
PreferredWidth:=cx;
|
PreferredWidth:=cx;
|
||||||
PreferredHeight:=cy;
|
PreferredHeight:=cy;
|
||||||
@ -7040,7 +7042,9 @@ end;
|
|||||||
procedure TAnchorDockMinimizeButton.CalculatePreferredSize(var PreferredWidth,
|
procedure TAnchorDockMinimizeButton.CalculatePreferredSize(var PreferredWidth,
|
||||||
PreferredHeight: integer; WithThemeSpace: Boolean);
|
PreferredHeight: integer; WithThemeSpace: Boolean);
|
||||||
begin
|
begin
|
||||||
with ThemeServices.GetDetailSize(ThemeServices.GetElementDetails({$IFDEF LCLGtk2}twMDIRestoreButtonNormal{$ELSE}twMinButtonNormal{$ENDIF})) do
|
with ThemeServices.GetDetailSizeForPPI(ThemeServices.GetElementDetails(
|
||||||
|
{$IFDEF LCLGtk2}twMDIRestoreButtonNormal{$ELSE}twMinButtonNormal{$ENDIF}),
|
||||||
|
Font.PixelsPerInch) do
|
||||||
begin
|
begin
|
||||||
PreferredWidth:=cx;
|
PreferredWidth:=cx;
|
||||||
PreferredHeight:=cy;
|
PreferredHeight:=cy;
|
||||||
|
@ -2036,15 +2036,14 @@ begin
|
|||||||
inherited FontChanged(Sender);
|
inherited FontChanged(Sender);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomDateTimePicker.GetCheckBoxRect(
|
function TCustomDateTimePicker.GetCheckBoxRect(IgnoreRightToLeft: Boolean): TRect;
|
||||||
IgnoreRightToLeft: Boolean): TRect;
|
|
||||||
var
|
var
|
||||||
Details: TThemedElementDetails;
|
Details: TThemedElementDetails;
|
||||||
CSize: TSize;
|
CSize: TSize;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
||||||
CSize := ThemeServices.GetDetailSize(Details);
|
CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
CSize.cx := ScaleScreenToFont(CSize.cx);
|
CSize.cx := ScaleScreenToFont(CSize.cx);
|
||||||
CSize.cy := ScaleScreenToFont(CSize.cy);
|
CSize.cy := ScaleScreenToFont(CSize.cy);
|
||||||
|
|
||||||
@ -3869,7 +3868,7 @@ procedure TDTSpeedButton.Paint;
|
|||||||
else
|
else
|
||||||
ArrowState := ttbSplitButtonDropDownDisabled;
|
ArrowState := ttbSplitButtonDropDownDisabled;
|
||||||
Details := ThemeServices.GetElementDetails(ArrowState);
|
Details := ThemeServices.GetElementDetails(ArrowState);
|
||||||
ASize := ThemeServices.GetDetailSize(Details);
|
ASize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
ARect := Rect(0, 0, Width, Height);
|
ARect := Rect(0, 0, Width, Height);
|
||||||
InflateRect(ARect, -(ARect.Right - ARect.Left - ASize.cx) div 2, 0);
|
InflateRect(ARect, -(ARect.Right - ARect.Left - ASize.cx) div 2, 0);
|
||||||
ThemeServices.DrawElement(Canvas.Handle, Details, ARect);
|
ThemeServices.DrawElement(Canvas.Handle, Details, ARect);
|
||||||
|
@ -1025,7 +1025,7 @@ begin
|
|||||||
FSplitterX:=100;
|
FSplitterX:=100;
|
||||||
FPreferredSplitterX:=FSplitterX;
|
FPreferredSplitterX:=FSplitterX;
|
||||||
Details := ThemeServices.GetElementDetails(ttGlyphOpened);
|
Details := ThemeServices.GetElementDetails(ttGlyphOpened);
|
||||||
FIndent := ThemeServices.GetDetailSize(Details).cx;
|
FIndent := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch).cx;
|
||||||
|
|
||||||
FBackgroundColor:=DefBackgroundColor;
|
FBackgroundColor:=DefBackgroundColor;
|
||||||
FReferencesColor:=DefReferencesColor;
|
FReferencesColor:=DefReferencesColor;
|
||||||
@ -2401,7 +2401,7 @@ begin
|
|||||||
// WasValueClick param is only for Boolean checkboxes, toggled if user
|
// WasValueClick param is only for Boolean checkboxes, toggled if user
|
||||||
// clicks the square. It has no effect for Boolean ComboBox editor.
|
// clicks the square. It has no effect for Boolean ComboBox editor.
|
||||||
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
||||||
Sz := ThemeServices.GetDetailSize(Details);
|
Sz := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
SetItemIndexAndFocus(Index, (X>SplitterX) and (X<=SplitterX+Sz.cx));
|
SetItemIndexAndFocus(Index, (X>SplitterX) and (X<=SplitterX+Sz.cx));
|
||||||
SetCaptureControl(Self);
|
SetCaptureControl(Self);
|
||||||
Column := oipgcValue;
|
Column := oipgcValue;
|
||||||
@ -2976,7 +2976,7 @@ var
|
|||||||
Details := ThemeServices.GetElementDetails(ttGlyphClosed);
|
Details := ThemeServices.GetElementDetails(ttGlyphClosed);
|
||||||
if CanExpandRow(CurRow) then
|
if CanExpandRow(CurRow) then
|
||||||
begin
|
begin
|
||||||
sz := ThemeServices.GetDetailSize(Details);
|
sz := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
IconY:=((NameRect.Bottom - NameRect.Top - sz.cy) div 2) + NameRect.Top;
|
IconY:=((NameRect.Bottom - NameRect.Top - sz.cy) div 2) + NameRect.Top;
|
||||||
ThemeServices.DrawElement(Canvas.Handle, Details,
|
ThemeServices.DrawElement(Canvas.Handle, Details,
|
||||||
Rect(IconX, IconY, IconX + sz.cx, IconY + sz.cy), nil)
|
Rect(IconX, IconY, IconX + sz.cx, IconY + sz.cy), nil)
|
||||||
|
@ -30,7 +30,7 @@ uses
|
|||||||
StdCtrls, Buttons, Menus, ExtCtrls, ComCtrls, Dialogs, EditBtn, Grids, ValEdit,
|
StdCtrls, Buttons, Menus, ExtCtrls, ComCtrls, Dialogs, EditBtn, Grids, ValEdit,
|
||||||
FileCtrl, PropertyStorage, Themes,
|
FileCtrl, PropertyStorage, Themes,
|
||||||
// LazControls
|
// LazControls
|
||||||
{$IFnDEF UseOINormalCheckBox} CheckBoxThemed, {$ENDIF}
|
CheckBoxThemed,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
FileUtil, StringHashList, LazMethodList, LazLoggerBase, LazUtilities, LazStringUtils,
|
FileUtil, StringHashList, LazMethodList, LazLoggerBase, LazUtilities, LazStringUtils,
|
||||||
GraphType, UITypes, FPCAdds, // for StrToQWord in older fpc versions
|
GraphType, UITypes, FPCAdds, // for StrToQWord in older fpc versions
|
||||||
@ -302,7 +302,9 @@ type
|
|||||||
FPropList: PInstPropList;
|
FPropList: PInstPropList;
|
||||||
protected
|
protected
|
||||||
// Draw Checkbox for Boolean and Set element editors.
|
// Draw Checkbox for Boolean and Set element editors.
|
||||||
|
{$IFDEF UseOINormalCheckBox}
|
||||||
function DrawCheckbox(ACanvas: TCanvas; const ARect: TRect; IsTrue: Boolean): TRect;
|
function DrawCheckbox(ACanvas: TCanvas; const ARect: TRect; IsTrue: Boolean): TRect;
|
||||||
|
{$ENDIF}
|
||||||
function DrawCheckValue(ACanvas: TCanvas; const ARect: TRect;
|
function DrawCheckValue(ACanvas: TCanvas; const ARect: TRect;
|
||||||
{%H-}AState: TPropEditDrawState; {%H-}IsTrue: Boolean): TRect;
|
{%H-}AState: TPropEditDrawState; {%H-}IsTrue: Boolean): TRect;
|
||||||
procedure DrawValue(const AValue: string; ACanvas:TCanvas; const ARect:TRect;
|
procedure DrawValue(const AValue: string; ACanvas:TCanvas; const ARect:TRect;
|
||||||
@ -2775,6 +2777,7 @@ begin
|
|||||||
Result := (FPropList^[0].Instance <> nil) and IsStoredProp(FPropList^[0].Instance, FPropList^[0].PropInfo);
|
Result := (FPropList^[0].Instance <> nil) and IsStoredProp(FPropList^[0].Instance, FPropList^[0].PropInfo);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFDEF UseOINormalCheckBox}
|
||||||
function TPropertyEditor.DrawCheckbox(ACanvas: TCanvas; const ARect: TRect;
|
function TPropertyEditor.DrawCheckbox(ACanvas: TCanvas; const ARect: TRect;
|
||||||
IsTrue: Boolean): TRect;
|
IsTrue: Boolean): TRect;
|
||||||
// Draws a Checkbox using theme services for editing booleans.
|
// Draws a Checkbox using theme services for editing booleans.
|
||||||
@ -2796,7 +2799,7 @@ begin
|
|||||||
else
|
else
|
||||||
Check := tbCheckBoxUncheckedNormal;
|
Check := tbCheckBoxUncheckedNormal;
|
||||||
Details := ThemeServices.GetElementDetails(Check);
|
Details := ThemeServices.GetElementDetails(Check);
|
||||||
Sz := ThemeServices.GetDetailSize(Details);
|
Sz := TCustomCheckBoxThemed.GetCheckBoxSize(ScreenInfo.PixelsPerInchX);
|
||||||
TopMargin := (ARect.Bottom - ARect.Top - Sz.cy) div 2;
|
TopMargin := (ARect.Bottom - ARect.Top - Sz.cy) div 2;
|
||||||
BRect := ARect;
|
BRect := ARect;
|
||||||
// Left varies by widgetset and theme etc. Real Checkbox itself has a left margin.
|
// Left varies by widgetset and theme etc. Real Checkbox itself has a left margin.
|
||||||
@ -2809,6 +2812,7 @@ begin
|
|||||||
// Text will be written after the box.
|
// Text will be written after the box.
|
||||||
Inc(Result.Left, Sz.cx + 4);
|
Inc(Result.Left, Sz.cx + 4);
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
function TPropertyEditor.DrawCheckValue(ACanvas: TCanvas; const ARect: TRect;
|
function TPropertyEditor.DrawCheckValue(ACanvas: TCanvas; const ARect: TRect;
|
||||||
AState: TPropEditDrawState; IsTrue: Boolean): TRect;
|
AState: TPropEditDrawState; IsTrue: Boolean): TRect;
|
||||||
|
@ -53,8 +53,6 @@ type
|
|||||||
procedure SetState(AValue: TCheckBoxState);
|
procedure SetState(AValue: TCheckBoxState);
|
||||||
private class var
|
private class var
|
||||||
FThemeCheckBoxSize: TSize;
|
FThemeCheckBoxSize: TSize;
|
||||||
protected
|
|
||||||
class function GetCheckBoxSize(const PixelsPerInch: Integer): TSize;
|
|
||||||
protected
|
protected
|
||||||
CheckBoxPressed: Boolean;
|
CheckBoxPressed: Boolean;
|
||||||
KnobPosUnchecked, KnobPosChecked, KnobPosGrayed: Integer;
|
KnobPosUnchecked, KnobPosChecked, KnobPosGrayed: Integer;
|
||||||
@ -83,6 +81,7 @@ type
|
|||||||
cFocusBorder: SmallInt = 2;
|
cFocusBorder: SmallInt = 2;
|
||||||
cIndent: SmallInt = 5;
|
cIndent: SmallInt = 5;
|
||||||
public
|
public
|
||||||
|
class function GetCheckBoxSize(const PixelsPerInch: Integer): TSize;
|
||||||
class procedure PaintSelf(ACanvas: TCanvas; ACaption: string; ARect: TRect;
|
class procedure PaintSelf(ACanvas: TCanvas; ACaption: string; ARect: TRect;
|
||||||
AState: TCheckBoxState; ARightToLeft, AHovered, APressed, AFocused: Boolean;
|
AState: TCheckBoxState; ARightToLeft, AHovered, APressed, AFocused: Boolean;
|
||||||
AAlignment: TLeftRight; AEnabled: Boolean = True);
|
AAlignment: TLeftRight; AEnabled: Boolean = True);
|
||||||
@ -236,9 +235,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TCustomCheckBoxThemed.InitCheckBoxSize;
|
class procedure TCustomCheckBoxThemed.InitCheckBoxSize;
|
||||||
|
var
|
||||||
|
Detail: TThemedElementDetails;
|
||||||
begin
|
begin
|
||||||
with ThemeServices do
|
Detail := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
||||||
FThemeCheckBoxSize := GetDetailSize(GetElementDetails(tbCheckBoxCheckedNormal));
|
FThemeCheckBoxSize := ThemeServices.GetDetailSizeForPPI(Detail, Screen.PixelsPerInch);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomCheckBoxThemed.DialogChar(var Message: TLMKey): Boolean;
|
function TCustomCheckBoxThemed.DialogChar(var Message: TLMKey): Boolean;
|
||||||
@ -285,8 +286,7 @@ begin
|
|||||||
Result := TCheckBoxThemedActionLink;
|
Result := TCheckBoxThemedActionLink;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TCustomCheckBoxThemed.GetCheckBoxSize(
|
class function TCustomCheckBoxThemed.GetCheckBoxSize(const PixelsPerInch: Integer): TSize;
|
||||||
const PixelsPerInch: Integer): TSize;
|
|
||||||
begin
|
begin
|
||||||
if FThemeCheckBoxSize.cx<=0 then
|
if FThemeCheckBoxSize.cx<=0 then
|
||||||
InitCheckBoxSize;
|
InitCheckBoxSize;
|
||||||
|
@ -126,7 +126,7 @@ begin
|
|||||||
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal)
|
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal)
|
||||||
else
|
else
|
||||||
Details := ThemeServices.GetElementDetails(tbCheckBoxUncheckedNormal);
|
Details := ThemeServices.GetElementDetails(tbCheckBoxUncheckedNormal);
|
||||||
R.Right:=R.Left+ThemeServices.GetDetailSize(Details).cx;
|
R.Right:=R.Left+ThemeServices.GetDetailSizeForPPI(Details, PixelsPerInch).cx;
|
||||||
ThemeServices.DrawElement(ItemsTreeView.Canvas.Handle, Details, R, nil);
|
ThemeServices.DrawElement(ItemsTreeView.Canvas.Handle, Details, R, nil);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -248,8 +248,8 @@ begin
|
|||||||
if Visible and (ImageList1.Count=0) then begin
|
if Visible and (ImageList1.Count=0) then begin
|
||||||
CheckedDetails := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
CheckedDetails := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
||||||
UnCheckedDetails := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
UnCheckedDetails := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
||||||
CheckedSize:=ThemeServices.GetDetailSize(CheckedDetails);
|
CheckedSize:=ThemeServices.GetDetailSizeForPPI(CheckedDetails, PixelsPerInch);
|
||||||
UnCheckedSize:=ThemeServices.GetDetailSize(UnCheckedDetails);
|
UnCheckedSize:=ThemeServices.GetDetailSizeForPPI(UnCheckedDetails, PixelsPerInch);
|
||||||
ImageList1.Width:=Max(CheckedSize.cx,UnCheckedSize.cx);
|
ImageList1.Width:=Max(CheckedSize.cx,UnCheckedSize.cx);
|
||||||
ImageList1.Height:=Max(CheckedSize.cy,UnCheckedSize.cy);
|
ImageList1.Height:=Max(CheckedSize.cy,UnCheckedSize.cy);
|
||||||
Bmp:=TBitmap.Create;
|
Bmp:=TBitmap.Create;
|
||||||
|
@ -519,7 +519,7 @@ begin
|
|||||||
|
|
||||||
Details := ThemeServices.GetElementDetails(tbRadioButtonUncheckedNormal);
|
Details := ThemeServices.GetElementDetails(tbRadioButtonUncheckedNormal);
|
||||||
details_chek:=ThemeServices.GetElementDetails(tbRadioButtonCheckedNormal);
|
details_chek:=ThemeServices.GetElementDetails(tbRadioButtonCheckedNormal);
|
||||||
CSize := ThemeServices.GetDetailSize(Details);
|
CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
|
|
||||||
|
|
||||||
while (AY < DRect.Bottom) and (i<TRadioGroup(FControl).Items.Count) do
|
while (AY < DRect.Bottom) and (i<TRadioGroup(FControl).Items.Count) do
|
||||||
@ -627,7 +627,7 @@ begin
|
|||||||
i:=0;
|
i:=0;
|
||||||
|
|
||||||
Details := ThemeServices.GetElementDetails(tbCheckBoxUncheckedNormal);
|
Details := ThemeServices.GetElementDetails(tbCheckBoxUncheckedNormal);
|
||||||
CSize := ThemeServices.GetDetailSize(Details);
|
CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
|
|
||||||
aH:=Max(Canvas.TextHeight(Text) div 2, CSize.cy);
|
aH:=Max(Canvas.TextHeight(Text) div 2, CSize.cy);
|
||||||
|
|
||||||
@ -1210,7 +1210,7 @@ var
|
|||||||
details: TThemedElementDetails;
|
details: TThemedElementDetails;
|
||||||
begin
|
begin
|
||||||
Details := ThemeServices.GetElementDetails(GetCheckStyle(Checked));
|
Details := ThemeServices.GetElementDetails(GetCheckStyle(Checked));
|
||||||
CSize := ThemeServices.GetDetailSize(Details);
|
CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
PaintRect.Left := DRect.Left;
|
PaintRect.Left := DRect.Left;
|
||||||
PaintRect.Top := (DRect.Top + DRect.Bottom - CSize.cy) div 2;
|
PaintRect.Top := (DRect.Top + DRect.Bottom - CSize.cy) div 2;
|
||||||
PaintRect := Bounds(PaintRect.Left, PaintRect.Top, CSize.cx, CSize.cy);
|
PaintRect := Bounds(PaintRect.Left, PaintRect.Top, CSize.cx, CSize.cy);
|
||||||
|
@ -24375,7 +24375,7 @@ begin
|
|||||||
if UseThemes then
|
if UseThemes then
|
||||||
begin
|
begin
|
||||||
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
||||||
checkSize := ThemeServices.GetDetailSize(Details).CX;
|
checkSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch).CX;
|
||||||
R := Rect(XPos, YPos, XPos + checkSize, YPos + checkSize);
|
R := Rect(XPos, YPos, XPos + checkSize, YPos + checkSize);
|
||||||
Details.Element := teButton;
|
Details.Element := teButton;
|
||||||
case Index of
|
case Index of
|
||||||
|
@ -840,7 +840,7 @@ begin
|
|||||||
FedPressed:=ThemeServices.GetElementDetails(tbRadioButtonCheckedPressed);
|
FedPressed:=ThemeServices.GetElementDetails(tbRadioButtonCheckedPressed);
|
||||||
FedUncheckedHot:=ThemeServices.GetElementDetails(tbRadioButtonUncheckedHot);
|
FedUncheckedHot:=ThemeServices.GetElementDetails(tbRadioButtonUncheckedHot);
|
||||||
FedCheckedHot:=ThemeServices.GetElementDetails(tbRadioButtonCheckedHot);
|
FedCheckedHot:=ThemeServices.GetElementDetails(tbRadioButtonCheckedHot);
|
||||||
FedSize:=ThemeServices.GetDetailSize(FedUnChecked);
|
FedSize:=ThemeServices.GetDetailSizeForPPI(FedUnChecked, Font.PixelsPerInch);
|
||||||
FRadioHeight:=Max(FedSize.cy, anImgList.Height);
|
FRadioHeight:=Max(FedSize.cy, anImgList.Height);
|
||||||
topOffset:=(FRadioHeight - FedSize.cy) div 2;
|
topOffset:=(FRadioHeight - FedSize.cy) div 2;
|
||||||
FRadioRect:=Rect(0, topOffset, FedSize.cx, topOffset+FedSize.cy);
|
FRadioRect:=Rect(0, topOffset, FedSize.cx, topOffset+FedSize.cy);
|
||||||
|
@ -299,7 +299,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
Details := ThemeServices.GetElementDetails(tbPushButtonNormal);
|
Details := ThemeServices.GetElementDetails(tbPushButtonNormal);
|
||||||
DefButtonSize := ThemeServices.GetDetailSize(Details);
|
DefButtonSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
FButtonsWidth := DefButtonSize.cx;
|
FButtonsWidth := DefButtonSize.cx;
|
||||||
FButtonsHeight := DefButtonSize.cy;
|
FButtonsHeight := DefButtonSize.cy;
|
||||||
|
|
||||||
@ -382,7 +382,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
Details := ThemeServices.GetElementDetails(tbPushButtonNormal);
|
Details := ThemeServices.GetElementDetails(tbPushButtonNormal);
|
||||||
DefButtonSize := ThemeServices.GetDetailSize(Details);
|
DefButtonSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
|
|
||||||
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.UpdateButtonSize'){$ENDIF};
|
DisableAutoSizing{$IFDEF DebugDisableAutoSizing}('TCustomButtonPanel.UpdateButtonSize'){$ENDIF};
|
||||||
try
|
try
|
||||||
|
@ -4354,7 +4354,7 @@ begin
|
|||||||
soDescending: Details := ThemeServices.GetElementDetails(thHeaderSortArrowSortedDown);
|
soDescending: Details := ThemeServices.GetElementDetails(thHeaderSortArrowSortedDown);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
s := ThemeServices.GetDetailSize(Details);
|
s := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
end else
|
end else
|
||||||
s := Size(-1, -1);
|
s := Size(-1, -1);
|
||||||
if s.cx>0 then // theme services support sorted arrows
|
if s.cx>0 then // theme services support sorted arrows
|
||||||
@ -4839,7 +4839,7 @@ begin
|
|||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
Details := ThemeServices.GetElementDetails(arrtb[AState]);
|
Details := ThemeServices.GetElementDetails(arrtb[AState]);
|
||||||
CSize := ThemeServices.GetDetailSize(Details);
|
CSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch);
|
||||||
CSize.cx := MulDiv(CSize.cx, Font.PixelsPerInch, Screen.PixelsPerInch);
|
CSize.cx := MulDiv(CSize.cx, Font.PixelsPerInch, Screen.PixelsPerInch);
|
||||||
CSize.cy := MulDiv(CSize.cy, Font.PixelsPerInch, Screen.PixelsPerInch);
|
CSize.cy := MulDiv(CSize.cy, Font.PixelsPerInch, Screen.PixelsPerInch);
|
||||||
end;
|
end;
|
||||||
|
@ -646,7 +646,7 @@ begin { do not call inherited ! }
|
|||||||
[aEnabled, aState, not aDropped and FCheckHighlight]);
|
[aEnabled, aState, not aDropped and FCheckHighlight]);
|
||||||
if FNeedMeasure then
|
if FNeedMeasure then
|
||||||
begin
|
begin
|
||||||
FCheckSize:=ThemeServices.GetDetailSize(aDetail);
|
FCheckSize:=ThemeServices.GetDetailSizeForPPI(aDetail, Font.PixelsPerInch);
|
||||||
FTextHeight:=Canvas.TextHeight('ŠjÁÇ');
|
FTextHeight:=Canvas.TextHeight('ŠjÁÇ');
|
||||||
if not aDropped then
|
if not aDropped then
|
||||||
begin
|
begin
|
||||||
|
@ -881,7 +881,7 @@ procedure TCustomSplitter.Paint;
|
|||||||
BF_ADJUST or BF_RECT, @ARect);
|
BF_ADJUST or BF_RECT, @ARect);
|
||||||
|
|
||||||
GripperRect := ARect;
|
GripperRect := ARect;
|
||||||
GripperSize := ThemeServices.GetDetailSize(GripperDetails);
|
GripperSize := ThemeServices.GetDetailSizeForPPI(GripperDetails, Font.PixelsPerInch);
|
||||||
if (GripperSize.cx <> -1) or (GripperSize.cy <> -1) then
|
if (GripperSize.cx <> -1) or (GripperSize.cy <> -1) then
|
||||||
begin
|
begin
|
||||||
if ResizeAnchor in [akLeft,akRight] then
|
if ResizeAnchor in [akLeft,akRight] then
|
||||||
|
@ -90,9 +90,9 @@ begin
|
|||||||
FFlat := True;
|
FFlat := True;
|
||||||
Height := 32;
|
Height := 32;
|
||||||
Details := ThemeServices.GetElementDetails(ttbSplitButtonDropDownNormal);
|
Details := ThemeServices.GetElementDetails(ttbSplitButtonDropDownNormal);
|
||||||
FThemeDropDownWidth := ThemeServices.GetDetailSize(Details).cx;
|
FThemeDropDownWidth := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch).cx;
|
||||||
Details := ThemeServices.GetElementDetails(ttbDropDownButtonNormal);
|
Details := ThemeServices.GetElementDetails(ttbDropDownButtonNormal);
|
||||||
FThemeButtonDropWidth := ThemeServices.GetDetailSize(Details).cx;
|
FThemeButtonDropWidth := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch).cx;
|
||||||
FButtonHeight := -1;
|
FButtonHeight := -1;
|
||||||
FButtonWidth := -1;
|
FButtonWidth := -1;
|
||||||
FDropDownWidth := -1;
|
FDropDownWidth := -1;
|
||||||
|
@ -3475,7 +3475,7 @@ begin
|
|||||||
FExpandSignSize := -1;
|
FExpandSignSize := -1;
|
||||||
FExpandSignWidth := 2;
|
FExpandSignWidth := 2;
|
||||||
Details := ThemeServices.GetElementDetails(ttGlyphOpened);
|
Details := ThemeServices.GetElementDetails(ttGlyphOpened);
|
||||||
FThemeExpandSignSize := ThemeServices.GetDetailSize(Details).cx;
|
FThemeExpandSignSize := ThemeServices.GetDetailSizeForPPI(Details, Font.PixelsPerInch).cx;
|
||||||
FTreeNodes := CreateNodes;
|
FTreeNodes := CreateNodes;
|
||||||
BorderStyle := bsSingle;
|
BorderStyle := bsSingle;
|
||||||
BorderWidth := 0;
|
BorderWidth := 0;
|
||||||
|
@ -477,7 +477,7 @@ type
|
|||||||
function GetElementDetails(Detail: TThemedTreeview): TThemedElementDetails; overload;
|
function GetElementDetails(Detail: TThemedTreeview): TThemedElementDetails; overload;
|
||||||
function GetElementDetails(Detail: TThemedWindow): TThemedElementDetails; overload;
|
function GetElementDetails(Detail: TThemedWindow): TThemedElementDetails; overload;
|
||||||
|
|
||||||
function GetDetailSize(Details: TThemedElementDetails): TSize; virtual;
|
function GetDetailSize(Details: TThemedElementDetails): TSize; virtual; deprecated 'use GetDetailSizeForPPI';
|
||||||
function GetDetailSizeForWindow(Details: TThemedElementDetails; const AWindow: HWND): TSize; virtual;
|
function GetDetailSizeForWindow(Details: TThemedElementDetails; const AWindow: HWND): TSize; virtual;
|
||||||
function GetDetailSizeForPPI(Details: TThemedElementDetails; PPI: Integer): TSize; virtual;
|
function GetDetailSizeForPPI(Details: TThemedElementDetails; PPI: Integer): TSize; virtual;
|
||||||
function GetDetailRegion(DC: HDC; Details: TThemedElementDetails; const R: TRect): HRGN; virtual;
|
function GetDetailRegion(DC: HDC; Details: TThemedElementDetails; const R: TRect): HRGN; virtual;
|
||||||
|
@ -241,7 +241,7 @@ begin
|
|||||||
else
|
else
|
||||||
Detail := tbCheckBoxUncheckedNormal;
|
Detail := tbCheckBoxUncheckedNormal;
|
||||||
Details := ThemeServices.GetElementDetails(Detail);
|
Details := ThemeServices.GetElementDetails(Detail);
|
||||||
aSize := ThemeServices.GetDetailSize(Details);
|
aSize := ThemeServices.GetDetailSizeForPPI(Details, PixelsPerInch);
|
||||||
NodeRect:=Node.DisplayRect(false);
|
NodeRect:=Node.DisplayRect(false);
|
||||||
r:=Bounds(Node.DisplayIconLeft+(ImageList1.Width-aSize.cx) div 2,
|
r:=Bounds(Node.DisplayIconLeft+(ImageList1.Width-aSize.cx) div 2,
|
||||||
NodeRect.Top+(NodeRect.Bottom-NodeRect.Top-aSize.cy) div 2,
|
NodeRect.Top+(NodeRect.Bottom-NodeRect.Top-aSize.cy) div 2,
|
||||||
@ -392,7 +392,7 @@ begin
|
|||||||
ButtonPanel1.OKButton.OnClick:=@OkButtonClick;
|
ButtonPanel1.OKButton.OnClick:=@OkButtonClick;
|
||||||
|
|
||||||
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
Details := ThemeServices.GetElementDetails(tbCheckBoxCheckedNormal);
|
||||||
aSize := ThemeServices.GetDetailSize(Details);
|
aSize := ThemeServices.GetDetailSizeForPPI(Details, PixelsPerInch);
|
||||||
ImageList1.Width:=Max(16,aSize.cx);
|
ImageList1.Width:=Max(16,aSize.cx);
|
||||||
ImageList1.Height:=Max(16,aSize.cy);
|
ImageList1.Height:=Max(16,aSize.cy);
|
||||||
// add empty images
|
// add empty images
|
||||||
|
Loading…
Reference in New Issue
Block a user