mirror of https://gitlab.com/basile.b/dexed.git
dont load docking in the OnFirstShow handler
This caused random cycles while auto-sizing, making dexed impossible to start without deleting docking.xml
This commit is contained in:
parent
390ec7777e
commit
7398bf9609
|
@ -457,6 +457,8 @@ type
|
||||||
procedure updateFloatingWidgetOnTop(onTop: boolean);
|
procedure updateFloatingWidgetOnTop(onTop: boolean);
|
||||||
procedure widgetDockingChanged(sender: TDexedWidget; newState: TWidgetDockingState);
|
procedure widgetDockingChanged(sender: TDexedWidget; newState: TWidgetDockingState);
|
||||||
procedure mnuOptsItemClick(sender: TObject);
|
procedure mnuOptsItemClick(sender: TObject);
|
||||||
|
procedure anchorDockingAddControlEvent(Sender: TObject; aName: string;
|
||||||
|
var AControl: TControl; DoDisableAutoSizing: boolean);
|
||||||
|
|
||||||
// IMainMenu
|
// IMainMenu
|
||||||
function singleServiceName: string;
|
function singleServiceName: string;
|
||||||
|
@ -1356,6 +1358,10 @@ begin
|
||||||
|
|
||||||
fProcInputHandler := getprocInputHandler;
|
fProcInputHandler := getprocInputHandler;
|
||||||
|
|
||||||
|
InitDocking;
|
||||||
|
if FileExists(getDocPath + 'docking.xml') then
|
||||||
|
LoadDocking();
|
||||||
|
|
||||||
fInitialized := true;
|
fInitialized := true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1610,6 +1616,18 @@ begin
|
||||||
fCleanIconIndex := loadIcon('CLEAN');
|
fCleanIconIndex := loadIcon('CLEAN');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.anchorDockingAddControlEvent(Sender: TObject; aName: string;
|
||||||
|
var AControl: TControl; DoDisableAutoSizing: boolean);
|
||||||
|
var w : TDexedWidget;
|
||||||
|
begin
|
||||||
|
for w in fWidgList do
|
||||||
|
if w.name = aName then
|
||||||
|
begin
|
||||||
|
AControl := w;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TMainForm.InitWidgets;
|
procedure TMainForm.InitWidgets;
|
||||||
var
|
var
|
||||||
widg: TDexedWidget;
|
widg: TDexedWidget;
|
||||||
|
@ -1617,6 +1635,9 @@ var
|
||||||
itm: TMenuItem;
|
itm: TMenuItem;
|
||||||
idx: integer;
|
idx: integer;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
DockMaster.OnCreateControl := @anchorDockingAddControlEvent;
|
||||||
|
|
||||||
fWidgList := TWidgetList.Create;
|
fWidgList := TWidgetList.Create;
|
||||||
fMesgWidg := TMessagesWidget.create(self);
|
fMesgWidg := TMessagesWidget.create(self);
|
||||||
fEditWidg := TEditorWidget.create(self);
|
fEditWidg := TEditorWidget.create(self);
|
||||||
|
@ -2110,8 +2131,6 @@ var
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
InitDocking;
|
|
||||||
|
|
||||||
// TODO-cbetterfix: clipboard doesn't work first time it's used on a reloaded doc.
|
// TODO-cbetterfix: clipboard doesn't work first time it's used on a reloaded doc.
|
||||||
// see: http://forum.lazarus.freepascal.org/index.php/topic,30616.0.htm
|
// see: http://forum.lazarus.freepascal.org/index.php/topic,30616.0.htm
|
||||||
if fAppliOpts.reloadLastDocuments then
|
if fAppliOpts.reloadLastDocuments then
|
||||||
|
@ -2129,11 +2148,6 @@ begin
|
||||||
fInfoWidg.showWidget;
|
fInfoWidg.showWidget;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// see https://bugs.freepascal.org/view.php?id=29475
|
|
||||||
// reloading must be done here otherwise there are "jumps"
|
|
||||||
if FileExists(getDocPath + 'docking.xml') then
|
|
||||||
LoadDocking();
|
|
||||||
|
|
||||||
if fAppliOpts.autoCheckUpdates then
|
if fAppliOpts.autoCheckUpdates then
|
||||||
begin
|
begin
|
||||||
url := checkForUpdate;
|
url := checkForUpdate;
|
||||||
|
|
Loading…
Reference in New Issue