Changeset 243 for trunk/UCore.pas


Ignore:
Timestamp:
Sep 21, 2018, 2:09:10 PM (6 years ago)
Author:
chronos
Message:
  • Added: Support for color themes.
  • Added: Remember dimensions for more forms.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r233 r243  
    88  Classes, SysUtils, XMLConf, FileUtil, ActnList, Controls, Dialogs, Forms,
    99  UGame, UApplicationInfo, UPersistentForm, UScaleDPI, UCoolTranslator,
    10   URegistry, ULastOpenedList, Registry, Menus, UFormClient, UPlayer,
     10  URegistry, ULastOpenedList, UTheme, Registry, Menus, UFormClient, UPlayer,
    1111  UGameServer, UGameClient, fgl, UServerList;
    1212
     
    4242    SaveDialog1: TSaveDialog;
    4343    ScaleDPI1: TScaleDPI;
     44    ThemeManager1: TThemeManager;
    4445    XMLConfig1: TXMLConfig;
    4546    procedure AAboutExecute(Sender: TObject);
     
    185186  XMLConfig1.Filename := GetAppConfigDir(False) + 'Config.xml';
    186187
     188  ThemeManager1.Theme := ThemeManager1.Themes.FindByName(String(XmlConfig1.GetValue('Theme', 'System')));
    187189  LastOpenedList1.LoadFromXMLConfig(XMLConfig1, 'RecentFiles');
    188190  DevelMode := XMLConfig1.GetValue('DevelMode', false);
     
    199201begin
    200202  XMLConfig1.SetValue('Language', WideString(CoolTranslator1.Language.Code));
     203  XMLConfig1.SetValue('Theme', WideString(ThemeManager1.Theme.Name));
    201204  LastOpenedList1.SaveToXMLConfig(XMLConfig1, 'RecentFiles');
    202205  XMLConfig1.SetValue('DevelMode', DevelMode);
     
    376379      Server.SaveConfig(XMLConfig1, 'Server');
    377380      XMLConfig1.Flush;
     381      ThemeManager1.UseTheme(FormMain);
    378382    end;
    379383  finally
Note: See TracChangeset for help on using the changeset viewer.