Browse Source

UI: Move saving of scene tree grid mode

Widget shouldn't save their own states, as then they can't be used
elsewhere.
cg2121 2 years ago
parent
commit
fc8c428521
2 changed files with 3 additions and 3 deletions
  1. 0 3
      UI/scene-tree.cpp
  2. 3 0
      UI/window-basic-main.cpp

+ 0 - 3
UI/scene-tree.cpp

@@ -1,6 +1,4 @@
-#include "obs.hpp"
 #include "scene-tree.hpp"
-#include "obs-app.hpp"
 
 #include <QSizePolicy>
 #include <QScrollBar>
@@ -18,7 +16,6 @@ SceneTree::SceneTree(QWidget *parent_) : QListWidget(parent_)
 
 void SceneTree::SetGridMode(bool grid)
 {
-	config_set_bool(App()->GlobalConfig(), "BasicWindow", "gridMode", grid);
 	parent()->setProperty("gridMode", grid);
 	gridMode = grid;
 

+ 3 - 0
UI/window-basic-main.cpp

@@ -5493,6 +5493,9 @@ void OBSBasic::GridActionClicked()
 		ui->actionSceneGridMode->setChecked(true);
 	else
 		ui->actionSceneListMode->setChecked(true);
+
+	config_set_bool(App()->GlobalConfig(), "BasicWindow", "gridMode",
+			gridMode);
 }
 
 void OBSBasic::on_actionAddScene_triggered()