docking, does not save undocked widget anymore

This commit is contained in:
Basile Burg 2015-01-20 16:14:54 +01:00
parent c7750ef57e
commit a505b9f525
1 changed files with 14 additions and 9 deletions

View File

@ -590,16 +590,19 @@ var
xcfg: TXMLConfigStorage; xcfg: TXMLConfigStorage;
i: NativeInt; i: NativeInt;
begin begin
if not fInitialized then if not fInitialized then exit;
exit; if not Visible then exit;
if WindowState = wsMinimized then //
WindowState := wsNormal; if WindowState = wsMinimized then WindowState := wsNormal;
// TODO-cbugfix: check new docking persistence behaviour on new Laz release.
// does not save minimized/undocked windows to prevent bugs
for i:= 0 to fWidgList.Count-1 do for i:= 0 to fWidgList.Count-1 do
begin begin
DockMaster.GetAnchorSite(fWidgList.widget[i]).Show; if DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState = wsMinimized then
DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState := wsNormal; DockMaster.GetAnchorSite(fWidgList.widget[i]).Close
else if DockMaster.GetAnchorSite(fWidgList.widget[i]).SiteType = adhstNone then
DockMaster.GetAnchorSite(fWidgList.widget[i]).Close;
end; end;
if not Visible then exit;
// //
forceDirectory(getCoeditDocPath); forceDirectory(getCoeditDocPath);
xcfg := TXMLConfigStorage.Create(getCoeditDocPath + 'docking.xml',false); xcfg := TXMLConfigStorage.Create(getCoeditDocPath + 'docking.xml',false);
@ -1504,8 +1507,10 @@ begin
// TODO-cbugfix: possible loading AV, xml saved after undocking some widgets, xml file abnormal size. // TODO-cbugfix: possible loading AV, xml saved after undocking some widgets, xml file abnormal size.
for i:= 0 to fWidgList.Count-1 do for i:= 0 to fWidgList.Count-1 do
begin begin
DockMaster.GetAnchorSite(fWidgList.widget[i]).Show; if DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState = wsMinimized then
DockMaster.GetAnchorSite(fWidgList.widget[i]).WindowState := wsNormal; DockMaster.GetAnchorSite(fWidgList.widget[i]).Close
else if DockMaster.GetAnchorSite(fWidgList.widget[i]).SiteType = adhstNone then
DockMaster.GetAnchorSite(fWidgList.widget[i]).Close;
end; end;
// //
forceDirectory(extractFilePath(aFilename)); forceDirectory(extractFilePath(aFilename));