diff --git a/source/apphelpers.pas b/source/apphelpers.pas index a0ffb9ca..ab0a71e8 100644 --- a/source/apphelpers.pas +++ b/source/apphelpers.pas @@ -303,7 +303,6 @@ type function WideHexToBin(text: String): AnsiString; function BinToWideHex(bin: AnsiString): String; procedure FixVT(VT: TVirtualStringTree; MultiLineCount: Word=1); - procedure FixDropDownButtons(Form: TForm); function GetTextHeight(Font: TFont): Integer; function ColorAdjustBrightness(Col: TColor; Shift: SmallInt): TColor; function ComposeOrderClause(Cols: TOrderColArray): String; @@ -1466,27 +1465,6 @@ begin end; -procedure FixDropDownButtons(Form: TForm); -var - i: Integer; - Comp: TComponent; -begin - // Work around broken dropdown (tool)button on Wine after translation: - // https://sourceforge.net/p/dxgettext/bugs/80/ - for i:=0 to Form.ComponentCount-1 do begin - Comp := Form.Components[i]; - if (Comp is TButton) and (TButton(Comp).Style = bsSplitButton) then begin - TButton(Comp).Style := bsPushButton; - TButton(Comp).Style := bsSplitButton; - end; - if (Comp is TToolButton) and (TToolButton(Comp).Style = tbsDropDown) then begin - TToolButton(Comp).Style := tbsButton; - TToolButton(Comp).Style := tbsDropDown; - end; - end; -end; - - function GetTextHeight(Font: TFont): Integer; var DC: HDC; diff --git a/source/connections.pas b/source/connections.pas index 611ffb34..83f10eef 100644 --- a/source/connections.pas +++ b/source/connections.pas @@ -240,7 +240,6 @@ var begin // Fix GUI stuff HasSizeGrip := True; - FixDropDownButtons(Self); lblDownloadPlink.Font.Style := [fsUnderline]; lblDownloadPlink.Font.Color := clBlue; diff --git a/source/copytable.pas b/source/copytable.pas index 70365cc8..3004af79 100644 --- a/source/copytable.pas +++ b/source/copytable.pas @@ -68,7 +68,6 @@ const procedure TCopyTableForm.FormCreate(Sender: TObject); begin HasSizeGrip := True; - FixDropDownButtons(Self); Width := AppSettings.ReadInt(asCopyTableWindowWidth); Height := AppSettings.ReadInt(asCopyTableWindowHeight); MainForm.SetupSynEditors; diff --git a/source/extra_controls.pas b/source/extra_controls.pas index 337e2cb7..12f06bc1 100644 --- a/source/extra_controls.pas +++ b/source/extra_controls.pas @@ -4,7 +4,7 @@ interface uses Classes, SysUtils, Forms, Windows, Messages, System.Types, StdCtrls, Clipbrd, - SizeGrip, apphelpers, Vcl.Graphics, Vcl.Dialogs, gnugettext, Vcl.ImgList; + SizeGrip, apphelpers, Vcl.Graphics, Vcl.Dialogs, gnugettext, Vcl.ImgList, Vcl.ComCtrls; type // Form with a sizegrip in the lower right corner, without the need for a statusbar @@ -34,6 +34,8 @@ implementation constructor TExtForm.Create(AOwner: TComponent); var OldImageList: TCustomImageList; + i: Integer; + Cmp: TComponent; begin inherited; @@ -51,6 +53,19 @@ begin end else begin TranslateComponent(Self); end; + // Work around broken dropdown (tool)button on Wine after translation: + // https://sourceforge.net/p/dxgettext/bugs/80/ + for i:=0 to ComponentCount-1 do begin + Cmp := Components[i]; + if (Cmp is TButton) and (TButton(Cmp).Style = bsSplitButton) then begin + TButton(Cmp).Style := bsPushButton; + TButton(Cmp).Style := bsSplitButton; + end; + if (Cmp is TToolButton) and (TToolButton(Cmp).Style = tbsDropDown) then begin + TToolButton(Cmp).Style := tbsButton; + TToolButton(Cmp).Style := tbsDropDown; + end; + end; end; diff --git a/source/main.pas b/source/main.pas index 35ec1bb5..0977d144 100644 --- a/source/main.pas +++ b/source/main.pas @@ -1677,8 +1677,6 @@ var begin caption := APPNAME; - FixDropDownButtons(Self); - // Load preferred ImageCollection into VirtualImageList PrepareImageList; diff --git a/source/tabletools.pas b/source/tabletools.pas index d23838c3..b942c634 100644 --- a/source/tabletools.pas +++ b/source/tabletools.pas @@ -226,7 +226,6 @@ var Obj: TDBObject; begin HasSizeGrip := True; - FixDropDownButtons(Self); OUTPUT_FILE := _('Single .sql file'); OUTPUT_FILE_COMPRESSED := _('ZIP compressed .sql file'); OUTPUT_CLIPBOARD := _('Clipboard'); diff --git a/source/texteditor.pas b/source/texteditor.pas index e07bc9b5..388f9ed1 100644 --- a/source/texteditor.pas +++ b/source/texteditor.pas @@ -202,7 +202,6 @@ begin actSearchFindNext.Hint := MainForm.actQueryFindAgain.Hint; actSearchReplace.Caption := MainForm.actQueryReplace.Caption; actSearchReplace.Hint := MainForm.actQueryReplace.Hint; - FixDropDownButtons(Self); // Assign linebreak values to their menu item tags, to write less code later menuWindowsLB.Tag := Integer(lbsWindows); menuUnixLB.Tag := Integer(lbsUnix);