mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 12:39:23 +02:00
TToolBar: using preferred size of TToolButton as minimum
git-svn-id: trunk@9495 -
This commit is contained in:
parent
3385779d03
commit
c3cfa80cc0
@ -411,13 +411,20 @@ var
|
||||
NewBounds: TRect;
|
||||
CurBounds: TRect;
|
||||
j: Integer;
|
||||
PreferredBtnWidth: Integer;
|
||||
PreferredBtnHeight: Integer;
|
||||
begin
|
||||
if (CurControl is TToolButton)
|
||||
and (TToolButton(CurControl).Style in [tbsButton,tbsDropDown,tbsCheck])
|
||||
and (not CurControl.AutoSize)
|
||||
then
|
||||
NewControlWidth:=ButtonWidth
|
||||
else
|
||||
then begin
|
||||
PreferredBtnWidth:=0;
|
||||
PreferredBtnHeight:=0;
|
||||
CurControl.GetPreferredSize(PreferredBtnWidth,PreferredBtnHeight);
|
||||
NewControlWidth:=PreferredBtnWidth;
|
||||
if NewControlWidth<ButtonWidth then
|
||||
NewControlWidth:=ButtonWidth;
|
||||
end else
|
||||
NewControlWidth:=CurControl.Width;
|
||||
NewBounds:=Bounds(x,y,NewControlWidth,ButtonHeight);
|
||||
repeat
|
||||
@ -485,9 +492,10 @@ begin
|
||||
if CurControl.Align=alNone then begin
|
||||
CalculatePosition;
|
||||
//DebugLn('WrapButtons ',CurControl.Name,':',CurControl.ClassName,' ',x,',',y,',',CurControl.Width,',',CurControl.Height);
|
||||
if CurControl.AutoSize then
|
||||
CurControl.SetBounds(x,y,CurControl.Width,CurControl.Height)
|
||||
else
|
||||
if CurControl.AutoSize then begin
|
||||
// center vertically
|
||||
CurControl.SetBounds(x,y,CurControl.Width,CurControl.Height);
|
||||
end else
|
||||
CurControl.SetBounds(x,y,NewControlWidth,ButtonHeight);
|
||||
inc(x,CurControl.Width);
|
||||
|
||||
|
@ -7116,6 +7116,7 @@ begin
|
||||
if Result = nil then
|
||||
Result := pango_font_description_from_string('12');
|
||||
end;
|
||||
|
||||
{$Else}
|
||||
function LoadDefaultFont: PGDKFont;
|
||||
var
|
||||
@ -7147,6 +7148,7 @@ begin
|
||||
end;
|
||||
{$EndIf}
|
||||
|
||||
{$IFDEF Gtk2}
|
||||
function GetDefaultPangoLayout: PPangoLayout;
|
||||
begin
|
||||
if DefaultPangoLayout=nil then begin
|
||||
@ -7155,6 +7157,7 @@ begin
|
||||
end;
|
||||
Result := DefaultPangoLayout;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
function GetDefaultFontName: string;
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user