mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-01 15:08:57 +02:00
[desktop] Add icon-only mode to grid and improve design (#3485)
- Move Game Icon Size to the main toolbar. It's cleaner that way - Add a "Show Game Name" toggle that does as it says. Disabling it basically creates an "icons-only" mode. Useful for controller-only nav with big icons (TODO: maybe make a 192 size?) - Fixed a crash with controller nav. Oops - Rounded corners of the game icon in grid mode - Fixed the scroll bar creating extra clamping range on the grid icons - Item can be deselected if user clicks on the blank space outside of the view As a bonus fixed a crash on mod manager Future TODOs for design: - [ ] Row 1 type. Not sure what to do here tbh. - [ ] Move around game list settings in configure_ui to make it clear that nothing there affects the grid view. - [ ] 192x192 size? 256 feels too big on my 1440p screen whereas 128 feels too small. - Set text space as a function of fontMetrics. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3485 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com>
This commit is contained in:
parent
e10f55d9db
commit
ca9f2d43be
13 changed files with 273 additions and 130 deletions
|
|
@ -161,14 +161,14 @@ void ConfigurePerGameAddons::InstallMods(const QStringList& mods) {
|
|||
}
|
||||
}
|
||||
|
||||
void ConfigurePerGameAddons::InstallModPath(const QString& path) {
|
||||
const auto mods = QtCommon::Mod::GetModFolders(path, {});
|
||||
void ConfigurePerGameAddons::InstallModPath(const QString& path, const QString &fallbackName) {
|
||||
const auto mods = QtCommon::Mod::GetModFolders(path, fallbackName);
|
||||
|
||||
if (mods.size() > 1) {
|
||||
ModSelectDialog* dialog = new ModSelectDialog(mods, this);
|
||||
connect(dialog, &ModSelectDialog::modsSelected, this, &ConfigurePerGameAddons::InstallMods);
|
||||
dialog->show();
|
||||
} else {
|
||||
} else if (!mods.empty()) {
|
||||
InstallMods(mods);
|
||||
}
|
||||
}
|
||||
|
|
@ -194,7 +194,7 @@ void ConfigurePerGameAddons::InstallModZip() {
|
|||
|
||||
const QString extracted = QtCommon::Mod::ExtractMod(path);
|
||||
if (!extracted.isEmpty())
|
||||
InstallModPath(extracted);
|
||||
InstallModPath(extracted, QFileInfo(path).baseName());
|
||||
}
|
||||
|
||||
void ConfigurePerGameAddons::changeEvent(QEvent* event) {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
public slots:
|
||||
void InstallMods(const QStringList &mods);
|
||||
void InstallModPath(const QString& path);
|
||||
void InstallModPath(const QString& path, const QString& fallbackName = {});
|
||||
|
||||
void InstallModFolder();
|
||||
void InstallModZip();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "yuzu/configuration/configure_ui.h"
|
||||
|
|
@ -6,7 +6,6 @@
|
|||
#include <array>
|
||||
#include <cstdlib>
|
||||
#include <set>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
|
|
@ -21,7 +20,6 @@
|
|||
|
||||
#include "common/common_types.h"
|
||||
#include "common/fs/path_util.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "common/settings.h"
|
||||
#include "common/settings_enums.h"
|
||||
#include "core/core.h"
|
||||
|
|
@ -32,13 +30,6 @@
|
|||
#include "qt_common/config/uisettings.h"
|
||||
|
||||
namespace {
|
||||
constexpr std::array default_game_icon_sizes{
|
||||
std::make_pair(0, QT_TRANSLATE_NOOP("ConfigureUI", "None")),
|
||||
std::make_pair(32, QT_TRANSLATE_NOOP("ConfigureUI", "Small (32x32)")),
|
||||
std::make_pair(64, QT_TRANSLATE_NOOP("ConfigureUI", "Standard (64x64)")),
|
||||
std::make_pair(128, QT_TRANSLATE_NOOP("ConfigureUI", "Large (128x128)")),
|
||||
std::make_pair(256, QT_TRANSLATE_NOOP("ConfigureUI", "Full Size (256x256)")),
|
||||
};
|
||||
|
||||
constexpr std::array default_folder_icon_sizes{
|
||||
std::make_pair(0, QT_TRANSLATE_NOOP("ConfigureUI", "None")),
|
||||
|
|
@ -57,10 +48,6 @@ constexpr std::array row_text_names{
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
QString GetTranslatedGameIconSize(size_t index) {
|
||||
return QCoreApplication::translate("ConfigureUI", default_game_icon_sizes[index].second);
|
||||
}
|
||||
|
||||
QString GetTranslatedFolderIconSize(size_t index) {
|
||||
return QCoreApplication::translate("ConfigureUI", default_folder_icon_sizes[index].second);
|
||||
}
|
||||
|
|
@ -127,8 +114,6 @@ ConfigureUi::ConfigureUi(Core::System& system_, QWidget* parent)
|
|||
connect(ui->show_types, &QCheckBox::STATE_CHANGED, this, &ConfigureUi::RequestGameListUpdate);
|
||||
connect(ui->show_play_time, &QCheckBox::STATE_CHANGED, this,
|
||||
&ConfigureUi::RequestGameListUpdate);
|
||||
connect(ui->game_icon_size_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
&ConfigureUi::RequestGameListUpdate);
|
||||
connect(ui->folder_icon_size_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &ConfigureUi::RequestGameListUpdate);
|
||||
connect(ui->row_1_text_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
|
|
@ -172,7 +157,6 @@ void ConfigureUi::ApplyConfiguration() {
|
|||
UISettings::values.show_size = ui->show_size->isChecked();
|
||||
UISettings::values.show_types = ui->show_types->isChecked();
|
||||
UISettings::values.show_play_time = ui->show_play_time->isChecked();
|
||||
UISettings::values.game_icon_size = ui->game_icon_size_combobox->currentData().toUInt();
|
||||
UISettings::values.folder_icon_size = ui->folder_icon_size_combobox->currentData().toUInt();
|
||||
UISettings::values.row_1_text_id = ui->row_1_text_combobox->currentData().toUInt();
|
||||
UISettings::values.row_2_text_id = ui->row_2_text_combobox->currentData().toUInt();
|
||||
|
|
@ -202,8 +186,6 @@ void ConfigureUi::SetConfiguration() {
|
|||
ui->show_size->setChecked(UISettings::values.show_size.GetValue());
|
||||
ui->show_types->setChecked(UISettings::values.show_types.GetValue());
|
||||
ui->show_play_time->setChecked(UISettings::values.show_play_time.GetValue());
|
||||
ui->game_icon_size_combobox->setCurrentIndex(
|
||||
ui->game_icon_size_combobox->findData(UISettings::values.game_icon_size.GetValue()));
|
||||
ui->folder_icon_size_combobox->setCurrentIndex(
|
||||
ui->folder_icon_size_combobox->findData(UISettings::values.folder_icon_size.GetValue()));
|
||||
|
||||
|
|
@ -231,11 +213,6 @@ void ConfigureUi::changeEvent(QEvent* event) {
|
|||
void ConfigureUi::RetranslateUI() {
|
||||
ui->retranslateUi(this);
|
||||
|
||||
for (int i = 0; i < ui->game_icon_size_combobox->count(); i++) {
|
||||
ui->game_icon_size_combobox->setItemText(i,
|
||||
GetTranslatedGameIconSize(static_cast<size_t>(i)));
|
||||
}
|
||||
|
||||
for (int i = 0; i < ui->folder_icon_size_combobox->count(); i++) {
|
||||
ui->folder_icon_size_combobox->setItemText(
|
||||
i, GetTranslatedFolderIconSize(static_cast<size_t>(i)));
|
||||
|
|
@ -270,10 +247,6 @@ void ConfigureUi::InitializeLanguageComboBox() {
|
|||
}
|
||||
|
||||
void ConfigureUi::InitializeIconSizeComboBox() {
|
||||
for (size_t i = 0; i < default_game_icon_sizes.size(); i++) {
|
||||
const auto size = default_game_icon_sizes[i].first;
|
||||
ui->game_icon_size_combobox->addItem(GetTranslatedGameIconSize(i), size);
|
||||
}
|
||||
for (size_t i = 0; i < default_folder_icon_sizes.size(); i++) {
|
||||
const auto size = default_folder_icon_sizes[i].first;
|
||||
ui->folder_icon_size_combobox->addItem(GetTranslatedFolderIconSize(i), size);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>363</width>
|
||||
<height>603</height>
|
||||
<height>613</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -111,20 +111,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="game_icon_size_qhbox_layout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="game_icon_size_label">
|
||||
<property name="text">
|
||||
<string>Game Icon Size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="game_icon_size_combobox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="folder_icon_size_qhbox_layout_2">
|
||||
<item>
|
||||
|
|
@ -221,7 +207,7 @@
|
|||
<string>TextLabel</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -251,7 +237,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue