summaryrefslogtreecommitdiffstats
path: root/src/citra_qt/main.cpp
diff options
context:
space:
mode:
authorNico Bosshard <nico@bosshome.ch>2017-04-30 04:04:39 +0200
committerbunnei <bunneidev@gmail.com>2017-04-30 04:04:39 +0200
commit06d4654966ba9909111b1bab36e88f4f15e9cb6d (patch)
tree30517eaa10e6b704fe008c2bb2f704f6cec35178 /src/citra_qt/main.cpp
parentMerge pull request #2671 from wwylele/dot3-rgba (diff)
downloadyuzu-06d4654966ba9909111b1bab36e88f4f15e9cb6d.tar
yuzu-06d4654966ba9909111b1bab36e88f4f15e9cb6d.tar.gz
yuzu-06d4654966ba9909111b1bab36e88f4f15e9cb6d.tar.bz2
yuzu-06d4654966ba9909111b1bab36e88f4f15e9cb6d.tar.lz
yuzu-06d4654966ba9909111b1bab36e88f4f15e9cb6d.tar.xz
yuzu-06d4654966ba9909111b1bab36e88f4f15e9cb6d.tar.zst
yuzu-06d4654966ba9909111b1bab36e88f4f15e9cb6d.zip
Diffstat (limited to '')
-rw-r--r--src/citra_qt/main.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index b17ed6968..ea66cc425 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -93,7 +93,7 @@ void GMainWindow::InitializeWidgets() {
render_window = new GRenderWindow(this, emu_thread.get());
render_window->hide();
- game_list = new GameList();
+ game_list = new GameList(this);
ui.horizontalLayout->addWidget(game_list);
// Create status bar
@@ -247,6 +247,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_Filter_Bar->setChecked(UISettings::values.show_filter_bar);
+ game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked());
+
ui.action_Show_Status_Bar->setChecked(UISettings::values.show_status_bar);
statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked());
}
@@ -283,6 +286,8 @@ void GMainWindow::ConnectMenuEvents() {
&GMainWindow::ToggleWindowMode);
connect(ui.action_Display_Dock_Widget_Headers, &QAction::triggered, this,
&GMainWindow::OnDisplayTitleBars);
+ ui.action_Show_Filter_Bar->setShortcut(tr("CTRL+F"));
+ connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar);
connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible);
}
@@ -444,6 +449,7 @@ void GMainWindow::ShutdownGame() {
ui.action_Stop->setEnabled(false);
render_window->hide();
game_list->show();
+ game_list->setFilterFocus();
// Disable status bar updates
status_bar_update_timer.stop();
@@ -617,6 +623,15 @@ void GMainWindow::OnConfigure() {
}
}
+void GMainWindow::OnToggleFilterBar() {
+ game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked());
+ if (ui.action_Show_Filter_Bar->isChecked()) {
+ game_list->setFilterFocus();
+ } else {
+ game_list->clearFilter();
+ }
+}
+
void GMainWindow::OnSwapScreens() {
Settings::values.swap_screen = !Settings::values.swap_screen;
Settings::Apply();
@@ -671,6 +686,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_filter_bar = ui.action_Show_Filter_Bar->isChecked();
UISettings::values.show_status_bar = ui.action_Show_Status_Bar->isChecked();
UISettings::values.first_start = false;
@@ -720,6 +736,11 @@ bool GMainWindow::ConfirmChangeGame() {
return answer != QMessageBox::No;
}
+void GMainWindow::filterBarSetChecked(bool state) {
+ ui.action_Show_Filter_Bar->setChecked(state);
+ emit(OnToggleFilterBar());
+}
+
#ifdef main
#undef main
#endif