Ignore:
Timestamp:
Nov 3, 2019, 12:18:14 PM (5 years ago)
Author:
chronos
Message:
  • Added: Support for dark theme.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormSettings.pas

    r36 r50  
    77uses
    88  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
    9   ULanguages;
     9  ULanguages, UTheme;
    1010
    1111type
     
    1717    ButtonCancel: TButton;
    1818    ComboBoxLanguage: TComboBox;
     19    ComboBoxTheme: TComboBox;
    1920    Label1: TLabel;
    2021    Label2: TLabel;
     22    Label3: TLabel;
    2123    TrackBar1: TTrackBar;
    2224    procedure ButtonCancelClick(Sender: TObject);
     
    6264    Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
    6365  end;
     66  if ComboBoxTheme.ItemIndex <> -1 then
     67    Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]);
    6468  ModalResult := mrOk;
    6569end;
     
    7579  Core.Translator1.TranslateComponentRecursive(Self);
    7680  Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items);
     81  Core.ThemeManager1.UseTheme(Self);
     82  Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items);
    7783end;
    7884
     
    8389  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator1.Language);
    8490  if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
     91  ComboBoxTheme.ItemIndex := ComboBoxTheme.Items.IndexOfObject(Core.ThemeManager1.Theme);
     92  if ComboBoxTheme.ItemIndex = -1 then ComboBoxTheme.ItemIndex := 0;
    8593end;
    8694
Note: See TracChangeset for help on using the changeset viewer.