mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 13:20:18 +02:00
Qt: fixed behaviour of clientRect when we are scrollable form. issue #26200
git-svn-id: trunk@45147 -
This commit is contained in:
parent
61775433a1
commit
3549e9cf15
@ -6718,12 +6718,9 @@ end;
|
||||
function TQtMainWindow.getClientBounds: TRect;
|
||||
begin
|
||||
{$IFDEF QTSCROLLABLEFORMS}
|
||||
if Assigned(ScrollArea) and
|
||||
{forms which have parent eg.docked must always provide
|
||||
ScrollArea clientRect, while others provide such info
|
||||
only when they are mapped.}
|
||||
(testAttribute(QtWA_Mapped) or (LCLObject.Parent <> nil)) then
|
||||
Result := ScrollArea.getClientBounds
|
||||
if Assigned(ScrollArea) and not
|
||||
ScrollArea.testAttribute(QtWA_PendingResizeEvent) then
|
||||
Result := ScrollArea.getClientBounds
|
||||
else
|
||||
{$ENDIF}
|
||||
Result:=inherited getClientBounds;
|
||||
|
@ -949,7 +949,7 @@ var
|
||||
begin
|
||||
Result := False;
|
||||
if AWinControl.HandleAllocated and
|
||||
not TQtMainWindow(AWinControl.Handle).testAttribute(QtWA_Mapped) then
|
||||
TQtMainWindow(AWinControl.Handle).testAttribute(QtWA_PendingResizeEvent) then
|
||||
begin
|
||||
if Assigned(TCustomForm(AWinControl).Menu) then
|
||||
begin
|
||||
@ -957,6 +957,9 @@ begin
|
||||
if Assigned(AWin.MenuBar) then
|
||||
begin
|
||||
AWin.MenuBar.sizeHint(@ASize);
|
||||
// geometry isn't updated yet
|
||||
if ASize.cy < 10 then
|
||||
ASize.cy := 0;
|
||||
// we must use real geometry, and then exclude menubar height.
|
||||
aClientRect := AWin.getGeometry;
|
||||
OffsetRect(aClientRect, -aClientRect.Left, -aClientRect.Top);
|
||||
|
Loading…
Reference in New Issue
Block a user