Fix Game List Mode (#1591)

This commit is contained in:
¥IGA 2024-11-25 13:26:40 +01:00 committed by GitHub
parent 20b4cd2a32
commit ff18b89e66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View file

@ -102,6 +102,7 @@ void MainWindow::CreateActions() {
m_list_mode_act_group = new QActionGroup(this);
m_list_mode_act_group->addAction(ui->setlistModeListAct);
m_list_mode_act_group->addAction(ui->setlistModeGridAct);
m_list_mode_act_group->addAction(ui->setlistElfAct);
// create action group for themes
m_theme_act_group = new QActionGroup(this);
@ -362,7 +363,7 @@ void MainWindow::CreateConnects() {
ui->sizeSlider->setEnabled(true);
ui->sizeSlider->setSliderPosition(slider_pos_grid);
});
// Elf
// Elf Viewer
connect(ui->setlistElfAct, &QAction::triggered, m_dock_widget.data(), [this]() {
BackgroundMusicPlayer::getInstance().stopMusic();
m_dock_widget->setWidget(m_elf_viewer.data());
@ -622,10 +623,12 @@ void MainWindow::ConfigureGuiFromSettings() {
Config::getMainWindowGeometryW(), Config::getMainWindowGeometryH());
ui->showGameListAct->setChecked(true);
if (isTableList) {
if (Config::getTableMode() == 0) {
ui->setlistModeListAct->setChecked(true);
} else {
} else if (Config::getTableMode() == 1) {
ui->setlistModeGridAct->setChecked(true);
} else if (Config::getTableMode() == 2) {
ui->setlistElfAct->setChecked(true);
}
BackgroundMusicPlayer::getInstance().setVolume(Config::getBGMvolume());
}

View file

@ -110,15 +110,14 @@ public:
setIconSizeLargeAct->setCheckable(true);
setlistModeListAct = new QAction(MainWindow);
setlistModeListAct->setObjectName("setlistModeListAct");
setlistModeListAct->setCheckable(true);
setlistModeListAct->setChecked(true);
setlistModeListAct->setIcon(QIcon(":images/list_icon.png"));
setlistModeListAct->setCheckable(true);
setlistModeGridAct = new QAction(MainWindow);
setlistModeGridAct->setObjectName("setlistModeGridAct");
setlistModeGridAct->setCheckable(true);
setlistModeGridAct->setIcon(QIcon(":images/grid_icon.png"));
setlistModeGridAct->setCheckable(true);
setlistElfAct = new QAction(MainWindow);
setlistElfAct->setObjectName("setlistModeGridAct");
setlistElfAct->setObjectName("setlistElfAct");
setlistElfAct->setCheckable(true);
gameInstallPathAct = new QAction(MainWindow);
gameInstallPathAct->setObjectName("gameInstallPathAct");