mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 01:17:29 +01:00
carbon: change preferred size for groupbox and custompanel to return size excluding clientarea. bug #16337
git-svn-id: trunk@26295 -
This commit is contained in:
parent
5ec928bb45
commit
3962bb560c
@ -266,6 +266,7 @@ type
|
||||
procedure CreateWidget(const AParams: TCreateParams); override;
|
||||
procedure DestroyWidget; override;
|
||||
function GetContent: ControlRef; override;
|
||||
function GetPreferredSize: TPoint; override;
|
||||
public
|
||||
function GetClientRect(var ARect: TRect): Boolean; override;
|
||||
function SetBounds(const ARect: TRect): Boolean; override;
|
||||
@ -1227,6 +1228,18 @@ begin
|
||||
Result := FUserPane;
|
||||
end;
|
||||
|
||||
function TCarbonGroupBox.GetPreferredSize:TPoint;
|
||||
var
|
||||
ContentRect: TRect;
|
||||
begin
|
||||
Result:=inherited;
|
||||
if GetClientRect(ContentRect) then
|
||||
begin
|
||||
Dec(Result.X, ContentRect.Right - ContentRect.Left);
|
||||
Dec(Result.Y, ContentRect.Bottom - ContentRect.Top);
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCarbonGroupBox.GetClientRect
|
||||
Params: ARect - Record for client area coordinates
|
||||
|
||||
@ -167,6 +167,7 @@ type
|
||||
|
||||
TCarbonWSCustomPanel = class(TWSCustomPanel)
|
||||
published
|
||||
class procedure GetPreferredSize(const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); override;
|
||||
end;
|
||||
|
||||
{ TCarbonWSPanel }
|
||||
@ -352,6 +353,23 @@ begin
|
||||
TCarbonTabsControl(ANotebook.Handle).ShowTabs(AShowTabs);
|
||||
end;
|
||||
|
||||
{ TCarbonWSCustomPanel }
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCarbonWSCustomNotebook.ShowTabs
|
||||
Params: ANotebook - LCL custom notebook
|
||||
AShowTabs - Tabs visibility
|
||||
|
||||
TCustomPanel should return preferred size (0,0)
|
||||
bugs #16337, and Mattias in comment 0036957 of #16323
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TCarbonWSCustomPanel.GetPreferredSize(const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean);
|
||||
begin
|
||||
PreferredWidth:=0;
|
||||
PreferredHeight:=0;
|
||||
end;
|
||||
|
||||
|
||||
{$include carbontrayicon.inc}
|
||||
|
||||
end.
|
||||
|
||||
@ -375,7 +375,8 @@ end;
|
||||
|
||||
function RegisterCustomPanel: Boolean; alias : 'WSRegisterCustomPanel';
|
||||
begin
|
||||
Result := False;
|
||||
RegisterWSComponent(TCustomPanel, TCarbonWSCustomPanel);
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
function RegisterCustomTrayIcon: Boolean; alias : 'WSRegisterCustomTrayIcon';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user