Qt: Add 'Lock Toolbar' option
This commit is contained in:
parent
32ee362228
commit
e75f1c1b6d
|
@ -502,6 +502,12 @@ void MainWindow::onViewToolbarActionToggled(bool checked)
|
|||
saveStateToConfig();
|
||||
}
|
||||
|
||||
void MainWindow::onViewLockToolbarActionToggled(bool checked)
|
||||
{
|
||||
m_host_interface->SetBoolSettingValue("UI", "LockToolbar", checked);
|
||||
m_ui.toolBar->setMovable(!checked);
|
||||
}
|
||||
|
||||
void MainWindow::onViewStatusBarActionToggled(bool checked)
|
||||
{
|
||||
m_host_interface->SetBoolSettingValue("UI", "ShowStatusBar", checked);
|
||||
|
@ -730,6 +736,11 @@ void MainWindow::setupAdditionalUi()
|
|||
m_ui.actionViewStatusBar->setChecked(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->initialize(m_host_interface);
|
||||
m_ui.mainContainer->insertWidget(0, m_game_list_widget);
|
||||
|
@ -990,6 +1001,7 @@ void MainWindow::connectSignals()
|
|||
connect(m_ui.actionAdvancedSettings, &QAction::triggered,
|
||||
[this]() { doSettings(SettingsDialog::Category::AdvancedSettings); });
|
||||
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.actionViewGameList, &QAction::triggered, this, &MainWindow::onViewGameListActionTriggered);
|
||||
connect(m_ui.actionViewGameGrid, &QAction::triggered, this, &MainWindow::onViewGameGridActionTriggered);
|
||||
|
|
|
@ -80,6 +80,7 @@ private Q_SLOTS:
|
|||
void onCheatsMenuAboutToShow();
|
||||
void onRemoveDiscActionTriggered();
|
||||
void onViewToolbarActionToggled(bool checked);
|
||||
void onViewLockToolbarActionToggled(bool checked);
|
||||
void onViewStatusBarActionToggled(bool checked);
|
||||
void onViewGameListActionTriggered();
|
||||
void onViewGameGridActionTriggered();
|
||||
|
|
|
@ -204,6 +204,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
<addaction name="actionViewToolbar"/>
|
||||
<addaction name="actionViewLockToolbar"/>
|
||||
<addaction name="actionViewStatusBar"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionViewGameList"/>
|
||||
|
@ -732,6 +733,17 @@
|
|||
<string>&Toolbar</string>
|
||||
</property>
|
||||
</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">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
|
|
Loading…
Reference in New Issue