- Timestamp:
- Nov 3, 2019, 12:18:14 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormComputer.pas
r38 r50 217 217 begin 218 218 Core.Translator1.TranslateComponentRecursive(Self); 219 Core.ThemeManager1.UseTheme(Self); 219 220 GameTries1 := TGameTries.Create; 220 221 GameTries2 := TGameTries.Create; -
trunk/Forms/UFormHelp.pas
r29 r50 45 45 begin 46 46 Core.Translator1.TranslateComponentRecursive(Self); 47 Core.ThemeManager1.UseTheme(Self); 47 48 end; 48 49 -
trunk/Forms/UFormHistory.pas
r36 r50 78 78 begin 79 79 Core.Translator1.TranslateComponentRecursive(Self); 80 Core.ThemeManager1.UseTheme(Self); 80 81 Game := TGame.Create; 81 82 end; -
trunk/Forms/UFormMain.pas
r46 r50 98 98 Core.PersistentForm1.RegistryContext := Core.ApplicationInfo1.GetRegistryContext; 99 99 Core.PersistentForm1.Load(Self); 100 Core.ThemeManager1.UseTheme(Self); 100 101 UpdateInterface; 101 102 if Core.Game.Board.GetEmptyTilesCount > Core.Game.Board.Size.X * Core.Game.Board.Size.Y - -
trunk/Forms/UFormNew.pas
r49 r50 49 49 begin 50 50 Core.Translator1.TranslateComponentRecursive(Self); 51 Core.ThemeManager1.UseTheme(Self); 51 52 ComboBoxSkin.Items.Clear; 52 53 for I := Low(SkinText) to High(SkinText) do -
trunk/Forms/UFormSettings.lfm
r33 r50 11 11 OnCreate = FormCreate 12 12 OnShow = FormShow 13 LCLVersion = '2.0. 2.0'13 LCLVersion = '2.0.4.0' 14 14 object Label1: TLabel 15 15 Left = 19 16 Height = 2 616 Height = 25 17 17 Top = 24 18 Width = 1 7218 Width = 158 19 19 Caption = 'Animation duration:' 20 20 ParentColor = False … … 52 52 object ComboBoxLanguage: TComboBox 53 53 Left = 208 54 Height = 4254 Height = 33 55 55 Top = 86 56 56 Width = 230 57 ItemHeight = 057 ItemHeight = 25 58 58 Style = csDropDownList 59 59 TabOrder = 3 … … 61 61 object Label2: TLabel 62 62 Left = 19 63 Height = 2 663 Height = 25 64 64 Top = 94 65 Width = 8 865 Width = 81 66 66 Caption = 'Language:' 67 67 ParentColor = False 68 68 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 69 86 end -
trunk/Forms/UFormSettings.lrj
r19 r50 4 4 {"hash":1339,"name":"tformsettings.buttonok.caption","sourcebytes":[79,75],"value":"OK"}, 5 5 {"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:"} 7 8 ]} -
trunk/Forms/UFormSettings.pas
r36 r50 7 7 uses 8 8 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, 9 ULanguages ;9 ULanguages, UTheme; 10 10 11 11 type … … 17 17 ButtonCancel: TButton; 18 18 ComboBoxLanguage: TComboBox; 19 ComboBoxTheme: TComboBox; 19 20 Label1: TLabel; 20 21 Label2: TLabel; 22 Label3: TLabel; 21 23 TrackBar1: TTrackBar; 22 24 procedure ButtonCancelClick(Sender: TObject); … … 62 64 Core.Translator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]); 63 65 end; 66 if ComboBoxTheme.ItemIndex <> -1 then 67 Core.ThemeManager1.Theme := TTheme(ComboBoxTheme.Items.Objects[ComboBoxTheme.ItemIndex]); 64 68 ModalResult := mrOk; 65 69 end; … … 75 79 Core.Translator1.TranslateComponentRecursive(Self); 76 80 Core.Translator1.LanguageListToStrings(ComboBoxLanguage.Items); 81 Core.ThemeManager1.UseTheme(Self); 82 Core.ThemeManager1.Themes.LoadToStrings(ComboBoxTheme.Items); 77 83 end; 78 84 … … 83 89 ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.Translator1.Language); 84 90 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; 85 93 end; 86 94 -
trunk/Languages/Game2048.cs.po
r49 r50 170 170 msgstr "Jazyk:" 171 171 172 #: tformsettings.label3.caption 173 msgid "Theme:" 174 msgstr "Téma:" 175 172 176 #: ucore.sgameovercaption 173 177 msgctxt "ucore.sgameovercaption" -
trunk/Languages/Game2048.po
r49 r50 160 160 msgstr "" 161 161 162 #: tformsettings.label3.caption 163 msgid "Theme:" 164 msgstr "" 165 162 166 #: ucore.sgameovercaption 163 167 msgctxt "ucore.sgameovercaption" -
trunk/UCore.lfm
r49 r50 37 37 object Translator1: TTranslator 38 38 POFilesFolder = 'Languages' 39 OnTranslate = Translator1Translate40 39 left = 336 41 40 top = 295 -
trunk/UCore.pas
r49 r50 90 90 try 91 91 if FormSettings.ShowModal = mrOk then begin 92 FormMain.Redraw; 92 93 FormMain.UpdateInterface; 93 94 UpdateInterface; … … 214 215 Translator1.Language := Translator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', '')) 215 216 else Translator1.Language := Translator1.Languages.SearchByCode(''); 217 ThemeManager1.Theme := ThemeManager1.Themes.FindByName(ReadStringWithDefault('Theme', 'System')); 216 218 finally 217 219 Free; … … 229 231 WriteString('LanguageCode', Translator1.Language.Code) 230 232 else DeleteValue('LanguageCode'); 233 WriteString('Theme', ThemeManager1.Theme.Name); 231 234 finally 232 235 Free; -
trunk/UGame.pas
r49 r50 130 130 UndoEnabled: Boolean; 131 131 History: THistory; 132 BackgroundColor: TColor; 132 133 function CanUndo: Boolean; 133 134 procedure Undo; … … 182 183 implementation 183 184 185 uses 186 UCore; 187 184 188 procedure Translate; 185 189 begin … … 593 597 TileMargin := Round(CanvasSize.X / Board.Size.X * 0.015); 594 598 Canvas.Brush.Style := bsSolid; 595 Canvas.Brush.Color := clBlack;599 Canvas.Brush.Color := Core.ThemeManager1.Theme.ColorControl; 596 600 Canvas.FillRect(0, 0, Canvas.Width, Canvas.Height); 597 601 598 602 ValueStr := SScore + ': ' + IntToStr(Score); 599 Canvas.Font.Color := clWhite;603 Canvas.Font.Color := Core.ThemeManager1.Theme.ColorControlText; 600 604 Canvas.Font.Height := Trunc(TopBarHeight * 0.7); 601 605 Canvas.TextOut(ScaleY(16, 96), (TopBarHeight - Canvas.TextHeight(ValueStr)) div 2, ValueStr); 602 606 603 607 ValueStr := STopScore + ': ' + IntToStr(TopScore); 604 Canvas.Font.Color := clWhite;608 Canvas.Font.Color := Core.ThemeManager1.Theme.ColorControlText; 605 609 Canvas.Font.Height := Trunc(TopBarHeight * 0.7); 606 610 Canvas.TextOut(ScaleY(136, 96), (TopBarHeight - Canvas.TextHeight(ValueStr)) div 2, ValueStr); … … 1030 1034 function TGame.GetTileColor(Value: Integer): TColor; 1031 1035 begin 1032 case Value of 1033 0: Result := $f2f6f9; 1034 1: Result := $dae4ee; 1035 2: Result := $c8e0ed; 1036 3: Result := $79b1f2; 1037 4: Result := $6395f5; 1038 5: Result := $5f7cf6; 1039 6: Result := $3b5ef6; 1040 7: Result := $72cfed; 1041 8: Result := $61cced; 1042 9: Result := $50c8ed; 1043 10: Result := $3fc5ed; 1044 11: Result := $2ec2ed; 1045 else Result := $323a3c; 1036 if Core.ThemeManager1.Theme.Name = 'Dark' then begin 1037 case Value of 1038 0: Result := $222629; 1039 1: Result := $dae4ee; 1040 2: Result := $c8e0ed; 1041 3: Result := $79b1f2; 1042 4: Result := $6395f5; 1043 5: Result := $5f7cf6; 1044 6: Result := $3b5ef6; 1045 7: Result := $72cfed; 1046 8: Result := $61cced; 1047 9: Result := $50c8ed; 1048 10: Result := $3fc5ed; 1049 11: Result := $2ec2ed; 1050 else Result := $323a3c; 1051 end; 1052 end else begin 1053 case Value of 1054 0: Result := $f2f6f9; 1055 1: Result := $dae4ee; 1056 2: Result := $c8e0ed; 1057 3: Result := $79b1f2; 1058 4: Result := $6395f5; 1059 5: Result := $5f7cf6; 1060 6: Result := $3b5ef6; 1061 7: Result := $72cfed; 1062 8: Result := $61cced; 1063 9: Result := $50c8ed; 1064 10: Result := $3fc5ed; 1065 11: Result := $2ec2ed; 1066 else Result := $323a3c; 1067 end; 1046 1068 end; 1047 1069 end;
Note:
See TracChangeset
for help on using the changeset viewer.