From ca3bacf6c170cf873af803ad288ed8dadf154c0a Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Tue, 16 Jun 2026 19:57:38 +0200 Subject: [PATCH] Update Atlas sidebar layout Replace the wxBoxSizer with a wxFlexGridSizer so the gaps between main elements, typically wxStaticBoxSizer, remain uniform across the tools. Add a style variable to control the wxFlexGridSizer on platform basis. Also replace the obsolete wxScrolledWindow by inheriting from wxScrolled instead. Signed-off-by: Ralph Sennhauser --- .../ScenarioEditor/Sections/Cinema/Cinema.cpp | 10 +---- .../ScenarioEditor/Sections/Cinema/Cinema.h | 1 - .../Sections/Common/Sidebar.cpp | 12 +++++- .../ScenarioEditor/Sections/Common/Sidebar.h | 12 ++++-- .../Sections/Environment/Environment.cpp | 23 ++++-------- .../ScenarioEditor/Sections/Map/Map.cpp | 24 ++++-------- .../ScenarioEditor/Sections/Object/Object.cpp | 37 +++++++++---------- .../ScenarioEditor/Sections/Player/Player.cpp | 10 +---- .../Sections/Terrain/Terrain.cpp | 22 ++++------- .../atlas/AtlasUI/ScenarioEditor/StyleSheet.h | 3 ++ 10 files changed, 65 insertions(+), 89 deletions(-) diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp index 83dbe8dabb..2dd4e3632b 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp @@ -61,14 +61,8 @@ static wxWindow* Tooltipped(wxWindow* window, const wxString& tip) CinemaSidebar::CinemaSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer) : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer) { - wxSizer* scrollSizer = new wxBoxSizer(wxVERTICAL); - scrolledWindow = new wxScrolledWindow(this); - scrolledWindow->SetScrollRate(10, 10); - scrolledWindow->SetSizer(scrollSizer); - m_MainSizer->Add(scrolledWindow, wxSizerFlags().Proportion(1).Expand()); - - wxStaticBoxSizer* commonSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Common settings")); - scrollSizer->Add(commonSizer, wxSizerFlags().Expand()); + wxStaticBoxSizer* commonSizer = new wxStaticBoxSizer(wxVERTICAL, this, _T("Common settings")); + m_MainSizer->Add(commonSizer, wxSizerFlags().Expand()); wxFlexGridSizer* gridSizer = new wxFlexGridSizer(2, 5, 5); gridSizer->AddGrowableCol(1); diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.h b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.h index 59ae48dc20..883e8ff3c0 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.h +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.h @@ -43,7 +43,6 @@ private: void ReloadPathList(); - wxScrolledWindow* scrolledWindow; wxCheckBox* m_DrawPath; wxListBox* m_PathList; wxTextCtrl* m_NewPathName; diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.cpp index 0c1804bf84..dda6516e4c 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.cpp @@ -19,14 +19,22 @@ #include "Sidebar.h" +#include "tools/atlas/AtlasUI/ScenarioEditor/StyleSheet.h" + #include #include #include Sidebar::Sidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* WXUNUSED(bottomBarContainer)) - : wxPanel(sidebarContainer), m_ScenarioEditor(scenarioEditor), m_BottomBar(NULL), m_AlreadyDisplayed(false) + : wxScrolled(sidebarContainer), + m_ScenarioEditor(scenarioEditor), + m_BottomBar(nullptr), + m_AlreadyDisplayed(false) { - m_MainSizer = new wxBoxSizer(wxVERTICAL); + SetScrollRate(10, 10); + + m_MainSizer = new wxFlexGridSizer(1, Atlas::Style::SIDEBAR_MAINLAOYOUT_VGAP, 0); + m_MainSizer->AddGrowableCol(0); SetSizer(m_MainSizer); } diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.h b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.h index cda844c8b0..e1aa8fc37b 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.h +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Common/Sidebar.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2025 Wildfire Games. +/* Copyright (C) 2026 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,12 +19,13 @@ #define INCLUDED_SIDEBAR #include +#include class ScenarioEditor; -class wxSizer; +class wxFlexGridSizer; class wxWindow; -class Sidebar : public wxPanel +class Sidebar : public wxScrolled { public: Sidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer); @@ -41,7 +42,10 @@ public: protected: ScenarioEditor& m_ScenarioEditor; - wxSizer* m_MainSizer; // vertical box sizer, used by most sidebars + /* + * Single colum wxFlexGridSizer, used to evenly space the top panels. + */ + wxFlexGridSizer* m_MainSizer; wxWindow* m_BottomBar; // window that goes at the bottom of the screen; may be NULL diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp index 33205092d6..ca310a1f7c 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Environment/Environment.cpp @@ -237,22 +237,13 @@ EnvironmentSidebar::EnvironmentSidebar( ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer) : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer) { - wxSizer* scrollSizer = new wxBoxSizer(wxVERTICAL); - wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this); - scrolledWindow->SetScrollRate(10, 10); - scrolledWindow->SetSizer(scrollSizer); - m_MainSizer->Add(scrolledWindow, wxSizerFlags().Proportion(1).Expand()); - - wxFlexGridSizer* gridSizer = new wxFlexGridSizer(1, 10, 10); - gridSizer->AddGrowableCol(0); - scrollSizer->Add(gridSizer, wxSizerFlags().Expand()); - - wxStaticBoxSizer* waterBoxSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Water settings")); + wxStaticBoxSizer* waterBoxSizer = new wxStaticBoxSizer(wxVERTICAL, this, _T("Water settings")); wxStaticBox* waterBox = waterBoxSizer->GetStaticBox(); - gridSizer->Add(waterBoxSizer, wxSizerFlags().Expand()); + m_MainSizer->Add(waterBoxSizer, wxSizerFlags().Expand()); wxFlexGridSizer* waterSizer = new wxFlexGridSizer(1, 10, 10); waterSizer->AddGrowableCol(0); waterBoxSizer->Add(waterSizer, wxSizerFlags().Expand().Border(wxALL, 5)); + waterSizer->Add(new wxButton( waterBox, ID_RecomputeWaterData, _("Reset Water Data")), wxSizerFlags().Expand()); waterSizer->Add(m_WaterTypeList = new VariableListBox( @@ -277,9 +268,9 @@ EnvironmentSidebar::EnvironmentSidebar( m_WaterTypeList->SetChoices(list); - wxStaticBoxSizer* sunBoxSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Sun / lighting settings")); + wxStaticBoxSizer* sunBoxSizer = new wxStaticBoxSizer(wxVERTICAL, this, _T("Sun / lighting settings")); wxStaticBox* sunBox = sunBoxSizer->GetStaticBox(); - gridSizer->Add(sunBoxSizer, wxSizerFlags().Expand()); + m_MainSizer->Add(sunBoxSizer, wxSizerFlags().Expand()); wxFlexGridSizer* sunSizer = new wxFlexGridSizer(1, 10, 10); sunSizer->AddGrowableCol(0); sunBoxSizer->Add(sunSizer, wxSizerFlags().Expand().Border(wxALL, 5)); @@ -305,9 +296,9 @@ EnvironmentSidebar::EnvironmentSidebar( sunSizer->Add(new VariableColorBox( sunBox, _("Ambient color"), g_EnvironmentSettings.ambientcolor), wxSizerFlags().Expand()); - wxStaticBoxSizer* postProcBoxSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Post-processing settings")); + wxStaticBoxSizer* postProcBoxSizer = new wxStaticBoxSizer(wxVERTICAL, this, _T("Post-processing settings")); wxStaticBox* postProcBox = postProcBoxSizer->GetStaticBox(); - gridSizer->Add(postProcBoxSizer, wxSizerFlags().Expand()); + m_MainSizer->Add(postProcBoxSizer, wxSizerFlags().Expand()); wxFlexGridSizer* postProcSizer = new wxFlexGridSizer(1, 10, 10); postProcSizer->AddGrowableCol(0); postProcBoxSizer->Add(postProcSizer, wxSizerFlags().Expand().Border(wxALL, 5)); diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp index 332ead6c4b..13e6d79475 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp @@ -476,21 +476,13 @@ void MapSettingsControl::SendToEngine() MapSidebar::MapSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer) : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer), m_SimState(SimInactive) { - wxFlexGridSizer* scrollSizer = new wxFlexGridSizer(1, 5, 5); - scrollSizer->AddGrowableCol(0); - - wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this); - scrolledWindow->SetScrollRate(10, 10); - scrolledWindow->SetSizer(scrollSizer); - m_MainSizer->Add(scrolledWindow, wxSizerFlags().Expand().Proportion(1)); - - m_MapSettingsCtrl = new MapSettingsControl(scrolledWindow, m_ScenarioEditor); - scrollSizer->Add(m_MapSettingsCtrl, wxSizerFlags().Expand()); + m_MapSettingsCtrl = new MapSettingsControl(this, m_ScenarioEditor); + m_MainSizer->Add(m_MapSettingsCtrl, wxSizerFlags().Expand()); { ///////////////////////////////////////////////////////////////////////// // Random map settings - wxStaticBoxSizer* topSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Random map")); + wxStaticBoxSizer* topSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Random map")); wxStaticBox* topBox = topSizer->GetStaticBox(); wxFlexGridSizer* grid = new wxFlexGridSizer(1, 10, 10); @@ -498,7 +490,7 @@ MapSidebar::MapSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContaine topSizer->Add(grid, wxSizerFlags().Border(wxALL, 5).Expand()); - scrollSizer->Add(topSizer, wxSizerFlags().Expand()); + m_MainSizer->Add(topSizer, wxSizerFlags().Expand()); grid->Add(new wxChoice(topBox, ID_RandomScript), wxSizerFlags().Expand()); @@ -539,18 +531,18 @@ MapSidebar::MapSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContaine { ///////////////////////////////////////////////////////////////////////// // Misc tools - wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Misc tools")); + wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Misc tools")); sizer->Add(new wxButton(sizer->GetStaticBox(), ID_ResizeMap, _("Resize/Recenter map")), wxSizerFlags().Expand().Border(wxALL, 5)); - scrollSizer->Add(sizer, wxSizerFlags().Expand()); + m_MainSizer->Add(sizer, wxSizerFlags().Expand()); } { ///////////////////////////////////////////////////////////////////////// // Simulation buttons - wxStaticBoxSizer* topSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Simulation test")); + wxStaticBoxSizer* topSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Simulation test")); wxStaticBox* topBox = topSizer->GetStaticBox(); - scrollSizer->Add(topSizer, wxSizerFlags().Expand()); + m_MainSizer->Add(topSizer, wxSizerFlags().Expand()); wxGridSizer* gridSizer = new wxGridSizer(5, 5, 5); gridSizer->Add(Tooltipped(new wxButton(topBox, ID_SimPlay, _("Play"), wxDefaultPosition, wxSize(48, -1)), diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp index 679d895737..5a06f40261 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp @@ -268,50 +268,47 @@ ObjectSidebar::ObjectSidebar( : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer), m_Impl(new ObjectSidebarImpl(scenarioEditor)) { - wxSizer* scrollSizer = new wxBoxSizer(wxVERTICAL); - wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this); - scrolledWindow->SetScrollRate(10, 10); - scrolledWindow->SetSizer(scrollSizer); - m_MainSizer->Add(scrolledWindow, wxSizerFlags().Proportion(1).Expand()); + wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL); + m_MainSizer->AddGrowableRow(0); + m_MainSizer->Add(topSizer, wxSizerFlags().Expand()); wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); - sizer->Add(new wxStaticText(scrolledWindow, wxID_ANY, _("Filter")), wxSizerFlags().Align(wxALIGN_CENTER)); + sizer->Add(new wxStaticText(this, wxID_ANY, _("Filter")), wxSizerFlags().Align(wxALIGN_CENTER)); sizer->AddSpacer(2); sizer->Add( Tooltipped( - new wxTextCtrl(scrolledWindow, ID_ObjectFilter), + new wxTextCtrl(this, ID_ObjectFilter), _("Enter text to filter object list") ), wxSizerFlags().Expand().Proportion(1) ); - scrollSizer->Add(sizer, wxSizerFlags().Expand()); - scrollSizer->AddSpacer(3); - wxCheckBox* exactSearchCheckBox = new wxCheckBox( - scrolledWindow, ID_ObjectExactFilter, _("Exact Search")); + topSizer->Add(sizer, wxSizerFlags().Expand()); + topSizer->AddSpacer(3); + wxCheckBox* exactSearchCheckBox = new wxCheckBox(this, ID_ObjectExactFilter, _("Exact Search")); exactSearchCheckBox->SetValue(true); - scrollSizer->Add(Tooltipped(exactSearchCheckBox, + topSizer->Add(Tooltipped(exactSearchCheckBox, _("Provides a search with a strict string equality"))); - scrollSizer->AddSpacer(3); + topSizer->AddSpacer(3); // ------------------------------------------------------------------------------------------ wxArrayString strings; strings.Add(_("Entities")); strings.Add(_("Actors (all)")); - wxChoice* objectType = new wxChoice(scrolledWindow, ID_ObjectType, wxDefaultPosition, wxDefaultSize, strings); + wxChoice* objectType = new wxChoice(this, ID_ObjectType, wxDefaultPosition, wxDefaultSize, strings); objectType->SetSelection(0); - scrollSizer->Add(objectType, wxSizerFlags().Expand()); - scrollSizer->AddSpacer(3); + topSizer->Add(objectType, wxSizerFlags().Expand()); + topSizer->AddSpacer(3); // ------------------------------------------------------------------------------------------ - m_Impl->m_ObjectListBox = new wxListBox(scrolledWindow, ID_SelectObject, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SINGLE|wxLB_HSCROLL); - scrollSizer->Add(m_Impl->m_ObjectListBox, wxSizerFlags().Proportion(1).Expand()); - scrollSizer->AddSpacer(3); + m_Impl->m_ObjectListBox = new wxListBox(this, ID_SelectObject, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SINGLE|wxLB_HSCROLL); + topSizer->Add(m_Impl->m_ObjectListBox, wxSizerFlags().Proportion(1).Expand()); + topSizer->AddSpacer(3); // ------------------------------------------------------------------------------------------ - scrollSizer->Add(new wxButton(scrolledWindow, ID_ToggleViewer, _("Switch to Actor Viewer")), wxSizerFlags().Expand()); + topSizer->Add(new wxButton(this, ID_ToggleViewer, _("Switch to Actor Viewer")), wxSizerFlags().Expand()); // ------------------------------------------------------------------------------------------ diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp index 28c76d1415..1b8b93f4d3 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Player/Player.cpp @@ -985,14 +985,8 @@ void PlayerSettingsControl::SendToEngine() PlayerSidebar::PlayerSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer) : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer), m_Loaded(false) { - wxSizer* scrollSizer = new wxBoxSizer(wxVERTICAL); - wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this); - scrolledWindow->SetScrollRate(10, 10); - scrolledWindow->SetSizer(scrollSizer); - m_MainSizer->Add(scrolledWindow, wxSizerFlags().Proportion(1).Expand()); - - m_PlayerSettingsCtrl = new PlayerSettingsControl(scrolledWindow, m_ScenarioEditor); - scrollSizer->Add(m_PlayerSettingsCtrl, wxSizerFlags().Expand()); + m_PlayerSettingsCtrl = new PlayerSettingsControl(this, m_ScenarioEditor); + m_MainSizer->Add(m_PlayerSettingsCtrl, wxSizerFlags().Expand()); } void PlayerSidebar::OnFirstDisplay() diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp index c73ac4ab8b..355b331107 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp @@ -222,16 +222,10 @@ END_EVENT_TABLE(); TerrainSidebar::TerrainSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer) : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer) { - wxSizer* scrollSizer = new wxBoxSizer(wxVERTICAL); - wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this); - scrolledWindow->SetScrollRate(10, 10); - scrolledWindow->SetSizer(scrollSizer); - m_MainSizer->Add(scrolledWindow, wxSizerFlags().Proportion(1).Expand()); - { ///////////////////////////////////////////////////////////////////////// // Terrain elevation - wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Elevation tools")); + wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Elevation tools")); wxSizer* gridSizer = new wxGridSizer(4, 5, 5); gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Modify"), _T("AlterElevation"), wxSize(48, -1)), _("Brush with left mouse buttons to raise terrain,\nright mouse button to lower it")), wxSizerFlags().Expand()); @@ -242,13 +236,13 @@ TerrainSidebar::TerrainSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebar gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Flatten"), _T("FlattenElevation"), wxSize(48, -1)), _("Brush with left mouse button to flatten terrain")), wxSizerFlags().Expand()); sizer->Add(gridSizer, wxSizerFlags().Expand().Border(wxALL, 5)); - scrollSizer->Add(sizer, wxSizerFlags().Expand()); + m_MainSizer->Add(sizer, wxSizerFlags().Expand()); } { ///////////////////////////////////////////////////////////////////////// // Terrain texture - wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Texture tools")); + wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Texture tools")); wxSizer* gridSizer = new wxGridSizer(3, 5, 5); gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Paint"), _T("PaintTerrain"), wxSize(48, -1)), _("Brush with left mouse button to paint texture dominantly,\nright mouse button to paint submissively.\nShift-left-click for eyedropper tool")), wxSizerFlags().Expand()); @@ -257,26 +251,26 @@ TerrainSidebar::TerrainSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebar gridSizer->Add(Tooltipped(new ToolButton(scenarioEditor.GetToolManager(), sizer->GetStaticBox(), _("Fill"), _T("FillTerrain"), wxSize(48, -1)), _T("Bucket fill a patch of terrain texture with a new one")), wxSizerFlags().Expand()); sizer->Add(gridSizer, wxSizerFlags().Expand().Border(wxALL, 5)); - scrollSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10)); + m_MainSizer->Add(sizer, wxSizerFlags().Expand()); } { ///////////////////////////////////////////////////////////////////////// // Brush settings - wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Brush")); + wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Brush")); m_TexturePreview = new TexturePreviewPanel(sizer->GetStaticBox()); sizer->Add(m_TexturePreview, wxSizerFlags(1).Expand().Border(wxALL, 5)); g_Brush_Elevation.CreateUI(sizer->GetStaticBox(), sizer); - scrollSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10)); + m_MainSizer->Add(sizer, wxSizerFlags().Expand()); } { ///////////////////////////////////////////////////////////////////////// // Visualise - wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _("Visualise")); - scrollSizer->Add(sizer, wxSizerFlags().Expand().Border(wxTOP, 10)); + wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Visualise")); + m_MainSizer->Add(sizer, wxSizerFlags().Expand()); wxFlexGridSizer* visSizer = new wxFlexGridSizer(2, 5, 5); visSizer->AddGrowableCol(1); diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/StyleSheet.h b/source/tools/atlas/AtlasUI/ScenarioEditor/StyleSheet.h index 50fae403e9..e8262ec727 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/StyleSheet.h +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/StyleSheet.h @@ -26,12 +26,15 @@ namespace Atlas::Style #if defined(__WXGTK__) constexpr int BOTTOMBAR_DEFAULT_SIZE = 200; constexpr int SIDEBAR_DEFAULT_SIZE = 285; +constexpr int SIDEBAR_MAINLAOYOUT_VGAP = 10; #elif defined(__WXOSX__) || defined(__WXMAC__) constexpr int BOTTOMBAR_DEFAULT_SIZE = 210; constexpr int SIDEBAR_DEFAULT_SIZE = 285; +constexpr int SIDEBAR_MAINLAOYOUT_VGAP = 5; #else // __MSW__ constexpr int BOTTOMBAR_DEFAULT_SIZE = 180; constexpr int SIDEBAR_DEFAULT_SIZE = 235; +constexpr int SIDEBAR_MAINLAOYOUT_VGAP = 5; #endif } // namespace Atlas::Style