Permalink
Browse files

Add a checkbox option for disabling zoom per mousewheel. Closes #229.

  • Loading branch information...
ansgarbecker committed Apr 15, 2018
1 parent 26e16b1 commit d69b5711ccc2f907d52e5b445d6d781a613e2766
Showing with 60 additions and 41 deletions.
  1. +4 −1 out/locale/en/LC_MESSAGES/default.po
  2. +2 −1 source/apphelpers.pas
  3. +12 −10 source/main.pas
  4. +39 −29 source/options.dfm
  5. +3 −0 source/options.pas
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: HeidiSQL\n"
"POT-Creation-Date: 2012-11-05 21:40\n"
"PO-Revision-Date: 2018-04-12 19:33+0200\n"
"PO-Revision-Date: 2018-04-15 14:45+0200\n"
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/language/en/)\n"
"MIME-Version: 1.0\n"
@@ -2605,6 +2605,9 @@ msgstr ""
"Count in usage statistics. This option, if enabled, will cause HeidiSQL to ping heidisql.com at most once every "
"month. This is used to count the used HeidiSQL and MySQL versions."
msgid "Use Ctrl+Mousewheel for zooming"
msgstr "Use Ctrl+Mousewheel for zooming"
#. optionsform..pagecontrolMain..tabMisc..chkAllowMultiInstances..Caption
#: options.dfm:141
msgid "Allow multiple application instances"
@@ -166,7 +166,7 @@ TQueryThread = class(TThread)
asCopyTableWindowHeight, asCopyTableWindowWidth, asCopyTableColumns, asCopyTableKeys, asCopyTableForeignKeys,
asCopyTableData, asCopyTableRecentFilter, asServerVersion, asServerVersionFull, asLastConnect,
asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics,
asLastUsageStatisticCall, asDisplayBars, asBarColor, asMySQLBinaries, asCustomSnippetsDirectory,
asLastUsageStatisticCall, asWheelZoom, asDisplayBars, asBarColor, asMySQLBinaries, asCustomSnippetsDirectory,
asPromptSaveFileOnTabClose, asWarnUnsafeUpdates,
asCompletionProposal, asCompletionProposalWidth, asCompletionProposalNbLinesInWindow,
asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize,
@@ -3489,6 +3489,7 @@ constructor TAppSettings.Create;
InitSetting(asSessionCreated, 'SessionCreated', 0, False, '', True);
InitSetting(asDoUsageStatistics, 'DoUsageStatistics', 0, False);
InitSetting(asLastUsageStatisticCall, 'LastUsageStatisticCall', 0, False, '2000-01-01');
InitSetting(asWheelZoom, 'WheelZoom', 0, True);
InitSetting(asDisplayBars, 'DisplayBars', 0, true);
InitSetting(asBarColor, 'BarColor', $00BBFFDD);
InitSetting(asMySQLBinaries, 'MySQL_Binaries', 0, False, '');
@@ -6202,7 +6202,7 @@ procedure TMainForm.SynMemoQueryMouseWheel(Sender: TObject; Shift: TShiftState;
NewFontSize: Integer;
begin
// Change font size with MouseWheel
if KeyPressed(VK_CONTROL) then begin
if KeyPressed(VK_CONTROL) and AppSettings.ReadBool(asWheelZoom) then begin
Editor := TSynEdit(Sender);
NewFontSize := Editor.Font.Size;
if WheelDelta > 0 then
@@ -8792,15 +8792,17 @@ procedure TMainForm.AnyGridMouseWheel(Sender: TObject; Shift: TShiftState; Wheel
end;
end else if KeyPressed(VK_CONTROL) then begin
// Change font size with MouseWheel
NewFontSize := VT.Font.Size;
if WheelDelta > 0 then
Inc(NewFontSize)
else
Dec(NewFontSize);
NewFontSize := Max(NewFontSize, 1);
AppSettings.ResetPath;
AppSettings.WriteInt(asDataFontSize, NewFontSize);
ApplyFontToGrids;
if AppSettings.ReadBool(asWheelZoom) then begin
NewFontSize := VT.Font.Size;
if WheelDelta > 0 then
Inc(NewFontSize)
else
Dec(NewFontSize);
NewFontSize := Max(NewFontSize, 1);
AppSettings.ResetPath;
AppSettings.WriteInt(asDataFontSize, NewFontSize);
ApplyFontToGrids;
end;
end else if ssShift in Shift then begin
// Horizontal scrolling with Alt+Mousewheel
VT.OffsetX := VT.OffsetX + WheelDelta;
@@ -40,35 +40,35 @@ object optionsform: Toptionsform
349)
object lblMySQLBinaries: TLabel
Left = 8
Top = 219
Top = 228
Width = 152
Height = 13
Caption = 'MySQL command line programs:'
end
object lblLanguage: TLabel
Left = 8
Top = 273
Top = 282
Width = 189
Height = 13
Caption = 'Application language (requires restart):'
end
object lblCustomSnippetsDirectory: TLabel
Left = 8
Top = 246
Top = 255
Width = 129
Height = 13
Caption = 'Custom snippets directory:'
end
object lblGUIFont: TLabel
Left = 8
Top = 300
Top = 309
Width = 131
Height = 13
Caption = 'GUI font (requires restart):'
end
object lblGUIFontSize: TLabel
Left = 694
Top = 300
Top = 309
Width = 10
Height = 13
Anchors = [akTop, akRight]
@@ -77,7 +77,7 @@ object optionsform: Toptionsform
object chkAutoReconnect: TCheckBox
Left = 8
Top = 31
Width = 677
Width = 699
Height = 17
Anchors = [akLeft, akTop, akRight]
Caption = 'Automatically reconnect to previously opened sessions on startup'
@@ -86,8 +86,8 @@ object optionsform: Toptionsform
end
object chkRestoreLastDB: TCheckBox
Left = 8
Top = 55
Width = 677
Top = 54
Width = 699
Height = 17
Anchors = [akLeft, akTop, akRight]
Caption = 'Restore last used database on startup'
@@ -136,7 +136,7 @@ object optionsform: Toptionsform
object chkUpdateCheckBuilds: TCheckBox
Left = 26
Top = 111
Width = 659
Width = 681
Height = 17
Anchors = [akLeft, akTop, akRight]
Caption = 'Also check for updated nightly builds'
@@ -147,8 +147,8 @@ object optionsform: Toptionsform
object chkDoStatistics: TCheckBox
Left = 8
Top = 134
Width = 685
Height = 48
Width = 699
Height = 34
Anchors = [akLeft, akTop, akRight]
Caption =
'Count in usage statistics. This option, if enabled, will cause H' +
@@ -161,7 +161,7 @@ object optionsform: Toptionsform
object chkAllowMultiInstances: TCheckBox
Left = 8
Top = 8
Width = 677
Width = 699
Height = 17
Anchors = [akLeft, akTop, akRight]
Caption = 'Allow multiple application instances'
@@ -171,33 +171,33 @@ object optionsform: Toptionsform
end
object chkColorBars: TCheckBox
Left = 8
Top = 190
Width = 310
Top = 199
Width = 258
Height = 17
Caption = 'Display bars in various list columns'
TabOrder = 8
TabOrder = 9
OnClick = chkColorBarsClick
end
object cboxColorBars: TColorBox
Left = 272
Top = 188
Top = 197
Width = 435
Height = 22
Style = [cbStandardColors, cbExtendedColors, cbCustomColor, cbPrettyNames, cbCustomColors]
Anchors = [akLeft, akTop, akRight]
TabOrder = 9
TabOrder = 10
OnClick = Modified
end
object editMySQLBinaries: TButtonedEdit
Left = 272
Top = 216
Top = 225
Width = 435
Height = 21
Anchors = [akLeft, akTop, akRight]
Images = MainForm.ImageListMain
RightButton.ImageIndex = 51
RightButton.Visible = True
TabOrder = 10
TabOrder = 11
Text = 'editMySQLBinaries'
TextHint = 'Find mysql.exe directory'
OnChange = Modified
@@ -206,24 +206,24 @@ object optionsform: Toptionsform
end
object comboAppLanguage: TComboBox
Left = 272
Top = 270
Top = 279
Width = 435
Height = 21
Style = csDropDownList
Anchors = [akLeft, akTop, akRight]
TabOrder = 12
TabOrder = 13
OnClick = Modified
end
object editCustomSnippetsDirectory: TButtonedEdit
Left = 272
Top = 243
Top = 252
Width = 435
Height = 21
Anchors = [akLeft, akTop, akRight]
Images = MainForm.ImageListMain
RightButton.ImageIndex = 51
RightButton.Visible = True
TabOrder = 11
TabOrder = 12
Text = 'editCustomSnippetsDirectory'
TextHint = 'Set custom directory for SQL snippet files'
OnChange = Modified
@@ -232,36 +232,46 @@ object optionsform: Toptionsform
end
object comboGUIFont: TComboBox
Left = 272
Top = 297
Top = 306
Width = 334
Height = 21
Style = csDropDownList
Anchors = [akLeft, akTop, akRight]
TabOrder = 13
TabOrder = 14
OnChange = comboGUIFontChange
end
object editGUIFontSize: TEdit
Left = 612
Top = 297
Top = 306
Width = 57
Height = 21
Anchors = [akTop, akRight]
TabOrder = 14
TabOrder = 15
Text = '8'
OnChange = Modified
end
object updownGUIFontSize: TUpDown
Left = 669
Top = 297
Top = 306
Width = 16
Height = 21
Anchors = [akTop, akRight]
Associate = editGUIFontSize
Min = 4
Position = 8
TabOrder = 15
TabOrder = 16
OnChanging = anyUpDownLimitChanging
end
object chkWheelZoom: TCheckBox
Left = 8
Top = 174
Width = 699
Height = 17
Anchors = [akLeft, akTop, akRight]
Caption = 'Use Ctrl+Mousewheel for zooming'
TabOrder = 8
OnClick = Modified
end
end
object tabLogging: TTabSheet
Caption = 'Logging'
@@ -141,6 +141,7 @@ Toptionsform = class(TForm)
lblQueryHistoryKeepDays: TLabel;
Label3: TLabel;
cboxRowHighlightSameText: TColorBox;
chkWheelZoom: TCheckBox;
procedure FormShow(Sender: TObject);
procedure Modified(Sender: TObject);
procedure Apply(Sender: TObject);
@@ -279,6 +280,7 @@ procedure Toptionsform.Apply(Sender: TObject);
AppSettings.WriteInt(asUpdatecheckInterval, updownUpdatecheckInterval.Position);
end;
AppSettings.WriteBool(asDoUsageStatistics, chkDoStatistics.Checked);
AppSettings.WriteBool(asWheelZoom, chkWheelZoom.Checked);
AppSettings.WriteBool(asDisplayBars, chkColorBars.Checked);
AppSettings.WriteInt(asBarColor, cboxColorBars.Selected);
AppSettings.WriteString(asMySQLBinaries, editMySQLBinaries.Text);
@@ -472,6 +474,7 @@ procedure Toptionsform.FormShow(Sender: TObject);
chkUpdatecheckClick(Sender);
end;
chkDoStatistics.Checked := AppSettings.ReadBool(asDoUsageStatistics);
chkWheelZoom.Checked := AppSettings.ReadBool(asWheelZoom);
chkColorBars.Checked := AppSettings.ReadBool(asDisplayBars);
cboxColorBars.Selected := AppSettings.ReadInt(asBarColor);
editMySQLBinaries.Text := AppSettings.ReadString(asMySQLBinaries);

0 comments on commit d69b571

Please sign in to comment.