mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Implement per session background color selection for database tree. rfe #896.
This commit is contained in:
@@ -49,6 +49,7 @@ const
|
||||
REGNAME_RESTORELASTUSEDDB = 'RestoreLastUsedDB';
|
||||
DEFAULT_RESTORELASTUSEDDB = True;
|
||||
REGNAME_LASTUSEDDB = 'lastUsedDB';
|
||||
REGNAME_TREEBACKGROUND = 'TreeBackground';
|
||||
REGNAME_FONTNAME = 'FontName';
|
||||
DEFAULT_FONTNAME = 'Courier New';
|
||||
REGNAME_FONTSIZE = 'FontSize';
|
||||
|
||||
BIN
res/icons/color_swatch.png
Normal file
BIN
res/icons/color_swatch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 209 B |
@@ -1265,6 +1265,9 @@ object MDIChild: TMDIChild
|
||||
Caption = 'Display size of objects'
|
||||
OnClick = menuShowSizeColumnClick
|
||||
end
|
||||
object Selectbackgroundcolor1: TMenuItem
|
||||
Action = MainForm.actSelectTreeBackground
|
||||
end
|
||||
object menuRefreshDBTree: TMenuItem
|
||||
Caption = 'Refresh'
|
||||
ImageIndex = 0
|
||||
|
||||
@@ -266,6 +266,7 @@ type
|
||||
menuViewDefault: TMenuItem;
|
||||
CopygriddataasSQL1: TMenuItem;
|
||||
CopygriddataasSQL2: TMenuItem;
|
||||
Selectbackgroundcolor1: TMenuItem;
|
||||
procedure menuRenameColumnClick(Sender: TObject);
|
||||
procedure ListColumnsNewText(Sender: TBaseVirtualTree; Node: PVirtualNode;
|
||||
Column: TColumnIndex; NewText: WideString);
|
||||
@@ -918,6 +919,7 @@ begin
|
||||
pnlQueryMemo.Height := Mainform.GetRegValue(REGNAME_QUERYMEMOHEIGHT, pnlQueryMemo.Height);
|
||||
pnlQueryHelpers.Width := Mainform.GetRegValue(REGNAME_QUERYHELPERSWIDTH, pnlQueryHelpers.Width);
|
||||
DBtree.Width := Mainform.GetRegValue(REGNAME_DBTREEWIDTH, DBtree.Width);
|
||||
DBTree.Color := Mainform.GetRegValue(REGNAME_TREEBACKGROUND, clWindow, FConn.Description);
|
||||
SynMemoSQLLog.Height := Mainform.GetRegValue(REGNAME_SQLOUTHEIGHT, SynMemoSQLLog.Height);
|
||||
prefMaxColWidth := Mainform.GetRegValue(REGNAME_MAXCOLWIDTH, DEFAULT_MAXCOLWIDTH);
|
||||
// Fix registry entry from older versions which can have 0 here which makes no sense
|
||||
|
||||
@@ -379,6 +379,9 @@ object MainForm: TMainForm
|
||||
object N1: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object actSelectTreeBackground1: TMenuItem
|
||||
Action = actSelectTreeBackground
|
||||
end
|
||||
object ExportSettings1: TMenuItem
|
||||
Action = actExportSettings
|
||||
end
|
||||
@@ -1184,6 +1187,13 @@ object MainForm: TMainForm
|
||||
ImageIndex = 26
|
||||
OnExecute = actRemoveFilterExecute
|
||||
end
|
||||
object actSelectTreeBackground: TAction
|
||||
Category = 'File'
|
||||
Caption = 'Select session background color ...'
|
||||
Hint = 'Lets you chose a per session color value for the database tree'
|
||||
ImageIndex = 115
|
||||
OnExecute = actSelectTreeBackgroundExecute
|
||||
end
|
||||
end
|
||||
object SaveDialog2: TSaveDialog
|
||||
DefaultExt = 'reg'
|
||||
@@ -4476,6 +4486,18 @@ object MainForm: TMainForm
|
||||
A30000000049454E44AE426082}
|
||||
Name = 'PngImage114'
|
||||
Background = clWindow
|
||||
end
|
||||
item
|
||||
PngImage.Data = {
|
||||
89504E470D0A1A0A0000000D49484452000000100000001008060000001FF3FF
|
||||
610000001974455874536F6674776172650041646F626520496D616765526561
|
||||
647971C9653C000000784944415478DA63FCFFFF3F032580916A06FCCFCF869B
|
||||
C438712A23C3AA6284C961BD8C1FAFA5C3F9FC5A331907A1011487C1C5379BE0
|
||||
26E98BF831069CCD85F337184F664CD8F006CE5F1020C238080DA0380C22AA36
|
||||
C04D5AD116C0786BF63D385F2D558991A17C23C2A64E7FC6416800C561306006
|
||||
0000763095E15A4C85FC0000000049454E44AE426082}
|
||||
Name = 'PngImage115'
|
||||
Background = clWindow
|
||||
end>
|
||||
PngOptions = [pngBlendOnDisabled, pngGrayscaleOnDisabled]
|
||||
Left = 8
|
||||
|
||||
@@ -299,6 +299,7 @@ type
|
||||
procedure ReplaceDialogQueryFind(Sender: TObject);
|
||||
procedure ReplaceDialogQueryReplace(Sender: TObject);
|
||||
procedure actCopyAsSQLExecute(Sender: TObject);
|
||||
procedure actSelectTreeBackgroundExecute(Sender: TObject);
|
||||
private
|
||||
FDelimiter: String;
|
||||
function GetChildwin: TMDIChild;
|
||||
@@ -2279,4 +2280,20 @@ begin
|
||||
Childwin.DataGridCancel(Sender);
|
||||
end;
|
||||
|
||||
|
||||
procedure TMainForm.actSelectTreeBackgroundExecute(Sender: TObject);
|
||||
var
|
||||
cs: TColorSelect;
|
||||
begin
|
||||
// Select database tree background color
|
||||
cs := TColorSelect.Create(Self);
|
||||
cs.Dialog.Color := Childwin.DBtree.Color;
|
||||
if cs.Execute then begin
|
||||
Childwin.DBtree.Color := cs.Dialog.Color;
|
||||
OpenRegistry(Childwin.SessionName);
|
||||
regmain.WriteInteger(REGNAME_TREEBACKGROUND, cs.Dialog.Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user