mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 16:00:16 +02:00
Merge branch 'opm-fix-colors' into 'main'
opm: fix readability of hint window on dark themes, remove hardcoded colors... See merge request freepascal.org/lazarus/lazarus!13
This commit is contained in:
commit
256ef8de78
@ -57,10 +57,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TColorsFrm.HelpButtonClick(Sender: TObject);
|
procedure TColorsFrm.HelpButtonClick(Sender: TObject);
|
||||||
|
var
|
||||||
|
CL: TStringList;
|
||||||
begin
|
begin
|
||||||
shName.Brush.Color := $00D9FFFF;
|
CL := TStringList.Create;
|
||||||
shDescription.Brush.Color := $00E6FFE6;
|
Options.GetDefaultColors(CL);
|
||||||
shLicense.Brush.Color := $00FEEBD3;
|
shName.Brush.Color := StringToColor(CL.Strings[0]);
|
||||||
|
shDescription.Brush.Color := StringToColor(CL.Strings[1]);
|
||||||
|
shLicense.Brush.Color := StringToColor(CL.Strings[2]);
|
||||||
|
CL.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TColorsFrm.shNameMouseUp(Sender: TObject; Button: TMouseButton;
|
procedure TColorsFrm.shNameMouseUp(Sender: TObject; Button: TMouseButton;
|
||||||
@ -72,18 +77,11 @@ end;
|
|||||||
|
|
||||||
procedure TColorsFrm.LoadColors(AColList: TStringList);
|
procedure TColorsFrm.LoadColors(AColList: TStringList);
|
||||||
begin
|
begin
|
||||||
if AColList.Count = HintColCnt then
|
if AColList.Count <> HintColCnt then
|
||||||
begin
|
Options.GetDefaultColors(AColList);
|
||||||
shName.Brush.Color := StringToColor(AColList.Strings[0]);
|
shName.Brush.Color := StringToColor(AColList.Strings[0]);
|
||||||
shDescription.Brush.Color := StringToColor(AColList.Strings[1]);
|
shDescription.Brush.Color := StringToColor(AColList.Strings[1]);
|
||||||
shLicense.Brush.Color := StringToColor(AColList.Strings[2]);
|
shLicense.Brush.Color := StringToColor(AColList.Strings[2]);
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
shName.Brush.Color := clDefault;
|
|
||||||
shDescription.Brush.Color := clDefault;
|
|
||||||
shLicense.Brush.Color := clDefault;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -27,7 +27,7 @@ unit opkman_options;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Graphics,
|
Classes, SysUtils, Graphics, GraphUtil,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
Laz2_XMLCfg, LazFileUtils,
|
Laz2_XMLCfg, LazFileUtils,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
@ -89,6 +89,7 @@ type
|
|||||||
FExcludedFolders: String;
|
FExcludedFolders: String;
|
||||||
FOpenSSLDownloadType: Integer;
|
FOpenSSLDownloadType: Integer;
|
||||||
procedure CheckColors;
|
procedure CheckColors;
|
||||||
|
function IsDarkTheme: Boolean;
|
||||||
function GetLocalRepositoryArchiveExpanded:string;
|
function GetLocalRepositoryArchiveExpanded:string;
|
||||||
function GetLocalRepositoryPackagesExpanded:string;
|
function GetLocalRepositoryPackagesExpanded:string;
|
||||||
function GetLocalRepositoryUpdateExpanded:string;
|
function GetLocalRepositoryUpdateExpanded:string;
|
||||||
@ -99,6 +100,7 @@ type
|
|||||||
procedure Save;
|
procedure Save;
|
||||||
procedure LoadDefault;
|
procedure LoadDefault;
|
||||||
procedure CreateMissingPaths;
|
procedure CreateMissingPaths;
|
||||||
|
procedure GetDefaultColors(AColorList: TStringList);
|
||||||
property LocalRepositoryPackagesExpanded:string read GetLocalRepositoryPackagesExpanded;
|
property LocalRepositoryPackagesExpanded:string read GetLocalRepositoryPackagesExpanded;
|
||||||
property LocalRepositoryArchiveExpanded:string read GetLocalRepositoryArchiveExpanded;
|
property LocalRepositoryArchiveExpanded:string read GetLocalRepositoryArchiveExpanded;
|
||||||
property LocalRepositoryUpdateExpanded:string read GetLocalRepositoryUpdateExpanded;
|
property LocalRepositoryUpdateExpanded:string read GetLocalRepositoryUpdateExpanded;
|
||||||
@ -331,15 +333,24 @@ begin
|
|||||||
CreateDir(LocalRepositoryUpdateExpanded);
|
CreateDir(LocalRepositoryUpdateExpanded);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TOptions.GetDefaultColors(AColorList: TStringList);
|
||||||
|
begin
|
||||||
|
AColorList.Clear;
|
||||||
|
if IsDarkTheme then
|
||||||
|
AColorList.AddStrings(['$00004646', '$002e4c35', '$00584327'])
|
||||||
|
else
|
||||||
|
AColorList.AddStrings(['$00D9FFFF', '$00E6FFE6', '$00FEEBD3']);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TOptions.CheckColors;
|
procedure TOptions.CheckColors;
|
||||||
begin
|
begin
|
||||||
if FHintFormOptionColors.Count <> HintColCnt then
|
if FHintFormOptionColors.Count <> HintColCnt then
|
||||||
begin
|
GetDefaultColors(FHintFormOptionColors);
|
||||||
FHintFormOptionColors.Clear;
|
end;
|
||||||
FHintFormOptionColors.Add(ColorToString($00D9FFFF));
|
|
||||||
FHintFormOptionColors.Add(ColorToString($00E6FFE6));
|
function TOptions.IsDarkTheme: Boolean;
|
||||||
FHintFormOptionColors.Add(ColorToString($00FEEBD3));
|
begin
|
||||||
end
|
Result := ColorToGray(clWindowText) > ColorToGray(clWindow);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TOptions.GetLocalRepositoryArchiveExpanded:string;
|
function TOptions.GetLocalRepositoryArchiveExpanded:string;
|
||||||
|
@ -22,20 +22,15 @@ object ShowHintFrm: TShowHintFrm
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = Owner
|
AnchorSideBottom.Control = Owner
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 10
|
Left = 0
|
||||||
Height = 305
|
Height = 325
|
||||||
Top = 10
|
Top = 0
|
||||||
Width = 543
|
Width = 563
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Left = 10
|
|
||||||
BorderSpacing.Top = 10
|
|
||||||
BorderSpacing.Right = 10
|
|
||||||
BorderSpacing.Bottom = 10
|
|
||||||
BevelInner = bvLowered
|
BevelInner = bvLowered
|
||||||
ClientHeight = 305
|
ClientHeight = 325
|
||||||
ClientWidth = 543
|
ClientWidth = 563
|
||||||
Color = 15460842
|
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object pnPackageName: TPanel
|
object pnPackageName: TPanel
|
||||||
@ -45,25 +40,23 @@ object ShowHintFrm: TShowHintFrm
|
|||||||
Left = 12
|
Left = 12
|
||||||
Height = 22
|
Height = 22
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 519
|
Width = 539
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BorderSpacing.Left = 10
|
BorderSpacing.Left = 10
|
||||||
BorderSpacing.Right = 10
|
BorderSpacing.Right = 10
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
Caption = 'Package Name'
|
Caption = 'Package Name'
|
||||||
Font.Style = [fsBold]
|
|
||||||
ParentFont = False
|
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object pnDescription: TPanel
|
object pnDescription: TPanel
|
||||||
Left = 2
|
Left = 2
|
||||||
Height = 57
|
Height = 57
|
||||||
Top = 24
|
Top = 24
|
||||||
Width = 539
|
Width = 559
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 57
|
ClientHeight = 57
|
||||||
ClientWidth = 539
|
ClientWidth = 559
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object mDescription: TMemo
|
object mDescription: TMemo
|
||||||
@ -76,25 +69,17 @@ object ShowHintFrm: TShowHintFrm
|
|||||||
Left = 10
|
Left = 10
|
||||||
Height = 53
|
Height = 53
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 519
|
Width = 539
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Left = 10
|
BorderSpacing.Left = 10
|
||||||
BorderSpacing.Top = 2
|
BorderSpacing.Top = 2
|
||||||
BorderSpacing.Right = 10
|
BorderSpacing.Right = 10
|
||||||
BorderSpacing.Bottom = 2
|
BorderSpacing.Bottom = 2
|
||||||
BorderStyle = bsNone
|
BorderStyle = bsNone
|
||||||
Color = 15460842
|
|
||||||
Font.CharSet = ANSI_CHARSET
|
|
||||||
Font.Color = clBlack
|
|
||||||
Font.Height = -12
|
|
||||||
Font.Name = 'Segoe UI'
|
|
||||||
Font.Pitch = fpVariable
|
|
||||||
Font.Quality = fqDraft
|
|
||||||
Lines.Strings = (
|
Lines.Strings = (
|
||||||
'aaaaaaaaaa'
|
'aaaaaaaaaa'
|
||||||
'bbbbbbbb'
|
'bbbbbbbb'
|
||||||
)
|
)
|
||||||
ParentFont = False
|
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
@ -108,9 +93,9 @@ object ShowHintFrm: TShowHintFrm
|
|||||||
AnchorSideBottom.Control = pnMain
|
AnchorSideBottom.Control = pnMain
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 12
|
Left = 12
|
||||||
Height = 218
|
Height = 238
|
||||||
Top = 83
|
Top = 83
|
||||||
Width = 519
|
Width = 539
|
||||||
HorzScrollBar.Page = 1
|
HorzScrollBar.Page = 1
|
||||||
VertScrollBar.Page = 1
|
VertScrollBar.Page = 1
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
@ -126,7 +111,7 @@ object ShowHintFrm: TShowHintFrm
|
|||||||
object tmWait: TTimer
|
object tmWait: TTimer
|
||||||
Enabled = False
|
Enabled = False
|
||||||
OnTimer = tmWaitTimer
|
OnTimer = tmWaitTimer
|
||||||
left = 40
|
Left = 40
|
||||||
top = 160
|
Top = 160
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user