Qt: Add toggles for toolbar/status bar
This commit is contained in:
parent
c3ce9135bf
commit
5fca2d1d1c
|
@ -310,6 +310,34 @@ void MainWindow::onRemoveDiscActionTriggered()
|
|||
m_host_interface->changeDisc(QString());
|
||||
}
|
||||
|
||||
void MainWindow::onViewToolbarActionToggled(bool checked)
|
||||
{
|
||||
m_host_interface->SetBoolSettingValue("UI", "ShowToolbar", checked);
|
||||
m_ui.toolBar->setVisible(checked);
|
||||
}
|
||||
|
||||
void MainWindow::onViewStatusBarActionToggled(bool checked)
|
||||
{
|
||||
m_host_interface->SetBoolSettingValue("UI", "ShowStatusBar", checked);
|
||||
m_ui.statusBar->setVisible(checked);
|
||||
}
|
||||
|
||||
void MainWindow::onViewGameListActionTriggered()
|
||||
{
|
||||
if (m_emulation_running)
|
||||
m_host_interface->pauseSystem(true);
|
||||
switchToGameListView();
|
||||
}
|
||||
|
||||
void MainWindow::onViewSystemDisplayTriggered()
|
||||
{
|
||||
if (m_emulation_running)
|
||||
{
|
||||
switchToEmulationView();
|
||||
m_host_interface->pauseSystem(false);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onGitHubRepositoryActionTriggered()
|
||||
{
|
||||
QtUtils::OpenURL(this, "https://github.com/stenzek/duckstation/");
|
||||
|
@ -431,6 +459,14 @@ void MainWindow::setupAdditionalUi()
|
|||
{
|
||||
setWindowTitle(getWindowTitle());
|
||||
|
||||
const bool toolbar_visible = m_host_interface->GetBoolSettingValue("UI", "ShowToolbar", true);
|
||||
m_ui.actionViewToolbar->setChecked(toolbar_visible);
|
||||
m_ui.toolBar->setVisible(toolbar_visible);
|
||||
|
||||
const bool status_bar_visible = m_host_interface->GetBoolSettingValue("UI", "ShowStatusBar", true);
|
||||
m_ui.actionViewStatusBar->setChecked(status_bar_visible);
|
||||
m_ui.statusBar->setVisible(status_bar_visible);
|
||||
|
||||
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);
|
||||
|
@ -509,6 +545,7 @@ void MainWindow::updateEmulationActions(bool starting, bool running)
|
|||
m_ui.actionPause->setDisabled(starting || !running);
|
||||
m_ui.actionChangeDisc->setDisabled(starting || !running);
|
||||
m_ui.actionScreenshot->setDisabled(starting || !running);
|
||||
m_ui.actionViewSystemDisplay->setEnabled(starting || running);
|
||||
m_ui.menuChangeDisc->setDisabled(starting || !running);
|
||||
|
||||
m_ui.actionSaveState->setDisabled(starting || !running);
|
||||
|
@ -617,6 +654,10 @@ void MainWindow::connectSignals()
|
|||
[this]() { doSettings(SettingsDialog::Category::AudioSettings); });
|
||||
connect(m_ui.actionAdvancedSettings, &QAction::triggered,
|
||||
[this]() { doSettings(SettingsDialog::Category::AdvancedSettings); });
|
||||
connect(m_ui.actionViewToolbar, &QAction::toggled, this, &MainWindow::onViewToolbarActionToggled);
|
||||
connect(m_ui.actionViewStatusBar, &QAction::toggled, this, &MainWindow::onViewStatusBarActionToggled);
|
||||
connect(m_ui.actionViewGameList, &QAction::triggered, this, &MainWindow::onViewGameListActionTriggered);
|
||||
connect(m_ui.actionViewSystemDisplay, &QAction::triggered, this, &MainWindow::onViewSystemDisplayTriggered);
|
||||
connect(m_ui.actionGitHubRepository, &QAction::triggered, this, &MainWindow::onGitHubRepositoryActionTriggered);
|
||||
connect(m_ui.actionIssueTracker, &QAction::triggered, this, &MainWindow::onIssueTrackerActionTriggered);
|
||||
connect(m_ui.actionDiscordServer, &QAction::triggered, this, &MainWindow::onDiscordServerActionTriggered);
|
||||
|
|
|
@ -62,6 +62,10 @@ private Q_SLOTS:
|
|||
void onChangeDiscFromPlaylistMenuAboutToShow();
|
||||
void onChangeDiscFromPlaylistMenuAboutToHide();
|
||||
void onRemoveDiscActionTriggered();
|
||||
void onViewToolbarActionToggled(bool checked);
|
||||
void onViewStatusBarActionToggled(bool checked);
|
||||
void onViewGameListActionTriggered();
|
||||
void onViewSystemDisplayTriggered();
|
||||
void onGitHubRepositoryActionTriggered();
|
||||
void onIssueTrackerActionTriggered();
|
||||
void onDiscordServerActionTriggered();
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>754</width>
|
||||
<height>22</height>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuSystem">
|
||||
|
@ -161,8 +161,19 @@
|
|||
<addaction name="actionDebugShowTimersState"/>
|
||||
<addaction name="actionDebugShowMDECState"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_View">
|
||||
<property name="title">
|
||||
<string>&View</string>
|
||||
</property>
|
||||
<addaction name="actionViewToolbar"/>
|
||||
<addaction name="actionViewStatusBar"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionViewGameList"/>
|
||||
<addaction name="actionViewSystemDisplay"/>
|
||||
</widget>
|
||||
<addaction name="menuSystem"/>
|
||||
<addaction name="menuSettings"/>
|
||||
<addaction name="menu_View"/>
|
||||
<addaction name="menuDebug"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
|
@ -560,6 +571,41 @@
|
|||
<string>Resumes the last save state created.</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewToolbar">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Toolbar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewStatusBar">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Status Bar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewGameList">
|
||||
<property name="text">
|
||||
<string>&Game List</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionViewSystemDisplay">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>System &Display</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="resources/icons.qrc"/>
|
||||
|
|
Loading…
Reference in New Issue