mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Support custom colors for new same-text-background feature. Closes #224.
This commit is contained in:
@ -130,7 +130,7 @@ type
|
||||
TAppSettingDataType = (adInt, adBool, adString);
|
||||
TAppSettingIndex = (asHiddenColumns, asFilter, asSort, asDisplayedColumnsSorted, asLastSessions,
|
||||
asLastActiveSession, asAutoReconnect, asRestoreLastUsedDB, asLastUsedDB, asTreeBackground,
|
||||
asFontName, asFontSize, asTabWidth, asDataFontName, asDataFontSize, asDataLocalNumberFormat, asHintsOnResultTabs, asHightlightSameText,
|
||||
asFontName, asFontSize, asTabWidth, asDataFontName, asDataFontSize, asDataLocalNumberFormat, asHintsOnResultTabs, asHightlightSameTextBackground,
|
||||
asLogsqlnum, asLogsqlwidth, asSessionLogsDirectory, asLogHorizontalScrollbar, asSQLColActiveLine,
|
||||
asSQLColMatchingBraceForeground, asSQLColMatchingBraceBackground,
|
||||
asMaxColWidth, asDatagridMaximumRows, asDatagridRowsPerStep, asGridRowLineCount, asReuseEditorConfiguration,
|
||||
@ -3327,7 +3327,7 @@ begin
|
||||
InitSetting(asDataFontSize, 'DataFontSize', 8);
|
||||
InitSetting(asDataLocalNumberFormat, 'DataLocalNumberFormat', 0, True);
|
||||
InitSetting(asHintsOnResultTabs, 'HintsOnResultTabs', 0, True);
|
||||
InitSetting(asHightlightSameText, 'HightlightSameText', 0, True);
|
||||
InitSetting(asHightlightSameTextBackground, 'HightlightSameTextBackground', $00DDDDDD);
|
||||
InitSetting(asLogsqlnum, 'logsqlnum', 300);
|
||||
InitSetting(asLogsqlwidth, 'logsqlwidth', 2000);
|
||||
InitSetting(asSessionLogsDirectory, 'SessionLogsDirectory', 0, False, DirnameUserAppData + 'Sessionlogs\');
|
||||
|
@ -9147,7 +9147,7 @@ procedure TMainForm.AnyGridBeforeCellPaint(Sender: TBaseVirtualTree;
|
||||
var
|
||||
VT: TVirtualStringTree;
|
||||
r: TDBQuery;
|
||||
cl, clNull, clEven, clOdd: TColor;
|
||||
cl, clNull, clEven, clOdd, clSameData: TColor;
|
||||
RowNumber: PInt64;
|
||||
isEven: Boolean;
|
||||
FieldText, FocusedFieldText: String;
|
||||
@ -9190,11 +9190,12 @@ begin
|
||||
end;
|
||||
|
||||
if (Sender.FocusedNode <> nil) and (Node <> Sender.FocusedNode) and (Column = Sender.FocusedColumn) then begin
|
||||
if AppSettings.ReadBool(asHightlightSameText) then begin
|
||||
clSameData := AppSettings.ReadInt(asHightlightSameTextBackground);
|
||||
if clSameData <> clNone then begin
|
||||
FieldText := r.Col(Column);
|
||||
FocusedFieldText := VT.Text[Sender.FocusedNode, Sender.FocusedColumn];
|
||||
if CompareText(FieldText, FocusedFieldText) = 0 then begin
|
||||
TargetCanvas.Brush.Color := $00DDDDDD; //clInfoBk;
|
||||
TargetCanvas.Brush.Color := clSameData; //clInfoBk;
|
||||
TargetCanvas.FillRect(CellRect);
|
||||
end;
|
||||
end;
|
||||
|
@ -774,6 +774,13 @@ object optionsform: Toptionsform
|
||||
Height = 13
|
||||
Caption = 'Alternating row background:'
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 8
|
||||
Top = 196
|
||||
Width = 268
|
||||
Height = 13
|
||||
Caption = 'Background for fields with same text as in focused field:'
|
||||
end
|
||||
object editMaxColWidth: TEdit
|
||||
Left = 430
|
||||
Top = 8
|
||||
@ -924,34 +931,33 @@ object optionsform: Toptionsform
|
||||
end
|
||||
object chkLocalNumberFormat: TCheckBox
|
||||
Left = 8
|
||||
Top = 193
|
||||
Top = 223
|
||||
Width = 693
|
||||
Height = 17
|
||||
Anchors = [akLeft, akTop, akRight]
|
||||
Caption = 'Local number format'
|
||||
TabOrder = 14
|
||||
TabOrder = 15
|
||||
OnClick = Modified
|
||||
end
|
||||
object chkHintsOnResultTabs: TCheckBox
|
||||
Left = 8
|
||||
Top = 216
|
||||
Top = 246
|
||||
Width = 693
|
||||
Height = 17
|
||||
Anchors = [akLeft, akTop, akRight]
|
||||
Caption = 'Pop up SQL text over result tabs'
|
||||
TabOrder = 15
|
||||
OnClick = Modified
|
||||
end
|
||||
object chkHightlightSameText: TCheckBox
|
||||
Left = 8
|
||||
Top = 239
|
||||
Width = 691
|
||||
Height = 17
|
||||
Anchors = [akLeft, akTop, akRight]
|
||||
Caption = 'Hightlight fields with same text as in focused field'
|
||||
TabOrder = 16
|
||||
OnClick = Modified
|
||||
end
|
||||
object cboxRowHighlightSameText: TColorBox
|
||||
Left = 430
|
||||
Top = 193
|
||||
Width = 133
|
||||
Height = 22
|
||||
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeNone, cbCustomColor, cbPrettyNames]
|
||||
Anchors = [akTop, akRight]
|
||||
TabOrder = 14
|
||||
end
|
||||
end
|
||||
object tabDataEditors: TTabSheet
|
||||
Caption = 'Data editors'
|
||||
|
@ -139,7 +139,8 @@ type
|
||||
editQueryHistoryKeepDays: TEdit;
|
||||
updownQueryHistoryKeepDays: TUpDown;
|
||||
lblQueryHistoryKeepDays: TLabel;
|
||||
chkHightlightSameText: TCheckBox;
|
||||
Label3: TLabel;
|
||||
cboxRowHighlightSameText: TColorBox;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Modified(Sender: TObject);
|
||||
procedure Apply(Sender: TObject);
|
||||
@ -310,9 +311,9 @@ begin
|
||||
AppSettings.WriteInt(asFieldNullBackground, cboxNullBackground.Selected);
|
||||
AppSettings.WriteInt(asRowBackgroundEven, cboxRowBackgroundEven.Selected);
|
||||
AppSettings.WriteInt(asRowBackgroundOdd, cboxRowBackgroundOdd.Selected);
|
||||
AppSettings.WriteInt(asHightlightSameTextBackground, cboxRowHighlightSameText.Selected);
|
||||
AppSettings.WriteBool(asDataLocalNumberFormat, chkLocalNumberFormat.Checked);
|
||||
AppSettings.WriteBool(asHintsOnResultTabs, chkHintsOnResultTabs.Checked);
|
||||
AppSettings.WriteBool(asHightlightSameText, chkHightlightSameText.Checked);
|
||||
|
||||
// Editor Configuration
|
||||
AppSettings.WriteBool(asFieldEditorBinary, chkEditorBinary.Checked);
|
||||
@ -533,9 +534,9 @@ begin
|
||||
cboxNullBackground.Selected := AppSettings.ReadInt(asFieldNullBackground);
|
||||
cboxRowBackgroundEven.Selected := AppSettings.ReadInt(asRowBackgroundEven);
|
||||
cboxRowBackgroundOdd.Selected := AppSettings.ReadInt(asRowBackgroundOdd);
|
||||
cboxRowHighlightSameText.Selected := AppSettings.ReadInt(asHightlightSameTextBackground);
|
||||
chkLocalNumberFormat.Checked := AppSettings.ReadBool(asDataLocalNumberFormat);
|
||||
chkHintsOnResultTabs.Checked := AppSettings.ReadBool(asHintsOnResultTabs);
|
||||
chkHightlightSameText.Checked := AppSettings.ReadBool(asHightlightSameText);
|
||||
|
||||
// Editor Configuration
|
||||
chkEditorBinary.Checked := AppSettings.ReadBool(asFieldEditorBinary);
|
||||
|
Reference in New Issue
Block a user