Skip to content

Commit

Permalink
UI: Move saving of scene tree grid mode
Browse files Browse the repository at this point in the history
Widget shouldn't save their own states, as then they can't be used
elsewhere.
  • Loading branch information
cg2121 authored and Lain-B committed May 21, 2023
1 parent 2089628 commit fc8c428
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 0 additions & 3 deletions UI/scene-tree.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#include "obs.hpp"
#include "scene-tree.hpp"
#include "obs-app.hpp"

#include <QSizePolicy>
#include <QScrollBar>
Expand All @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit fc8c428

Please sign in to comment.