Permalink
Browse files

Issue #8: Remove color selection for inline progress bars in grid cel…

…ls, and make that color theme compatible. See https://www.heidisql.com/forum.php?t=25952#p26136
  • Loading branch information...
ansgarbecker committed Nov 30, 2018
1 parent 0eba8aa commit c1f9c186fb38b49923ed7f0c67f3314d319806c6
Showing with 10 additions and 32 deletions.
  1. +1 −2 source/apphelpers.pas
  2. +1 −1 source/main.pas
  3. +8 −18 source/options.dfm
  4. +0 −11 source/options.pas
@@ -167,7 +167,7 @@ TQueryThread = class(TThread)
asCopyTableWindowHeight, asCopyTableWindowWidth, asCopyTableColumns, asCopyTableKeys, asCopyTableForeignKeys,
asCopyTableData, asCopyTableRecentFilter, asServerVersion, asServerVersionFull, asLastConnect,
asConnectCount, asRefusedCount, asSessionCreated, asDoUsageStatistics,
asLastUsageStatisticCall, asWheelZoom, asDisplayBars, asBarColor, asMySQLBinaries, asCustomSnippetsDirectory,
asLastUsageStatisticCall, asWheelZoom, asDisplayBars, asMySQLBinaries, asCustomSnippetsDirectory,
asPromptSaveFileOnTabClose, asWarnUnsafeUpdates, asQueryWarningsMessage,
asCompletionProposal, asCompletionProposalWidth, asCompletionProposalNbLinesInWindow, asAutoUppercase,
asTabsToSpaces, asFilterPanel, asAllowMultipleInstances, asFindDialogSearchHistory, asGUIFontName, asGUIFontSize,
@@ -3700,7 +3700,6 @@ constructor TAppSettings.Create;
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, '');
// Default folder for snippets
if FPortableMode then
@@ -7391,7 +7391,7 @@ procedure TMainForm.PaintColorBar(Value, Max: Extended; TargetCanvas: TCanvas; C
// Avoid division by zero, when max is 0 - very rare case but reported in issue #2196.
if (Value > 0) and (Max > 0) then begin
BarWidth := Round(CellWidth / Max * Value);
TargetCanvas.Brush.Color := AppSettings.ReadInt(asBarColor);
TargetCanvas.Brush.Color := ColorAdjustBrightness(TargetCanvas.Brush.Color, 20);
TargetCanvas.Pen.Color := ColorAdjustBrightness(TargetCanvas.Brush.Color, -40);
TargetCanvas.RoundRect(CellRect.Left, CellRect.Top, CellRect.Left+BarWidth, CellRect.Bottom, 2, 2);
end;
@@ -185,20 +185,10 @@ object optionsform: Toptionsform
object chkColorBars: TCheckBox
Left = 8
Top = 199
Width = 258
Width = 699
Height = 17
Caption = 'Display bars in various list columns'
TabOrder = 9
OnClick = chkColorBarsClick
end
object cboxColorBars: TColorBox
Left = 272
Top = 197
Width = 435
Height = 22
Style = [cbStandardColors, cbExtendedColors, cbCustomColor, cbPrettyNames, cbCustomColors]
Anchors = [akLeft, akTop, akRight]
TabOrder = 10
OnClick = Modified
end
object editMySQLBinaries: TButtonedEdit
@@ -210,7 +200,7 @@ object optionsform: Toptionsform
Images = MainForm.ImageListMain
RightButton.ImageIndex = 51
RightButton.Visible = True
TabOrder = 11
TabOrder = 10
Text = 'editMySQLBinaries'
TextHint = 'Find mysql.exe directory'
OnChange = Modified
@@ -224,7 +214,7 @@ object optionsform: Toptionsform
Height = 21
Style = csDropDownList
Anchors = [akLeft, akTop, akRight]
TabOrder = 13
TabOrder = 12
OnClick = Modified
end
object editCustomSnippetsDirectory: TButtonedEdit
@@ -236,7 +226,7 @@ object optionsform: Toptionsform
Images = MainForm.ImageListMain
RightButton.ImageIndex = 51
RightButton.Visible = True
TabOrder = 12
TabOrder = 11
Text = 'editCustomSnippetsDirectory'
TextHint = 'Set custom directory for SQL snippet files'
OnChange = Modified
@@ -250,7 +240,7 @@ object optionsform: Toptionsform
Height = 21
Style = csDropDownList
Anchors = [akLeft, akTop, akRight]
TabOrder = 14
TabOrder = 13
OnChange = comboGUIFontChange
end
object editGUIFontSize: TEdit
@@ -259,7 +249,7 @@ object optionsform: Toptionsform
Width = 57
Height = 21
Anchors = [akTop, akRight]
TabOrder = 15
TabOrder = 14
Text = '8'
OnChange = Modified
end
@@ -272,7 +262,7 @@ object optionsform: Toptionsform
Associate = editGUIFontSize
Min = 4
Position = 8
TabOrder = 16
TabOrder = 15
OnChanging = anyUpDownLimitChanging
end
object chkWheelZoom: TCheckBox
@@ -293,7 +283,7 @@ object optionsform: Toptionsform
Style = csDropDownList
Anchors = [akLeft, akTop, akRight]
Sorted = True
TabOrder = 17
TabOrder = 16
OnChange = Modified
end
end
@@ -79,7 +79,6 @@ Toptionsform = class(TForm)
editGridRowsLineCount: TEdit;
updownGridRowsLineCount: TUpDown;
chkColorBars: TCheckBox;
cboxColorBars: TColorBox;
comboSQLFontName: TComboBox;
lblFont: TLabel;
editSQLFontSize: TEdit;
@@ -190,7 +189,6 @@ Toptionsform = class(TForm)
procedure Shortcut2Change(Sender: TObject);
procedure ShortcutEnter(Sender: TObject);
procedure ShortcutExit(Sender: TObject);
procedure chkColorBarsClick(Sender: TObject);
procedure comboGridTextColorsSelect(Sender: TObject);
procedure colorBoxGridTextColorsSelect(Sender: TObject);
procedure editMySQLBinariesRightButtonClick(Sender: TObject);
@@ -301,7 +299,6 @@ procedure Toptionsform.Apply(Sender: TObject);
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);
AppSettings.WriteString(asCustomSnippetsDirectory, editCustomSnippetsDirectory.Text);
if comboAppLanguage.ItemIndex > 0 then begin
@@ -519,7 +516,6 @@ procedure Toptionsform.FormShow(Sender: TObject);
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);
editCustomSnippetsDirectory.Text := AppSettings.ReadString(asCustomSnippetsDirectory);
LangCode := AppSettings.ReadString(asAppLanguage);
@@ -719,13 +715,6 @@ procedure Toptionsform.chkUpdatecheckClick(Sender: TObject);
end;
procedure Toptionsform.chkColorBarsClick(Sender: TObject);
begin
cboxColorBars.Enabled := (Sender as TCheckbox).Checked;
Modified(Sender);
end;
procedure Toptionsform.chkLogToFileClick(Sender: TObject);
begin
editLogDir.Enabled := TCheckBox(Sender).Checked;

0 comments on commit c1f9c18

Please sign in to comment.