UI: Add ability to reset whole UI
Users for example disable all of the items in the view menu. This allows them to easily reset them all.
This commit is contained in:
parent
bc80d0ca95
commit
3cfd30ae2a
@ -740,11 +740,12 @@ Basic.MainMenu.View.SceneTransitions="S&cene Transitions"
|
||||
Basic.MainMenu.View.SourceIcons="Source &Icons"
|
||||
Basic.MainMenu.View.StatusBar="&Status Bar"
|
||||
Basic.MainMenu.View.Fullscreen.Interface="Fullscreen Interface"
|
||||
Basic.MainMenu.View.ResetUI="&Reset UI"
|
||||
|
||||
#basic mode docks menu
|
||||
Basic.MainMenu.Docks="&Docks"
|
||||
Basic.MainMenu.Docks.ResetUI="&Reset UI"
|
||||
Basic.MainMenu.Docks.LockUI="&Lock UI"
|
||||
Basic.MainMenu.Docks.ResetDocks="&Reset Docks"
|
||||
Basic.MainMenu.Docks.LockDocks="&Lock Docks"
|
||||
Basic.MainMenu.Docks.CustomBrowserDocks="&Custom Browser Docks..."
|
||||
|
||||
# basic mode profile/scene collection menus
|
||||
|
@ -657,6 +657,11 @@
|
||||
<property name="title">
|
||||
<string>Basic.MainMenu.View</string>
|
||||
</property>
|
||||
<action name="resetUI">
|
||||
<property name="text">
|
||||
<string>Basic.MainMenu.View.ResetUI</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionFullscreenInterface">
|
||||
<property name="text">
|
||||
<string>Basic.MainMenu.View.Fullscreen.Interface</string>
|
||||
@ -665,6 +670,7 @@
|
||||
<string>F11</string>
|
||||
</property>
|
||||
</action>
|
||||
<addaction name="resetUI"/>
|
||||
<addaction name="actionFullscreenInterface"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="toggleListboxToolbars"/>
|
||||
@ -685,8 +691,8 @@
|
||||
<property name="title">
|
||||
<string>Basic.MainMenu.Docks</string>
|
||||
</property>
|
||||
<addaction name="lockUI"/>
|
||||
<addaction name="resetUI"/>
|
||||
<addaction name="lockDocks"/>
|
||||
<addaction name="resetDocks"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="toggleScenes"/>
|
||||
<addaction name="toggleSources"/>
|
||||
@ -2052,12 +2058,12 @@
|
||||
<string>Basic.Stats</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="resetUI">
|
||||
<action name="resetDocks">
|
||||
<property name="text">
|
||||
<string>Basic.MainMenu.Docks.ResetUI</string>
|
||||
<string>Basic.MainMenu.Docks.ResetDocks</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="lockUI">
|
||||
<action name="lockDocks">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -2065,7 +2071,7 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Basic.MainMenu.Docks.LockUI</string>
|
||||
<string>Basic.MainMenu.Docks.LockDocks</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="toggleScenes">
|
||||
|
@ -1980,12 +1980,12 @@ void OBSBasic::OBSInit()
|
||||
App()->GlobalConfig(), "BasicWindow", "DockState");
|
||||
|
||||
if (!dockStateStr) {
|
||||
on_resetUI_triggered();
|
||||
on_resetDocks_triggered();
|
||||
} else {
|
||||
QByteArray dockState =
|
||||
QByteArray::fromBase64(QByteArray(dockStateStr));
|
||||
if (!restoreState(dockState))
|
||||
on_resetUI_triggered();
|
||||
on_resetDocks_triggered();
|
||||
}
|
||||
|
||||
bool pre23Defaults = config_get_bool(App()->GlobalConfig(), "General",
|
||||
@ -2004,10 +2004,10 @@ void OBSBasic::OBSInit()
|
||||
|
||||
bool docksLocked = config_get_bool(App()->GlobalConfig(), "BasicWindow",
|
||||
"DocksLocked");
|
||||
on_lockUI_toggled(docksLocked);
|
||||
ui->lockUI->blockSignals(true);
|
||||
ui->lockUI->setChecked(docksLocked);
|
||||
ui->lockUI->blockSignals(false);
|
||||
on_lockDocks_toggled(docksLocked);
|
||||
ui->lockDocks->blockSignals(true);
|
||||
ui->lockDocks->setChecked(docksLocked);
|
||||
ui->lockDocks->blockSignals(false);
|
||||
|
||||
SystemTray(true);
|
||||
|
||||
@ -2690,7 +2690,7 @@ OBSBasic::~OBSBasic()
|
||||
config_set_bool(App()->GlobalConfig(), "BasicWindow",
|
||||
"PreviewProgramMode", IsPreviewProgramMode());
|
||||
config_set_bool(App()->GlobalConfig(), "BasicWindow", "DocksLocked",
|
||||
ui->lockUI->isChecked());
|
||||
ui->lockDocks->isChecked());
|
||||
config_save_safe(App()->GlobalConfig(), "tmp", nullptr);
|
||||
|
||||
#ifdef _WIN32
|
||||
@ -8776,7 +8776,7 @@ int OBSBasic::GetProfilePath(char *path, size_t size, const char *file) const
|
||||
return snprintf(path, size, "%s/%s/%s", profiles_path, profile, file);
|
||||
}
|
||||
|
||||
void OBSBasic::on_resetUI_triggered()
|
||||
void OBSBasic::on_resetDocks_triggered()
|
||||
{
|
||||
/* prune deleted extra docks */
|
||||
for (int i = extraDocks.size() - 1; i >= 0; i--) {
|
||||
@ -8838,7 +8838,7 @@ void OBSBasic::on_resetUI_triggered()
|
||||
activateWindow();
|
||||
}
|
||||
|
||||
void OBSBasic::on_lockUI_toggled(bool lock)
|
||||
void OBSBasic::on_lockDocks_toggled(bool lock)
|
||||
{
|
||||
QDockWidget::DockWidgetFeatures features =
|
||||
lock ? QDockWidget::NoDockWidgetFeatures
|
||||
@ -8865,6 +8865,16 @@ void OBSBasic::on_lockUI_toggled(bool lock)
|
||||
}
|
||||
}
|
||||
|
||||
void OBSBasic::on_resetUI_triggered()
|
||||
{
|
||||
on_resetDocks_triggered();
|
||||
|
||||
ui->toggleListboxToolbars->setChecked(true);
|
||||
ui->toggleContextBar->setChecked(true);
|
||||
ui->toggleSourceIcons->setChecked(true);
|
||||
ui->toggleStatusBar->setChecked(true);
|
||||
}
|
||||
|
||||
void OBSBasic::on_toggleListboxToolbars_toggled(bool visible)
|
||||
{
|
||||
ui->sourcesToolbar->setVisible(visible);
|
||||
@ -9605,7 +9615,7 @@ QAction *OBSBasic::AddDockWidget(QDockWidget *dock)
|
||||
assignDockToggle(dock, action);
|
||||
extraDocks.push_back(dock);
|
||||
|
||||
bool lock = ui->lockUI->isChecked();
|
||||
bool lock = ui->lockDocks->isChecked();
|
||||
QDockWidget::DockWidgetFeatures features =
|
||||
lock ? QDockWidget::NoDockWidgetFeatures
|
||||
: (QDockWidget::DockWidgetClosable |
|
||||
|
@ -1083,7 +1083,8 @@ private slots:
|
||||
void on_stats_triggered();
|
||||
|
||||
void on_resetUI_triggered();
|
||||
void on_lockUI_toggled(bool lock);
|
||||
void on_resetDocks_triggered();
|
||||
void on_lockDocks_toggled(bool lock);
|
||||
|
||||
void PauseToggled();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user