mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
Qt: Add 'Lock Toolbar' option
This commit is contained in:
parent
32ee362228
commit
e75f1c1b6d
|
@ -502,6 +502,12 @@ void MainWindow::onViewToolbarActionToggled(bool checked)
|
||||||
saveStateToConfig();
|
saveStateToConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::onViewLockToolbarActionToggled(bool checked)
|
||||||
|
{
|
||||||
|
m_host_interface->SetBoolSettingValue("UI", "LockToolbar", checked);
|
||||||
|
m_ui.toolBar->setMovable(!checked);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onViewStatusBarActionToggled(bool checked)
|
void MainWindow::onViewStatusBarActionToggled(bool checked)
|
||||||
{
|
{
|
||||||
m_host_interface->SetBoolSettingValue("UI", "ShowStatusBar", checked);
|
m_host_interface->SetBoolSettingValue("UI", "ShowStatusBar", checked);
|
||||||
|
@ -730,6 +736,11 @@ void MainWindow::setupAdditionalUi()
|
||||||
m_ui.actionViewStatusBar->setChecked(status_bar_visible);
|
m_ui.actionViewStatusBar->setChecked(status_bar_visible);
|
||||||
m_ui.statusBar->setVisible(status_bar_visible);
|
m_ui.statusBar->setVisible(status_bar_visible);
|
||||||
|
|
||||||
|
const bool toolbars_locked = m_host_interface->GetBoolSettingValue("UI", "LockToolbar", false);
|
||||||
|
m_ui.actionViewLockToolbar->setChecked(toolbars_locked);
|
||||||
|
m_ui.toolBar->setMovable(!toolbars_locked);
|
||||||
|
m_ui.toolBar->setContextMenuPolicy(Qt::PreventContextMenu);
|
||||||
|
|
||||||
m_game_list_widget = new GameListWidget(m_ui.mainContainer);
|
m_game_list_widget = new GameListWidget(m_ui.mainContainer);
|
||||||
m_game_list_widget->initialize(m_host_interface);
|
m_game_list_widget->initialize(m_host_interface);
|
||||||
m_ui.mainContainer->insertWidget(0, m_game_list_widget);
|
m_ui.mainContainer->insertWidget(0, m_game_list_widget);
|
||||||
|
@ -990,6 +1001,7 @@ void MainWindow::connectSignals()
|
||||||
connect(m_ui.actionAdvancedSettings, &QAction::triggered,
|
connect(m_ui.actionAdvancedSettings, &QAction::triggered,
|
||||||
[this]() { doSettings(SettingsDialog::Category::AdvancedSettings); });
|
[this]() { doSettings(SettingsDialog::Category::AdvancedSettings); });
|
||||||
connect(m_ui.actionViewToolbar, &QAction::toggled, this, &MainWindow::onViewToolbarActionToggled);
|
connect(m_ui.actionViewToolbar, &QAction::toggled, this, &MainWindow::onViewToolbarActionToggled);
|
||||||
|
connect(m_ui.actionViewLockToolbar, &QAction::toggled, this, &MainWindow::onViewLockToolbarActionToggled);
|
||||||
connect(m_ui.actionViewStatusBar, &QAction::toggled, this, &MainWindow::onViewStatusBarActionToggled);
|
connect(m_ui.actionViewStatusBar, &QAction::toggled, this, &MainWindow::onViewStatusBarActionToggled);
|
||||||
connect(m_ui.actionViewGameList, &QAction::triggered, this, &MainWindow::onViewGameListActionTriggered);
|
connect(m_ui.actionViewGameList, &QAction::triggered, this, &MainWindow::onViewGameListActionTriggered);
|
||||||
connect(m_ui.actionViewGameGrid, &QAction::triggered, this, &MainWindow::onViewGameGridActionTriggered);
|
connect(m_ui.actionViewGameGrid, &QAction::triggered, this, &MainWindow::onViewGameGridActionTriggered);
|
||||||
|
|
|
@ -80,6 +80,7 @@ private Q_SLOTS:
|
||||||
void onCheatsMenuAboutToShow();
|
void onCheatsMenuAboutToShow();
|
||||||
void onRemoveDiscActionTriggered();
|
void onRemoveDiscActionTriggered();
|
||||||
void onViewToolbarActionToggled(bool checked);
|
void onViewToolbarActionToggled(bool checked);
|
||||||
|
void onViewLockToolbarActionToggled(bool checked);
|
||||||
void onViewStatusBarActionToggled(bool checked);
|
void onViewStatusBarActionToggled(bool checked);
|
||||||
void onViewGameListActionTriggered();
|
void onViewGameListActionTriggered();
|
||||||
void onViewGameGridActionTriggered();
|
void onViewGameGridActionTriggered();
|
||||||
|
|
|
@ -204,6 +204,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="actionViewToolbar"/>
|
<addaction name="actionViewToolbar"/>
|
||||||
|
<addaction name="actionViewLockToolbar"/>
|
||||||
<addaction name="actionViewStatusBar"/>
|
<addaction name="actionViewStatusBar"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionViewGameList"/>
|
<addaction name="actionViewGameList"/>
|
||||||
|
@ -732,6 +733,17 @@
|
||||||
<string>&Toolbar</string>
|
<string>&Toolbar</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionViewLockToolbar">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Lock Toolbar</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="actionViewStatusBar">
|
<action name="actionViewStatusBar">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
|
Loading…
Reference in a new issue