Fix editor layout parameters (#1270)

This commit is contained in:
Stanislav Denisov
2025-11-01 08:30:10 +01:00
committed by GitHub
parent eb7e2ae51f
commit 787c6802f4
2 changed files with 18 additions and 1 deletions
+13 -1
View File
@@ -26,7 +26,16 @@ void GeneralWindow::Create(EditorComponent* _editor)
wi::gui::Window::Create("General", wi::gui::Window::WindowControls::CLOSE | wi::gui::Window::WindowControls::RESIZE_RIGHT);
SetText("General Options " ICON_GENERALOPTIONS);
SetSize(XMFLOAT2(300, 740));
XMFLOAT2 size = XMFLOAT2(300, 740);
if (editor->main->config.GetSection("layout").Has("options.width"))
{
size.x = editor->main->config.GetSection("layout").GetFloat("options.width");
}
if (editor->main->config.GetSection("layout").Has("options.height"))
{
size.y = editor->main->config.GetSection("layout").GetFloat("options.height");
}
SetSize(size);
masterVolumeSlider.Create(0, 2, 1, 100, "Master Volume: ");
if (editor->main->config.GetSection("options").Has("volume"))
@@ -1465,6 +1474,9 @@ void GeneralWindow::ResizeLayout()
{
wi::gui::Window::ResizeLayout();
editor->main->config.GetSection("layout").Set("options.width", GetSize().x);
editor->main->config.GetSection("layout").Set("options.height", GetSize().y);
layout.add_right(versionCheckBox, fpsCheckBox, otherinfoCheckBox);
layout.add(masterVolumeSlider);