Skip to content

Commit

Permalink
#6146: Make properties panel closeable, but don't destroy the contain…
Browse files Browse the repository at this point in the history
…ed window
  • Loading branch information
codereader committed Oct 31, 2022
1 parent f1c5201 commit b953aab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions radiant/ui/mainframe/AuiLayout.cpp
Expand Up @@ -30,6 +30,7 @@ namespace
const std::string PANE_NAME_ATTRIBUTE = "paneName";
const std::string STATE_ATTRIBUTE = "state";
const std::string CONTROL_NAME_ATTRIBUTE = "controlName";
constexpr const char* const PROPERTIES_PANEL = "PropertiesPanel";
constexpr int AuiLayoutVersion = 1;

// Minimum size of docked panels
Expand Down Expand Up @@ -268,8 +269,8 @@ void AuiLayout::activate()

addPane(cameraControl->getControlName(), camera,
DEFAULT_PANE_INFO(cameraControl->getDisplayName(), size).Left().Position(0));
addPane("PropertiesPanel", _propertyNotebook,
DEFAULT_PANE_INFO(_("Properties"), size).Left().Position(1).CloseButton(false).DestroyOnClose(false));
addPane(PROPERTIES_PANEL, _propertyNotebook,
DEFAULT_PANE_INFO(_("Properties"), size).Left().Position(1).DestroyOnClose(false));
addPane(orthoViewControl->getControlName(), orthoViewControl->createWidget(managedArea),
DEFAULT_PANE_INFO(orthoViewControl->getDisplayName(), size).CenterPane());
_auiMgr.Update();
Expand Down Expand Up @@ -668,6 +669,10 @@ void AuiLayout::restoreStateFromRegistry()
_auiMgr.LoadPerspective(storedPersp);
}

// Make sure the properties panel can be closed (the flag might still be set on the stored perspective)
auto& propertyPane = _auiMgr.GetPane(PROPERTIES_PANEL);
propertyPane.CloseButton(true).DestroyOnClose(false);

ensureVisibleCenterPane();

// After restoring the perspective, ensure all visible panes are active
Expand Down

0 comments on commit b953aab

Please sign in to comment.