mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-02 02:16:20 +02:00
cocoa: use the same way to get mertrics as for carbon since HiTheme is still supported on 64bit osx and is the only way to query theme metrics
git-svn-id: trunk@38928 -
This commit is contained in:
parent
8035a82e6f
commit
68ef99b929
@ -29,7 +29,7 @@ interface
|
||||
{.$I cocoadefines.inc}
|
||||
|
||||
uses
|
||||
// MacOSAll,
|
||||
MacOSAll,
|
||||
Classes, SysUtils, Types, LCLType, LCLProc, LCLClasses, LMessages,
|
||||
Controls, Forms, Graphics, Math, GraphType;
|
||||
|
||||
@ -68,9 +68,8 @@ function FontStyleToQDStyle(const AStyle: TFontStyles): MacOSAll.Style;
|
||||
function QDStyleToFontStyle(QDStyle: Integer): TFontStyles;}
|
||||
|
||||
procedure FillStandardDescription(out Desc: TRawImageDescription);
|
||||
|
||||
{function GetCarbonThemeMetric(Metric: ThemeMetric; DefaultValue: Integer = 0): Integer;
|
||||
|
||||
function GetHiThemeMetric(Metric: ThemeMetric; DefaultValue: Integer = 0): Integer;
|
||||
{
|
||||
function CreateCustomHIView(const ARect: HIRect; ControlStyle: TControlStyle = []): HIViewRef;
|
||||
|
||||
procedure SetControlViewStyle(Control: ControlRef; TinySize, SmallSize, NormalSize: Integer; ControlHeight: Boolean = True);
|
||||
@ -618,19 +617,19 @@ begin
|
||||
Desc.MaskLineEnd := rileByteBoundary;
|
||||
Desc.MaskShift := 0;
|
||||
end;
|
||||
(*
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Name: GetCarbonThemeMetric
|
||||
Name: GetHiThemeMetric
|
||||
Params: Metric - Theme metric
|
||||
DefaultValue
|
||||
Returns: Theme metric value or default value if fails
|
||||
------------------------------------------------------------------------------}
|
||||
function GetCarbonThemeMetric(Metric: ThemeMetric; DefaultValue: Integer): Integer;
|
||||
function GetHiThemeMetric(Metric: ThemeMetric; DefaultValue: Integer): Integer;
|
||||
begin
|
||||
if OSError(GetThemeMetric(Metric, Result),
|
||||
'GetCarbonThemeMetric', 'GetThemeMetric') then Result := DefaultValue;
|
||||
if GetThemeMetric(Metric, Result) <> noErr then
|
||||
Result := DefaultValue;
|
||||
end;
|
||||
|
||||
(*
|
||||
{------------------------------------------------------------------------------
|
||||
Name: CreateCustomHIView
|
||||
Params: ARect - Bounds rect
|
||||
|
@ -1745,11 +1745,11 @@ begin
|
||||
{$ENDIF}
|
||||
|
||||
case NIndex of
|
||||
{ SM_CXHSCROLL,
|
||||
SM_CXHSCROLL,
|
||||
SM_CYHSCROLL,
|
||||
SM_CXVSCROLL,
|
||||
SM_CYVSCROLL:
|
||||
Result := 10;//GetCarbonThemeMetric(kThemeMetricScrollBarWidth);}
|
||||
Result := GetHiThemeMetric(kThemeMetricScrollBarWidth);
|
||||
SM_CXSCREEN,
|
||||
SM_CXVIRTUALSCREEN: Result := Round(NSScreen.mainScreen.frame.size.width);
|
||||
SM_CYSCREEN,
|
||||
@ -1769,12 +1769,12 @@ begin
|
||||
Result := 64 else}
|
||||
Result := 16;
|
||||
end;
|
||||
{ SM_CXHTHUMB:
|
||||
Result := 16;//GetCarbonThemeMetric(kThemeMetricScrollBarMinThumbWidth);
|
||||
SM_CXHTHUMB:
|
||||
Result := GetHiThemeMetric(kThemeMetricScrollBarMinThumbWidth);
|
||||
SM_CYVTHUMB:
|
||||
Result := 16;//GetCarbonThemeMetric(kThemeMetricScrollBarMinThumbHeight);}
|
||||
Result := GetHiThemeMetric(kThemeMetricScrollBarMinThumbHeight);
|
||||
SM_SWSCROLLBARSPACING:
|
||||
Result:=0;
|
||||
Result := 0;
|
||||
else
|
||||
DebugLn('TCocoaWidgetSet.GetSystemMetrics TODO ', DbgS(NIndex));;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user