Changeset 174 for trunk/UCore.pas


Ignore:
Timestamp:
Feb 14, 2018, 10:39:55 AM (7 years ago)
Author:
chronos
Message:
  • Added: Basic color theming support. Colors can be changed only for some controls.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r151 r174  
    88  Classes, SysUtils, FileUtil, UAcronym, UCoolTranslator, UPersistentForm,
    99  UJobProgressView, UScaleDPI, Forms, Controls, ExtCtrls, Menus, LazFileUtils,
    10   URegistry, UApplicationInfo, Registry;
     10  URegistry, UApplicationInfo, Registry, UTheme;
    1111
    1212type
     
    4747    InitializeStarted: Boolean;
    4848    InitializeFinished: Boolean;
     49    ThemeManager: TThemeManager;
    4950    procedure Initialize;
    5051    procedure LoadConfig;
     
    7879  InitializeFinished := False;
    7980  StoredDimension := TControlDimension.Create;
     81  ThemeManager := TThemeManager.Create(nil);
    8082end;
    8183
    8284procedure TCore.DataModuleDestroy(Sender: TObject);
    8385begin
     86  FreeAndNil(ThemeManager);
    8487  FreeAndNil(StoredDimension);
    8588  FreeAndNil(AcronymDb);
     
    178181    StartMinimizedToTray := ReadBoolWithDefault('StartMinimizedToTray', False);
    179182    ReopenLastFileOnStart := ReadBoolWithDefault('ReopenLastFileOnStart', True);
     183    ThemeManager.Theme := ThemeManager.Themes.FindByName(ReadStringWithDefault('Theme', 'System'));
    180184  finally
    181185    Free;
     
    200204    WriteBool('StartMinimizedToTray', StartMinimizedToTray);
    201205    WriteBool('ReopenLastFileOnStart', ReopenLastFileOnStart);
     206    WriteString('Theme', ThemeManager.Theme.Name);
    202207  finally
    203208    Free;
Note: See TracChangeset for help on using the changeset viewer.