Ignore:
Timestamp:
May 22, 2018, 9:43:29 AM (6 years ago)
Author:
chronos
Message:
  • Fixed: Keep correctly main form dimensions in non-maximized state. Scaling DPI was affecting its size and position.
  • Added: Remember last opened tab in New game form.
File:
1 edited

Legend:

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

    r192 r207  
    1919    FMinVisiblePart: Integer;
    2020    FRegistryContext: TRegistryContext;
     21    FirstLoad: Boolean;
    2122    procedure LoadControl(Control: TControl);
    2223    procedure SaveControl(Control: TControl);
     
    119120    RootKey := RegistryContext.RootKey;
    120121    OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True);
     122    FirstLoad := not ValueExists('WindowState');
    121123    // Normal size
    122124    FormNormalSize.Left := ReadIntegerWithDefault('NormalLeft', FormNormalSize.Left);
     
    227229
    228230  if not EqualRect(FormNormalSize, FormRestoredSize) or
    229     DefaultMaximized then begin
     231    (DefaultMaximized and FirstLoad) then begin
    230232    // Restore to maximized state
    231233    Form.WindowState := wsNormal;
     
    263265  FMinVisiblePart := 50;
    264266  FRegistryContext.RootKey := HKEY_CURRENT_USER;
     267  FirstLoad := False;
    265268end;
    266269
Note: See TracChangeset for help on using the changeset viewer.