Skip to content

Commit

Permalink
Use a different color for the VSCode UpdatePanel message. Makes it be…
Browse files Browse the repository at this point in the history
…tter/clearer when it wants to show both messages. Uses blue since the VSCode logo is blue.
  • Loading branch information
martijnlaan committed Nov 20, 2024
1 parent f3eea5e commit 0abd0b3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Projects/Src/IDE.MainForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ TCallTipState = record
TUpdatePanelMessage = class
Msg, ConfigIdent: String;
ConfigValue: Integer;
constructor Create(AMsg, AConfigIdent: String; AConfigValue: Integer);
Color: TColor;
constructor Create(const AMsg, AConfigIdent: String; const AConfigValue: Integer; const AColor: TColor);
end;

TUpdatePanelMessages = TObjectList<TUpdatePanelMessage>;
Expand Down Expand Up @@ -707,12 +708,13 @@ implementation

{ TUpdatePanelMessage }

constructor TUpdatePanelMessage.Create(AMsg, AConfigIdent: String;
AConfigValue: Integer);
constructor TUpdatePanelMessage.Create(const AMsg, AConfigIdent: String;
const AConfigValue: Integer; const AColor: TColor);
begin
Msg := AMsg;
ConfigIdent := AConfigIdent;
ConfigValue := AConfigValue;
Color := AColor;
end;

{ TMainFormPopupMenu }
Expand Down Expand Up @@ -808,11 +810,11 @@ function TMainForm.InitializeNonFileMemo(const Memo: TIDEScintEdit; const PopupM
constructor TMainForm.Create(AOwner: TComponent);

procedure CheckUpdatePanelMessage(const Ini: TConfigIniFile; const ConfigIdent: String;
const ConfigValueDefault, ConfigValueMinimum: Integer; const Msg: String);
const ConfigValueDefault, ConfigValueMinimum: Integer; const Msg: String; const Color: TColor);
begin
var ConfigValue := Ini.ReadInteger('UpdatePanel', ConfigIdent, ConfigValueDefault);
if ConfigValue < ConfigValueMinimum then
FUpdatePanelMessages.Add(TUpdatePanelMessage.Create(Msg, ConfigIdent, ConfigValueMinimum));
FUpdatePanelMessages.Add(TUpdatePanelMessage.Create(Msg, ConfigIdent, ConfigValueMinimum, Color));
end;

procedure ReadConfig;
Expand Down Expand Up @@ -875,9 +877,11 @@ constructor TMainForm.Create(AOwner: TComponent);

{ UpdatePanel visibility }
CheckUpdatePanelMessage(Ini, 'KnownVersion', 0, Integer(FCompilerVersion.BinVersion),
'Your version of Inno Setup has been updated. Click <a id="hwhatsnew">here</a> to see what''s new.');
'Your version of Inno Setup has been updated. Click <a id="hwhatsnew">here</a> to see what''s new.',
$ABE3AB); //MGreen with HSL lightness changed from 40% to 78%
CheckUpdatePanelMessage(Ini, 'VSCodeMemoKeyMap', 0, 1,
'Support for Visual Studio Code-style editor shortcuts has been added. Click <a id="toptions">here</a> to open the Options dialog and change the Editor Keys option.');
'Support for Visual Studio Code-style editor shortcuts has been added. Click <a id="toptions">here</a> to open the Options dialog and change the Editor Keys option.',
$FFD399); //MBlue with HSL lightness changes from 42% to 80%
UpdateUpdatePanel;

{ Debug options }
Expand Down Expand Up @@ -978,7 +982,6 @@ constructor TMainForm.Create(AOwner: TComponent);

ToolBarPanel.ParentBackground := False;
UpdatePanel.ParentBackground := False;
UpdatePanel.Color := $ABE3AB; //MGreen with HSL lightness changed from 40% to 78%
UpdatePanelDonateImage.Hint := RemoveAccelChar(HDonate.Caption);

UpdateImages;
Expand Down Expand Up @@ -6441,6 +6444,7 @@ procedure TMainForm.UpdateUpdatePanel;
var MessageToShowIndex := FUpdatePanelMessages.Count-1;
UpdateLinkLabel.Tag := MessageToShowIndex;
UpdateLinkLabel.Caption := FUpdatePanelMessages[MessageToShowIndex].Msg;
UpdatePanel.Color := FUpdatePanelMessages[MessageToShowIndex].Color;
end;
UpdateBevel1Visibility;
end;
Expand Down

0 comments on commit 0abd0b3

Please sign in to comment.