Changeset 524


Ignore:
Timestamp:
Jan 8, 2024, 11:31:20 PM (10 months ago)
Author:
chronos
Message:
  • Fixed: Reset custom DPI settings in Settings dialog by clicking on Defaults button.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Settings.pas

    r521 r524  
    5252    procedure UpdateShortCutItem;
    5353    function GetLocalCustomDpiEnabled: Boolean;
     54    procedure UpdateInterface;
    5455  public
    5556    procedure LoadData;
     
    113114procedure TSettingsDlg.ButtonResetClick(Sender: TObject);
    114115begin
     116  // TODO: Better to have default values on single place
    115117  ListLanguages.ItemIndex := 0;
    116118  ButtonFullscreen.ButtonIndex := 3;
     119  ButtonCustomDpi.ButtonIndex := 2;
     120  LocalDpi := 100;
    117121  LocalGamma := 100;
    118122  ListKeyBindings.ItemIndex := -1;
     
    120124  LocalKeyBindings.ResetToDefault;
    121125  LocalKeyBindings.LoadToStrings(ListKeyBindings.Items);
     126  UpdateInterface;
    122127  Repaint;
    123128end;
     
    181186begin
    182187  ButtonCustomDpi.ButtonIndex := ButtonCustomDpi.ButtonIndex xor 1;
    183   ButtonDpiUp.Enabled := GetLocalCustomDpiEnabled;
    184   ButtonDpiDown.Enabled := GetLocalCustomDpiEnabled;
     188  UpdateInterface;
    185189end;
    186190
     
    258262  ButtonDpiUp.Visible := False;
    259263  {$ENDIF}
     264  UpdateInterface;
    260265end;
    261266
     
    321326end;
    322327
     328procedure TSettingsDlg.UpdateInterface;
     329begin
     330  ButtonDpiUp.Enabled := GetLocalCustomDpiEnabled;
     331  ButtonDpiDown.Enabled := GetLocalCustomDpiEnabled;
     332end;
     333
    323334procedure TSettingsDlg.LoadData;
    324335begin
Note: See TracChangeset for help on using the changeset viewer.