Changeset 69 for trunk/Packages/Common


Ignore:
Timestamp:
Nov 28, 2020, 12:35:06 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Restore from fulscreen mode to maximized state not retaining normal state dimensions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UPersistentForm.pas

    r68 r69  
    314314  if State then begin
    315315    FormFullScreen := True;
     316    FormNormalSize := Form.BoundsRect;
    316317    FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
    317318      Form.RestoredHeight);
     319    FormWindowState := Form.WindowState;
    318320    ShowWindow(Form.Handle, SW_SHOWFULLSCREEN);
    319321    {$IFDEF WINDOWS}
     
    322324  end else begin
    323325    FormFullScreen := False;
    324     if Form.WindowState = wsNormal then begin
    325       ShowWindow(Form.Handle, SW_SHOWNORMAL);
    326       //Form.BoundsRect := FormRestoredSize;
    327     end else if Form.WindowState = wsMaximized then ShowWindow(Form.Handle, SW_SHOWMAXIMIZED);
    328326    {$IFDEF WINDOWS}
    329327    Form.BorderStyle := bsSizeable;
    330328    {$ENDIF}
     329    ShowWindow(Form.Handle, SW_SHOWNORMAL);
     330    if FormWindowState = wsNormal then begin
     331      Form.BoundsRect := FormNormalSize;
     332    end else
     333    if FormWindowState = wsMaximized then begin
     334      Form.BoundsRect := FormRestoredSize;
     335      Form.WindowState := wsMaximized;
     336    end;
    331337  end;
    332338end;
Note: See TracChangeset for help on using the changeset viewer.