⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uthemes.pas

📁 siMail, siMail, siMail, siMail
💻 PAS
📖 第 1 页 / 共 2 页
字号:

destructor TToolbar.Destroy;
begin
  FreeAndNil(FLarge);
  FreeAndNil(FNormal);
  FreeAndNil(FSmall);

  inherited Destroy;
end;

{ TCompose }

procedure TCompose.Assign(Source: TPersistent);
var b: TCompose;
begin
  inherited Assign(Source);
  b := Source as TCompose;
  Self.Toolbar.Assign(b.Toolbar);
end;

constructor TCompose.Create;
begin
  inherited Create;

  FToolbar := TToolbar.Create;
end;

destructor TCompose.Destroy;
begin
  FreeAndNil(FToolbar);

  inherited Destroy;
end;

{ TMailboxFolders }

procedure TMailboxFolders.Assign(Source: TPersistent);
var b: TMailboxFolders;
begin
  inherited Assign(Source);
  b := Source as TMailboxFolders;
  Self.Background := b.Background;
  Self.Icons := b.Icons;
end;


{ TMailList }

procedure TMailList.Assign(Source: TPersistent);
var b: TMailList;
begin
  inherited Assign(Source);
  b := Source as TMailList;
  Self.Background := b.Background;
  Self.ColumnIcons := b.ColumnIcons;
  Self.Icons := b.Icons;
end;

{ TMain }

procedure TMain.Assign(Source: TPersistent);
var b: TMain;
begin
  inherited Assign(Source);
  b := Source as TMain;
  Self.Toolbar.Assign(b.Toolbar);
end;

constructor TMain.Create;
begin
  inherited Create;

  FToolbar := TToolbar.Create;
end;

destructor TMain.Destroy;
begin
  FreeAndNil(FToolbar);

  inherited Destroy;
end;

{ TServerMailboxView }

procedure TServerMailboxView.Assign(Source: TPersistent);
var b: TServerMailboxView;
begin
  inherited Assign(Source);
  b := Source as TServerMailboxView;
  Self.Background := b.Background;
  Self.Icons := b.Icons;
end;

{ TTasks }

procedure TTasks.Assign(Source: TPersistent);
var b: TTasks;
begin
  inherited Assign(Source);
  b := Source as TTasks;
  Self.Background := b.Background;
  Self.Icons := b.Icons;
  Self.Progress.Assign(b.Progress);
end;

constructor TTasks.Create;
begin
  inherited Create;

  FProgress := TProgress.Create;
end;

destructor TTasks.Destroy;
begin
  FreeAndNil(FProgress);
  
  inherited Destroy;
end;

{ TMyColor }

procedure TMyColor.Assign(Source: TPersistent);
var b: TMyColor;
begin
  inherited Assign(Source);
  b := Source as TMyColor;
  Self.StartColor := b.StartColor;
  Self.EndColor := b.EndColor;
end;

function TMyColor.GetEndColor: TColor;
begin
  Result := HTML2Color(EndColor);
end;

function TMyColor.GetStartColor: TColor;
begin
  Result := HTML2Color(StartColor);
end;


function HTML2Color(Color: String): TColor;
begin

  while Length(Color) <> 6 do begin
    Color := Color + '0';
  end;

  //from RGB to BGR
  Color := RightStr(Color, 2) + MidStr(Color, 3, 2) + LeftStr(Color, 2);
  Color := '$' + Color;

  Result := StrToInt(Color);
end;

{ TMyFont }

procedure TMyFont.Assign(Source: TPersistent);
var b: TMyFont;
begin
  inherited Assign(Source);
  b := Source as TMyFont;
  Self.Color := b.Color;
  Self.Name := b.Name;
  Self.Size := b.Size;
  Self.Style := b.Style;
end;

procedure TMyFont.GetFont(var Font: TFont);
begin
  Font.Charset := DEFAULT_CHARSET;
  Font.Color := HTML2Color(Color);
  Font.Name := Name;
  Font.Pitch := fpDefault;
  Font.Size := Size;
  Font.Style := Style;
end;

{ TProgress }

procedure TProgress.Assign(Source: TPersistent);
var b: TProgress;
begin
  inherited Assign(Source);
  b := Source as TProgress;
  Self.Color := b.Color;
  Self.Font := b.Font;
end;

constructor TProgress.Create;
begin
  inherited Create;

  FColor := TMyColor.Create;
  FFont := TMyFont.Create;
end;

destructor TProgress.Destroy;
begin
  FreeAndNil(FColor);
  FreeAndNil(FFont);

  inherited Destroy;
end;

{ TTheme }

procedure TTheme.Assign(Source: TPersistent);
var b: TTheme;
begin
  inherited Assign(Source);
  b := Source as TTheme;
  Self.AddressBook.Assign(b.AddressBook);
  Self.Compose.Assign(b.Compose);
  Self.Info.Assign(b.Info);
  Self.MailboxFolders.Assign(b.MailboxFolders);
  Self.MailList.Assign(b.MailList);
  Self.Main.Assign(b.Main);
  Self.Settings.Assign(b.Settings);
  Self.ServerMailboxView.Assign(b.ServerMailboxView);
  Self.Tasks.Assign(b.Tasks);
  Self.Toolbar.Assign(b.Toolbar);
  Self.Lists.Assign(b.Lists);
end;

constructor TTheme.Create;
begin
  inherited Create;

  FAddressBook := TAddressBook.Create;
  FCompose := TCompose.Create;
  FInfo := TInfo.Create;
  FMailboxFolders := TMailboxFolders.Create;
  FMailList := TMailList.Create;
  FMain := TMain.Create;
  FSettings := TProgress.Create;
  FServerMailboxView := TServerMailboxView.Create;
  FTasks := TTasks.Create;
  FToolbar := TRootToolbar.Create;
  FLists := TLists.Create;
end;

destructor TTheme.Destroy;
begin
  FreeAndNil(FAddressBook);
  FreeAndNil(FCompose);
  FreeAndNil(FInfo);
  FreeAndNil(FMailboxFolders);
  FreeAndNil(FMailList);
  FreeAndNil(FMain);
  FreeAndNil(FSettings);
  FreeAndNil(FServerMailboxView);
  FreeAndNil(FTasks);
  FreeAndNil(FToolbar);
  FreeAndNil(FLists);
  inherited Destroy;
end;

procedure TTheme.Load(FileName: String);
begin
  if FileExists(FileName) then
    TOmniMyXMLReader.LoadFromFile(Self, FileName, False);

  FThemePath := ExtractFilePath(FileName);
end;

procedure TTheme.Load(config: TStream);
begin

end;

{ TThemeList }

function TThemeList.Add(ThemePath: String; var Index: Integer): TTheme;
var t: TTheme;
begin
  t := TTheme.Create;
  Index := inherited Add(t);
  t.Load(ThemePath + 'theme.xml');
  Result := t;
end;

function TThemeList.Extract(Item: TTheme): TTheme;
begin
  Result := inherited Extract(Item) as TTheme;
end;

function TThemeList.First: TTheme;
begin
  Result := inherited First as TTheme;
end;

function TThemeList.GetItem(Index: Integer): TTheme;
begin
  Result := inherited GetItem(Index) as TTheme;
end;

function TThemeList.IndexOf(ATheme: TTheme): Integer;
begin
  Result := inherited IndexOf(ATheme);
end;

procedure TThemeList.Insert(Index: Integer; ATheme: TTheme);
begin
  inherited Insert(Index, ATheme);
end;

function TThemeList.Last: TTheme;
begin
  Result := inherited Last as TTheme;
end;

function TThemeList.Remove(ATheme: TTheme): Integer;
begin
  Result := inherited Remove(ATheme);
end;

procedure TThemeList.SetItem(Index: Integer; const Value: TTheme);
begin
  inherited SetItem(Index, Value);
end;

{ TRootToolbar }

procedure TRootToolbar.Assign(Source: TPersistent);
var b: TRootToolbar;
begin
  inherited Assign(Source);
  b := Source as TRootToolbar;
  Self.UseColor := b.UseColor;
  Self.Background.Assign(b.Background);
  Self.Color := b.Color;
  Self.SmallSize := b.SmallSize;
  Self.NormalSize := b.NormalSize;
  Self.LargeSize := b.LargeSize;
end;

constructor TRootToolbar.Create;
begin
  inherited Create;

  FBackground := TToolbar.Create;
end;

destructor TRootToolbar.Destroy;
begin
  FreeAndNil(FBackground);

  inherited Destroy;
end;

function TRootToolbar.GetColor: TColor;
begin
  Result := HTML2Color(Color);
end;

{ TLists }

procedure TLists.Assign(Source: TPersistent);
var b: TLists;
begin
  inherited Assign(Source);
  b := Source as TLists;
  Self.Font.Assign(b.Font);
end;

constructor TLists.Create;
begin
  inherited Create;

  FFont := TMyFont.Create;
end;

destructor TLists.Destroy;
begin
  FreeAndNil(FFont);

  inherited Destroy;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -