mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Issue #1906: add preference option for grayscale/color icons on inactive tabs
This commit is contained in:
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: HeidiSQL\n"
|
||||
"POT-Creation-Date: 2012-11-05 21:40\n"
|
||||
"PO-Revision-Date: 2024-02-07 07:28+0100\n"
|
||||
"PO-Revision-Date: 2024-02-10 15:35+0100\n"
|
||||
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
||||
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
|
||||
"Language: en\n"
|
||||
@ -2776,6 +2776,18 @@ msgstr "Close tab on doubleclick"
|
||||
msgid "Close tab on middleclick"
|
||||
msgstr "Close tab on middleclick"
|
||||
|
||||
msgid "Grayscale inactive tab icons"
|
||||
msgstr "Grayscale inactive tab icons"
|
||||
|
||||
msgid "Color icons on all tabs"
|
||||
msgstr "Color icons on all tabs"
|
||||
|
||||
msgid "Grayscale icons on inactive query tabs only"
|
||||
msgstr "Grayscale icons on inactive query tabs only"
|
||||
|
||||
msgid "Grayscale icons on every inactive tab"
|
||||
msgstr "Grayscale icons on every inactive tab"
|
||||
|
||||
msgid "Tabs in multiple lines"
|
||||
msgstr "Tabs in multiple lines"
|
||||
|
||||
|
@ -212,7 +212,8 @@ type
|
||||
asCopyTableData, asCopyTableRecentFilter, asServerVersion, asServerVersionFull, asLastConnect,
|
||||
asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics,
|
||||
asLastUsageStatisticCall, asWheelZoom, asDisplayBars, asMySQLBinaries, asCustomSnippetsDirectory,
|
||||
asPromptSaveFileOnTabClose, asRestoreTabs, asTabCloseOnDoubleClick, asTabCloseOnMiddleClick, asTabsInMultipleLines, asWarnUnsafeUpdates, asQueryWarningsMessage, asQueryGridLongSortRowNum,
|
||||
asPromptSaveFileOnTabClose, asRestoreTabs, asTabCloseOnDoubleClick, asTabCloseOnMiddleClick, asTabsInMultipleLines, asTabIconsGrayscaleMode,
|
||||
asWarnUnsafeUpdates, asQueryWarningsMessage, asQueryGridLongSortRowNum,
|
||||
asCompletionProposal, asCompletionProposalInterval, asCompletionProposalSearchOnMid, asCompletionProposalWidth, asCompletionProposalNbLinesInWindow, asAutoUppercase,
|
||||
asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize,
|
||||
asTheme, asIconPack, asWebSearchBaseUrl,
|
||||
@ -3829,6 +3830,7 @@ begin
|
||||
InitSetting(asTabCloseOnDoubleClick, 'TabCloseOnDoubleClick', 0, True);
|
||||
InitSetting(asTabCloseOnMiddleClick, 'TabCloseOnMiddleClick', 0, True);
|
||||
InitSetting(asTabsInMultipleLines, 'TabsInMultipleLines', 0, True);
|
||||
InitSetting(asTabIconsGrayscaleMode, 'TabIconsGrayscaleMode', 2);
|
||||
InitSetting(asWarnUnsafeUpdates, 'WarnUnsafeUpdates', 0, True);
|
||||
InitSetting(asQueryWarningsMessage, 'QueryWarningsMessage', 0, True);
|
||||
InitSetting(asQueryGridLongSortRowNum, 'QueryGridLongSortRowNum', 10000);
|
||||
|
@ -422,24 +422,34 @@ class procedure TExtForm.PageControlTabHighlight(PageControl: TPageControl);
|
||||
var
|
||||
i, CurrentImage, CountOriginals: Integer;
|
||||
Images: TVirtualImageList;
|
||||
GrayscaleMode: Integer;
|
||||
IsQueryTab, DoGrayscale: Boolean;
|
||||
begin
|
||||
// Set grayscale icon on inactive tabs
|
||||
if not (PageControl.Images is TVirtualImageList) then
|
||||
Exit;
|
||||
GrayscaleMode := AppSettings.ReadInt(asTabIconsGrayscaleMode);
|
||||
|
||||
Images := PageControl.Images as TVirtualImageList;
|
||||
CountOriginals := Images.ImageCollection.Count;
|
||||
|
||||
for i:=0 to PageControl.PageCount-1 do begin
|
||||
CurrentImage := PageControl.Pages[i].ImageIndex;
|
||||
if PageControl.ActivePageIndex = i then begin
|
||||
if CurrentImage >= CountOriginals then
|
||||
if CurrentImage >= CountOriginals then begin
|
||||
// Grayscaled => Color
|
||||
PageControl.Pages[i].ImageIndex := CurrentImage - CountOriginals;
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
if CurrentImage < CountOriginals then
|
||||
if CurrentImage < CountOriginals then begin
|
||||
// Color => Grayscaled
|
||||
IsQueryTab := (PageControl.Owner.Name = 'MainForm') and ExecRegExpr('^tabQuery\d*$', PageControl.Pages[i].Name);
|
||||
if ((GrayscaleMode = 1) and IsQueryTab) or (GrayscaleMode = 2) then
|
||||
PageControl.Pages[i].ImageIndex := CurrentImage + CountOriginals;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@ object frmPreferences: TfrmPreferences
|
||||
BorderIcons = [biSystemMenu]
|
||||
Caption = 'Preferences'
|
||||
ClientHeight = 482
|
||||
ClientWidth = 708
|
||||
ClientWidth = 712
|
||||
Color = clBtnFace
|
||||
Constraints.MinHeight = 480
|
||||
Constraints.MinWidth = 600
|
||||
@ -18,7 +18,7 @@ object frmPreferences: TfrmPreferences
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
DesignSize = (
|
||||
708
|
||||
712
|
||||
482)
|
||||
TextHeight = 14
|
||||
object pagecontrolMain: TPageControl
|
||||
@ -1431,6 +1431,19 @@ object frmPreferences: TfrmPreferences
|
||||
TabOrder = 3
|
||||
OnClick = Modified
|
||||
end
|
||||
object radioGroupTabIconsGrayscaleMode: TRadioGroup
|
||||
Left = 220
|
||||
Top = 100
|
||||
Width = 457
|
||||
Height = 101
|
||||
Caption = 'Grayscale inactive tab icons'
|
||||
Items.Strings = (
|
||||
'Color icons on all tabs'
|
||||
'Grayscale icons on inactive query tabs only'
|
||||
'Grayscale icons on every inactive tab')
|
||||
TabOrder = 4
|
||||
OnClick = Modified
|
||||
end
|
||||
end
|
||||
end
|
||||
object btnCancel: TButton
|
||||
|
@ -189,6 +189,7 @@ type
|
||||
chkTabCloseOnMiddleClick: TCheckBox;
|
||||
btnRemoveHotKey1: TButton;
|
||||
btnRemoveHotKey2: TButton;
|
||||
radioGroupTabIconsGrayscaleMode: TRadioGroup;
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure Modified(Sender: TObject);
|
||||
procedure Apply(Sender: TObject);
|
||||
@ -441,6 +442,7 @@ begin
|
||||
AppSettings.WriteBool(asRestoreTabs, chkRestoreTabs.Checked);
|
||||
AppSettings.WriteBool(asTabCloseOnDoubleClick, chkTabCloseOnDoubleClick.Checked);
|
||||
AppSettings.WriteBool(asTabCloseOnMiddleClick, chkTabCloseOnMiddleClick.Checked);
|
||||
AppSettings.WriteInt(asTabIconsGrayscaleMode, radioGroupTabIconsGrayscaleMode.ItemIndex);
|
||||
|
||||
// Set relevant properties in mainform
|
||||
MainForm.ApplyFontToGrids;
|
||||
@ -805,6 +807,7 @@ begin
|
||||
chkRestoreTabs.Checked := AppSettings.ReadBool(asRestoreTabs);
|
||||
chkTabCloseOnDoubleClick.Checked := AppSettings.ReadBool(asTabCloseOnDoubleClick);
|
||||
chkTabCloseOnMiddleClick.Checked := AppSettings.ReadBool(asTabCloseOnMiddleClick);
|
||||
radioGroupTabIconsGrayscaleMode.ItemIndex := AppSettings.ReadInt(asTabIconsGrayscaleMode);
|
||||
|
||||
// Disable global shortcuts
|
||||
MainForm.ActionList1.State := asSuspended;
|
||||
|
Reference in New Issue
Block a user