Changeset 15 for trunk/UCore.pas


Ignore:
Timestamp:
Feb 27, 2018, 6:11:44 PM (7 years ago)
Author:
chronos
Message:
  • Added: Partial support for color theming.
  • Added: Allow to edit contact properties in the list of all.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r14 r15  
    88  Classes, SysUtils, FileUtil, Controls, ActnList, Forms, Dialogs,
    99  ULastOpenedList, UApplicationInfo, UPersistentForm, UScaleDPI, UCommon,
    10   UCoolTranslator, UDataFile, Menus, URegistry, Registry;
     10  UCoolTranslator, UDataFile, Menus, URegistry, UTheme, Registry;
    1111
    1212type
     
    4545    SaveDialog1: TSaveDialog;
    4646    ScaleDPI1: TScaleDPI;
     47    ThemeManager1: TThemeManager;
    4748    procedure AAboutExecute(Sender: TObject);
    4849    procedure AExitExecute(Sender: TObject);
     
    179180  try
    180181    FormSettings.LoadData;
    181     if FormSettings.ShowModal = mrOK then
     182    if FormSettings.ShowModal = mrOK then begin
    182183      FormSettings.SaveData;
     184      ThemeManager1.UseTheme(FormMain);
     185      ThemeManager1.UseTheme(FormContacts);
     186    end;
    183187  finally
    184188    FormSettings.Free;
     
    308312  NewContact: TContact;
    309313  I: Integer;
    310   CountNew: Integer;
    311   CountUpdated: Integer;
    312314begin
    313315  Result.Clear;
     
    368370      CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', ''))
    369371      else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('');
     372    if ValueExists('Theme') then
     373      ThemeManager1.Theme := ThemeManager1.Themes.FindByName(ReadStringWithDefault('Theme', 'System'))
     374      else ThemeManager1.Theme := ThemeManager1.Themes.FindByName('System');
    370375    FormMain.MenuItemToolbar.Checked := ReadBoolWithDefault('ToolBarVisible', True);
    371376    ReopenLastFileOnStart := ReadBoolWithDefault('ReopenLastFileOnStart', True);
     
    386391      WriteString('LanguageCode', CoolTranslator1.Language.Code)
    387392      else DeleteValue('LanguageCode');
     393    if Assigned(ThemeManager1.Theme) and (ThemeManager1.Theme.Name <> '') then
     394      WriteString('Theme', ThemeManager1.Theme.Name)
     395      else DeleteValue('Theme');
    388396    WriteBool('ToolBarVisible', FormMain.MenuItemToolbar.Checked);
    389397    WriteBool('ReopenLastFileOnStart', ReopenLastFileOnStart);
Note: See TracChangeset for help on using the changeset viewer.