mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-09 22:53:32 +00:00
[desktop] Add basic carousel view (#4112)
Adds a basic carousel view, or essentially a horizontal list a la Android/Qt Quick. Lacks a lot of niceties like autoscroll, smooth shifts, etc. Will work on those later Also fixed a bug introduced recently that capped game icon size to 8 at the low end, breaking the None option Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4112 Reviewed-by: MaranBr <maranbr@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Reviewed-by: Lizzie <lizzie@eden-emu.dev>
This commit is contained in:
@@ -1529,6 +1529,7 @@ void MainWindow::ConnectMenuEvents() {
|
||||
|
||||
connect_menu(ui->action_Grid_View, &MainWindow::SetGridView);
|
||||
connect_menu(ui->action_Tree_View, &MainWindow::SetTreeView);
|
||||
connect_menu(ui->action_Carousel_View, &MainWindow::SetCarouselView);
|
||||
|
||||
game_size_actions = new QActionGroup(this);
|
||||
game_size_actions->setExclusive(true);
|
||||
@@ -3317,9 +3318,10 @@ void MainWindow::ResetWindowSize1080() {
|
||||
void MainWindow::SetGameListMode(Settings::GameListMode mode) {
|
||||
ui->action_Grid_View->setChecked(mode == Settings::GameListMode::GridView);
|
||||
ui->action_Tree_View->setChecked(mode == Settings::GameListMode::TreeView);
|
||||
ui->action_Carousel_View->setChecked(mode == Settings::GameListMode::CarouselView);
|
||||
|
||||
UISettings::values.game_list_mode = mode;
|
||||
ui->action_Show_Game_Name->setEnabled(mode == Settings::GameListMode::GridView);
|
||||
ui->action_Show_Game_Name->setEnabled(mode != Settings::GameListMode::TreeView);
|
||||
|
||||
CheckIconSize();
|
||||
game_list->ResetViewMode();
|
||||
@@ -3333,11 +3335,15 @@ void MainWindow::SetTreeView() {
|
||||
SetGameListMode(Settings::GameListMode::TreeView);
|
||||
}
|
||||
|
||||
void MainWindow::SetCarouselView() {
|
||||
SetGameListMode(Settings::GameListMode::CarouselView);
|
||||
}
|
||||
|
||||
void MainWindow::CheckIconSize() {
|
||||
// When in grid view mode, with text off
|
||||
// there is no point in having icons turned off..
|
||||
// When in grid/carousel view mode, with text off
|
||||
// there is no point in having icons turned off
|
||||
auto actions = game_size_actions->actions();
|
||||
if (UISettings::values.game_list_mode.GetValue() == Settings::GameListMode::GridView &&
|
||||
if (UISettings::values.game_list_mode.GetValue() != Settings::GameListMode::TreeView &&
|
||||
!UISettings::values.show_game_name.GetValue()) {
|
||||
u32 newSize = UISettings::values.game_icon_size.GetValue();
|
||||
if (newSize == 0) {
|
||||
|
||||
Reference in New Issue
Block a user