Changeset 50 for trunk/Forms


Ignore:
Timestamp:
Nov 3, 2019, 12:18:14 PM (5 years ago)
Author:
chronos
Message:
  • Added: Support for dark theme.
Location:
trunk/Forms
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormComputer.pas

    r38 r50  
    217217begin
    218218  Core.Translator1.TranslateComponentRecursive(Self);
     219  Core.ThemeManager1.UseTheme(Self);
    219220  GameTries1 := TGameTries.Create;
    220221  GameTries2 := TGameTries.Create;
  • trunk/Forms/UFormHelp.pas

    r29 r50  
    4545begin
    4646  Core.Translator1.TranslateComponentRecursive(Self);
     47  Core.ThemeManager1.UseTheme(Self);
    4748end;
    4849
  • trunk/Forms/UFormHistory.pas

    r36 r50  
    7878begin
    7979  Core.Translator1.TranslateComponentRecursive(Self);
     80  Core.ThemeManager1.UseTheme(Self);
    8081  Game := TGame.Create;
    8182end;
  • trunk/Forms/UFormMain.pas

    r46 r50  
    9898  Core.PersistentForm1.RegistryContext := Core.ApplicationInfo1.GetRegistryContext;
    9999  Core.PersistentForm1.Load(Self);
     100  Core.ThemeManager1.UseTheme(Self);
    100101  UpdateInterface;
    101102  if Core.Game.Board.GetEmptyTilesCount > Core.Game.Board.Size.X * Core.Game.Board.Size.Y -
  • trunk/Forms/UFormNew.pas

    r49 r50  
    4949begin
    5050  Core.Translator1.TranslateComponentRecursive(Self);
     51  Core.ThemeManager1.UseTheme(Self);
    5152  ComboBoxSkin.Items.Clear;
    5253  for I := Low(SkinText) to High(SkinText) do
  • trunk/Forms/UFormSettings.lfm

    r33 r50  
    1111  OnCreate = FormCreate
    1212  OnShow = FormShow
    13   LCLVersion = '2.0.2.0'
     13  LCLVersion = '2.0.4.0'
    1414  object Label1: TLabel
    1515    Left = 19
    16     Height = 26
     16    Height = 25
    1717    Top = 24
    18     Width = 172
     18    Width = 158
    1919    Caption = 'Animation duration:'
    2020    ParentColor = False
     
    5252  object ComboBoxLanguage: TComboBox
    5353    Left = 208
    54     Height = 42
     54    Height = 33
    5555    Top = 86
    5656    Width = 230
    57     ItemHeight = 0
     57    ItemHeight = 25
    5858    Style = csDropDownList
    5959    TabOrder = 3
     
    6161  object Label2: TLabel
    6262    Left = 19
    63     Height = 26
     63    Height = 25
    6464    Top = 94
    65     Width = 88
     65    Width = 81
    6666    Caption = 'Language:'
    6767    ParentColor = False
    6868  end
     69  object ComboBoxTheme: TComboBox
     70    Left = 208
     71    Height = 33
     72    Top = 136
     73    Width = 230
     74    ItemHeight = 25
     75    Style = csDropDownList
     76    TabOrder = 4
     77  end
     78  object Label3: TLabel
     79    Left = 19
     80    Height = 25
     81    Top = 144
     82    Width = 57
     83    Caption = 'Theme:'
     84    ParentColor = False
     85  end
    6986end
  • trunk/Forms/UFormSettings.lrj

    r19 r50  
    44{"hash":1339,"name":"tformsettings.buttonok.caption","sourcebytes":[79,75],"value":"OK"},
    55{"hash":77089212,"name":"tformsettings.buttoncancel.caption","sourcebytes":[67,97,110,99,101,108],"value":"Cancel"},
    6 {"hash":82521866,"name":"tformsettings.label2.caption","sourcebytes":[76,97,110,103,117,97,103,101,58],"value":"Language:"}
     6{"hash":82521866,"name":"tformsettings.label2.caption","sourcebytes":[76,97,110,103,117,97,103,101,58],"value":"Language:"},
     7{"hash":95339402,"name":"tformsettings.label3.caption","sourcebytes":[84,104,101,109,101,58],"value":"Theme:"}
    78]}
  • 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.