Skip to content

Commit

Permalink
2D view is now the CenterPane in AUI layout
Browse files Browse the repository at this point in the history
The AUI Center pane is a non-floatable pane which takes up all the space in the
window not occupied by docked panes. Previously the 2D view was docked in the
Right position, which tended to leave a large empty area in the middle of the
window which would only be filled if the left and right panes were manually
resized.

The disadvantage of using the Center position is there is no possibility to
float the 2D view, but since we can create a new standalone window from the
View menu, this seems an acceptable compromise to avoid an annoying empty area.
  • Loading branch information
Matthew Mott committed Feb 23, 2021
1 parent c129e72 commit b05a9fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions radiant/ui/mainframe/AuiLayout.cpp
Expand Up @@ -31,8 +31,8 @@ namespace
wxAuiPaneInfo DEFAULT_PANE_INFO(const std::string& caption,
const wxSize& minSize)
{
return wxAuiPaneInfo().Caption(caption).Layer(1).CloseButton(false)
.MinSize(minSize);
return wxAuiPaneInfo().Caption(caption).CloseButton(false)
.BestSize(minSize).MinSize(minSize);
}
}

Expand Down Expand Up @@ -103,12 +103,12 @@ void AuiLayout::activate()
// the 2D view on the right
wxSize size = topLevelParent->GetSize();
size.Scale(0.5, 1.0);
addPane(xywnd->getGLWidget(),
DEFAULT_PANE_INFO(_("2D View"), size).Right());
addPane(_camWnd->getMainWidget(),
DEFAULT_PANE_INFO(_("Camera"), size).Left().Position(0));
addPane(notebookPanel,
DEFAULT_PANE_INFO(_("Properties"), size).Left().Position(1));
addPane(xywnd->getGLWidget(),
DEFAULT_PANE_INFO(_("2D View"), size).CenterPane());
_auiMgr.Update();

// Nasty hack to get the panes sized properly. Since BestSize() is
Expand Down

0 comments on commit b05a9fb

Please sign in to comment.