Skip to content

Commit

Permalink
Improved color settings for highlighted cell
Browse files Browse the repository at this point in the history
  • Loading branch information
wp-xyz committed Nov 10, 2024
1 parent 78b3bb5 commit f438a87
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
5 changes: 3 additions & 2 deletions source/forms/hxsettingsdlg.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ object SettingsForm: TSettingsForm
Height = 444
Top = 6
Width = 767
ActivePage = pgEditor
ActivePage = pgFormat
Align = alClient
BorderSpacing.Around = 6
TabIndex = 0
TabIndex = 1
TabOrder = 1
OnChange = PageControlChange
OnChanging = PageControlChanging
Expand Down Expand Up @@ -335,6 +335,7 @@ object SettingsForm: TSettingsForm
Top = 26
Width = 152
BorderSpacing.Left = 40
BorderSpacing.Right = 16
Caption = 'Lowercase hex characters'
TabOrder = 6
OnChange = FormatChanged
Expand Down
13 changes: 12 additions & 1 deletion source/forms/hxsettingsdlg.pas
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ TSettingsForm = class(TForm)
private
FDataTypeCheckBoxes : array[dtFirstNumericDataType..dtLastNumericDataType] of TCheckbox;
FSampleHexEditor: THxHexEditor;
FActivated: Boolean;
procedure ApplyParamsToHexEditor(const AParams: THexParams);
procedure DrawIcons(APaintbox: TPaintbox; AImages: TImageList);
procedure PrepareSampleHexEditor;
Expand Down Expand Up @@ -212,7 +213,12 @@ procedure TSettingsForm.ColorChanged(Sender: TObject);

procedure TSettingsForm.FormActivate(Sender: TObject);
begin
Constraints.MinWidth := cbHexLowerCase.left + cbHexLowercase.Width + 16 + PageControl.BorderSpacing.Around * 2;
if not FActivated then
begin
FActivated := true;
Constraints.MinWidth := cbHexLowerCase.left + cbHexLowercase.Width +
cbHexLowercase.BorderSpacing.Right + PageControl.BorderSpacing.Around * 2;
end;
end;

procedure TSettingsForm.ColorsFromControls(var AParams: TColorParams);
Expand Down Expand Up @@ -348,6 +354,10 @@ procedure TSettingsForm.PageControlChange(Sender: TObject);
gbSampleHexEditor.Parent := PageControl.ActivePage;
gbSampleHexEditor.AnchorSideLeft.Control := PageControl.ActivePage;
gbSampleHexEditor.AnchorSideRight.Control := PageControl.ActivePage;
if PageControl.ActivePage = pgColors then
gbSampleHexEditor.AnchorSideTop.Control := clbCharfieldForeground
else
gbSampleHexEditor.AnchorSideTop.Control := cmbRulerNumberBase;
end;
end;

Expand All @@ -356,6 +366,7 @@ procedure TSettingsForm.PageControlChanging(Sender: TObject;
begin
gbSampleHexEditor.AnchorSideLeft.Control := nil;
gbSampleHexEditor.AnchorSideRight.Control := nil;
gbSampleHexEditor.AnchorSideTop.Control := nil;
end;

procedure TSettingsForm.ParamsFromControls(var AParams: THexParams);
Expand Down
10 changes: 6 additions & 4 deletions source/units/hxglobal.pas
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ TColorParams = record
const // Repeating the clXXXX values to keep Graphics out of this unit
clWindow = TGraphicsColor($80000005);
clWindowText = TGraphicsColor($80000008);
clHighlight = TGraphicsColor($8000000D);
clHighlightText = TGraphicsColor($8000000E);
clBtnFace = TGraphicsColor($8000000F);
clBtnShadow = TGraphicsColor($80000010);
clBtnHighlight = TGraphicsColor($80000014);
Expand Down Expand Up @@ -270,8 +272,8 @@ TColorParams = record
ActiveFieldBackgroundColor: clWindow;
OffsetBackgroundColor: clBtnFace;
OffsetForegroundColor: clWindowText;
CurrentOffsetBackgroundColor: clBtnShadow;
CurrentOffsetForegroundColor: clBtnHighlight;
CurrentOffsetBackgroundColor: clHighlight; //BtnShadow;
CurrentOffsetForegroundColor: clHighlightText; //clBtnHighlight;
EvenColumnForegroundColor: clNavy;
OddColumnForegroundColor: clBlue;
ChangedBackgroundColor: $00A8FFFF;
Expand All @@ -282,8 +284,8 @@ TColorParams = record
ActiveFieldBackgroundColor: clWindow;
OffsetBackgroundColor: clBtnFace;
OffsetForegroundColor: clWindowText;
CurrentOffsetBackgroundColor: clBtnShadow;
CurrentOffsetForegroundColor: clBtnHighlight;
CurrentOffsetBackgroundColor: clHighlight; //clBtnShadow;
CurrentOffsetForegroundColor: clHighlightText; //clBtnHighlight;
EvenColumnForegroundColor: clOlive;
OddColumnForegroundColor: clYellow;
ChangedBackgroundColor: $00A8FFFF;
Expand Down

0 comments on commit f438a87

Please sign in to comment.