Changeset 115 for trunk/Packages


Ignore:
Timestamp:
Feb 15, 2022, 3:46:22 PM (3 years ago)
Author:
chronos
Message:
  • Added: New tool action View source to show source code for loaded contacts. Source text can be edited and saved back. The editor shows line numbers and use color highlighting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/UTheme.pas

    r69 r115  
    4141    property Theme: TTheme read FTheme write SetTheme;
    4242  end;
     43
     44const
     45  ThemeNameSystem = 'System';
     46  ThemeNameLight = 'Light';
     47  ThemeNameDark = 'Dark';
    4348
    4449procedure Register;
     
    105110  inherited;
    106111  Themes := TThemes.Create;
    107   with Themes.AddNew('System') do begin
     112  with Themes.AddNew(ThemeNameSystem) do begin
    108113    ColorWindow := clWindow;
    109114    ColorWindowText := clWindowText;
     
    113118  end;
    114119  Theme := TTheme(Themes.First);
    115   with Themes.AddNew('Dark') do begin
     120  with Themes.AddNew(ThemeNameDark) do begin
    116121    ColorWindow := RGBToColor($20, $20, $20);
    117122    ColorWindowText := clWhite;
     
    120125    ColorControlSelected := RGBToColor(96, 125, 155);
    121126  end;
    122   with Themes.AddNew('Light') do begin
     127  with Themes.AddNew(ThemeNameLight) do begin
    123128    ColorWindow := clWhite;
    124129    ColorWindowText := clBlack;
     
    175180procedure TThemeManager.UseTheme(Form: TForm);
    176181begin
    177   if not Used and (FTheme.Name = 'System') then Exit;
     182  if not Used and (FTheme.Name = ThemeNameSystem) then Exit;
    178183  ApplyTheme(Form);
    179184  Used := True;
Note: See TracChangeset for help on using the changeset viewer.