Try the same workaround for invisible or black dropdown buttons on Wine as previously only for dropdown toolbuttons (becd4bdd0e3845f9ad7845fe7637460914878afa and 61202be058cc135f938a131207f47f9546efff26). Probably fixes issue #94. May also not fix it, as the toolbutton issue was not only on Wine.

This commit is contained in:
Ansgar Becker
2018-02-03 22:47:29 +01:00
parent f5c254ff77
commit f7b4d0c0b8
6 changed files with 29 additions and 16 deletions

View File

@ -13,7 +13,7 @@ uses
Windows, ShlObj, ActiveX, VirtualTrees, SynRegExpr, Messages, Math,
Registry, DateUtils, Generics.Collections, StrUtils, AnsiStrings, TlHelp32, Types,
dbconnection, mysql_structures, SynMemo, Menus, WinInet, gnugettext, Themes,
Character, ImgList, System.UITypes, ActnList, WinSock, IOUtils;
Character, ImgList, System.UITypes, ActnList, WinSock, IOUtils, StdCtrls, ComCtrls;
type
@ -292,6 +292,7 @@ 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;
@ -1446,13 +1447,34 @@ begin
VT.ShowHint := True;
VT.HintMode := hmToolTip;
// Apply case insensitive incremental search event
if VT.IncrementalSearch <> isNone then
if VT.IncrementalSearch <> VirtualTrees.isNone then
VT.OnIncrementalSearch := Mainform.AnyGridIncrementalSearch;
VT.OnStartOperation := Mainform.AnyGridStartOperation;
VT.OnEndOperation := Mainform.AnyGridEndOperation;
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;