Merge branch 'gtk2/mainbar' into 'main'

Gtk2: fixed height of ide mainbar

See merge request freepascal.org/lazarus/lazarus!138
This commit is contained in:
Željan Rikalo 2023-02-18 17:27:24 +00:00
commit 1d9dfb7574
2 changed files with 8 additions and 4 deletions

View File

@ -511,7 +511,7 @@ begin
end;
function TMainIDEBar.CalcNonClientHeight: Integer;
{$IF DEFINED(LCLGtk) OR DEFINED(LCLGtk2) OR DEFINED(LCLQt) OR DEFINED(LCLQt6)}
{$IF DEFINED(LCLGtk) OR DEFINED(LCLQt) OR DEFINED(LCLQt6)}
var
WindowRect, WindowClientRect: TRect;
{$ENDIF}
@ -532,10 +532,10 @@ begin
if not Showing then
Exit(0);
{$IF DEFINED(LCLGtk) OR DEFINED(LCLGtk2) OR DEFINED(LCLQt) OR DEFINED(LCLQt6)}
//Gtk2 + Qt
{$IF DEFINED(LCLGtk) OR DEFINED(LCLQt) OR DEFINED(LCLQt6)}
//Gtk + Qt
//retrieve real main menu height because
// - Gtk2, Qt: SM_CYMENU does not work
// - Gtk, Qt: SM_CYMENU does not work
LclIntf.GetWindowRect(Handle, WindowRect{%H-});
LclIntf.GetClientRect(Handle, WindowClientRect{%H-});
LclIntf.ClientToScreen(Handle, WindowClientRect.TopLeft);
@ -547,7 +547,10 @@ begin
{$ELSE}
//other widgetsets
//Carbon tested - behaves correctly
//Cocoa tested - behaves correctly
//Win32 tested - behaves correctly
//Gtk2 tested - behaves correctly
//Qt5 tested - behaves correctly
Result := 0;
{$ENDIF}
end;

View File

@ -6689,6 +6689,7 @@ begin
WidthHeightChanged:= true;
end;
if WidthHeightChanged then begin
SetWindowSizeAndPosition(PGtkWindow(MainWidget), LCLControl);
SetResizeRequest(MainWidget);
SetWidgetConstraints(LCLControl);
end;