diff options
Diffstat (limited to 'src/citra_qt')
-rw-r--r-- | src/citra_qt/config.cpp | 2 | ||||
-rw-r--r-- | src/citra_qt/game_list.cpp | 1 | ||||
-rw-r--r-- | src/citra_qt/main.cpp | 16 | ||||
-rw-r--r-- | src/citra_qt/main.h | 6 | ||||
-rw-r--r-- | src/citra_qt/main.ui | 10 | ||||
-rw-r--r-- | src/citra_qt/ui_settings.h | 1 |
6 files changed, 35 insertions, 1 deletions
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index b65f57fdc..5fe57dfa2 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -146,6 +146,7 @@ void Config::ReadValues() { UISettings::values.single_window_mode = qt_config->value("singleWindowMode", true).toBool(); UISettings::values.display_titlebar = qt_config->value("displayTitleBars", true).toBool(); + UISettings::values.show_status_bar = qt_config->value("showStatusBar", true).toBool(); UISettings::values.confirm_before_closing = qt_config->value("confirmClose", true).toBool(); UISettings::values.first_start = qt_config->value("firstStart", true).toBool(); @@ -252,6 +253,7 @@ void Config::SaveValues() { qt_config->setValue("singleWindowMode", UISettings::values.single_window_mode); qt_config->setValue("displayTitleBars", UISettings::values.display_titlebar); + qt_config->setValue("showStatusBar", UISettings::values.show_status_bar); qt_config->setValue("confirmClose", UISettings::values.confirm_before_closing); qt_config->setValue("firstStart", UISettings::values.first_start); diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index 222c82b1c..f15083b0a 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -44,6 +44,7 @@ GameList::GameList(QWidget* parent) : QWidget{parent} { // with signals/slots. In this case, QList falls under the umbrells of custom types. qRegisterMetaType<QList<QStandardItem*>>("QList<QStandardItem*>"); + layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(tree_view); setLayout(layout); } diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 513da8001..43530b275 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -94,6 +94,17 @@ void GMainWindow::InitializeWidgets() { game_list = new GameList(); ui.horizontalLayout->addWidget(game_list); + + // Create status bar + emu_speed_label = new QLabel(); + game_fps_label = new QLabel(); + emu_frametime_label = new QLabel(); + + for (auto& label : {emu_speed_label, game_fps_label, emu_frametime_label}) { + label->setVisible(false); + statusBar()->addPermanentWidget(label); + } + statusBar()->setVisible(true); } void GMainWindow::InitializeDebugWidgets() { @@ -229,6 +240,9 @@ void GMainWindow::RestoreUIState() { ui.action_Display_Dock_Widget_Headers->setChecked(UISettings::values.display_titlebar); OnDisplayTitleBars(ui.action_Display_Dock_Widget_Headers->isChecked()); + + ui.action_Show_Status_Bar->setChecked(UISettings::values.show_status_bar); + statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); } void GMainWindow::ConnectWidgetEvents() { @@ -261,6 +275,7 @@ void GMainWindow::ConnectMenuEvents() { &GMainWindow::ToggleWindowMode); connect(ui.action_Display_Dock_Widget_Headers, &QAction::triggered, this, &GMainWindow::OnDisplayTitleBars); + connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); } void GMainWindow::OnDisplayTitleBars(bool show) { @@ -624,6 +639,7 @@ void GMainWindow::closeEvent(QCloseEvent* event) { #endif UISettings::values.single_window_mode = ui.action_Single_Window_Mode->isChecked(); UISettings::values.display_titlebar = ui.action_Display_Dock_Widget_Headers->isChecked(); + UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked(); UISettings::values.first_start = false; game_list->SaveInterfaceLayout(); diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 87637b92b..3cbf4ea99 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -132,12 +132,18 @@ private: GRenderWindow* render_window; GameList* game_list; + // Status bar elements + QLabel* emu_speed_label = nullptr; + QLabel* game_fps_label = nullptr; + QLabel* emu_frametime_label = nullptr; + std::unique_ptr<Config> config; // Whether emulation is currently running in Citra. bool emulation_running = false; std::unique_ptr<EmuThread> emu_thread; + // Debugger panes ProfilerWidget* profilerWidget; MicroProfileDialog* microProfileDialog; DisassemblerWidget* disasmWidget; diff --git a/src/citra_qt/main.ui b/src/citra_qt/main.ui index 4a95cda9a..47dbb6ef7 100644 --- a/src/citra_qt/main.ui +++ b/src/citra_qt/main.ui @@ -88,6 +88,7 @@ </widget> <addaction name="action_Single_Window_Mode"/> <addaction name="action_Display_Dock_Widget_Headers"/> + <addaction name="action_Show_Status_Bar"/> <addaction name="menu_View_Debugging"/> </widget> <widget class="QMenu" name="menu_Help"> @@ -101,7 +102,6 @@ <addaction name="menu_View"/> <addaction name="menu_Help"/> </widget> - <widget class="QStatusBar" name="statusbar"/> <action name="action_Load_File"> <property name="text"> <string>Load File...</string> @@ -167,6 +167,14 @@ <string>Display Dock Widget Headers</string> </property> </action> + <action name="action_Show_Status_Bar"> + <property name="checkable"> + <bool>true</bool> + </property> + <property name="text"> + <string>Show Status Bar</string> + </property> + </action> <action name="action_Select_Game_List_Root"> <property name="text"> <string>Select Game Directory...</string> diff --git a/src/citra_qt/ui_settings.h b/src/citra_qt/ui_settings.h index ed7fdff7e..6408ece2b 100644 --- a/src/citra_qt/ui_settings.h +++ b/src/citra_qt/ui_settings.h @@ -27,6 +27,7 @@ struct Values { bool single_window_mode; bool display_titlebar; + bool show_status_bar; bool confirm_before_closing; bool first_start; |