Qt: fixed behaviour of clientRect when we are scrollable form. issue #26200

git-svn-id: trunk@45147 -
This commit is contained in:
zeljko 2014-05-22 10:20:16 +00:00
parent 61775433a1
commit 3549e9cf15
2 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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);