mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Reapply image list fix for extra space besides top items in main menu, after form translation has taken place
This commit is contained in:
@ -4,7 +4,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Forms, Windows, Messages, System.Types, StdCtrls, Clipbrd,
|
Classes, SysUtils, Forms, Windows, Messages, System.Types, StdCtrls, Clipbrd,
|
||||||
SizeGrip, apphelpers, Vcl.Graphics, Vcl.Dialogs, gnugettext;
|
SizeGrip, apphelpers, Vcl.Graphics, Vcl.Dialogs, gnugettext, Vcl.ImgList;
|
||||||
|
|
||||||
type
|
type
|
||||||
// Form with a sizegrip in the lower right corner, without the need for a statusbar
|
// Form with a sizegrip in the lower right corner, without the need for a statusbar
|
||||||
@ -32,11 +32,25 @@ implementation
|
|||||||
{ TExtForm }
|
{ TExtForm }
|
||||||
|
|
||||||
constructor TExtForm.Create(AOwner: TComponent);
|
constructor TExtForm.Create(AOwner: TComponent);
|
||||||
|
var
|
||||||
|
OldImageList: TCustomImageList;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
InheritFont(Font);
|
InheritFont(Font);
|
||||||
HasSizeGrip := False;
|
HasSizeGrip := False;
|
||||||
TranslateComponent(Self);
|
|
||||||
|
// Translation and related fixes
|
||||||
|
// Issue #557: Apply images *after* translating main menu, so top items don't get unused
|
||||||
|
// space left besides them.
|
||||||
|
if (Menu <> nil) and (Menu.Images <> nil) then begin
|
||||||
|
OldImageList := Menu.Images;
|
||||||
|
Menu.Images := nil;
|
||||||
|
TranslateComponent(Self);
|
||||||
|
Menu.Images := OldImageList;
|
||||||
|
end else begin
|
||||||
|
TranslateComponent(Self);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1985,6 +1985,7 @@ object MainForm: TMainForm
|
|||||||
end
|
end
|
||||||
object MainMenu1: TMainMenu
|
object MainMenu1: TMainMenu
|
||||||
AutoHotkeys = maManual
|
AutoHotkeys = maManual
|
||||||
|
Images = VirtualImageListMain
|
||||||
Left = 424
|
Left = 424
|
||||||
Top = 152
|
Top = 152
|
||||||
object MainMenuFile: TMenuItem
|
object MainMenuFile: TMenuItem
|
||||||
|
@ -1682,10 +1682,6 @@ begin
|
|||||||
// Load preferred ImageCollection into VirtualImageList
|
// Load preferred ImageCollection into VirtualImageList
|
||||||
PrepareImageList;
|
PrepareImageList;
|
||||||
|
|
||||||
// Issue #557: Apply images *after* translating main menu, so top items don't get unused
|
|
||||||
// space left besides them.
|
|
||||||
MainMenu1.Images := VirtualImageListMain;
|
|
||||||
|
|
||||||
if AppSettings.ReadBool(asToolbarShowCaptions) then begin
|
if AppSettings.ReadBool(asToolbarShowCaptions) then begin
|
||||||
for i:=0 to ToolBarMainButtons.ButtonCount-1 do begin
|
for i:=0 to ToolBarMainButtons.ButtonCount-1 do begin
|
||||||
if ToolBarMainButtons.Buttons[i].Style = tbsSeparator then
|
if ToolBarMainButtons.Buttons[i].Style = tbsSeparator then
|
||||||
|
Reference in New Issue
Block a user