From 053da44ecdc0ca2672d7a40b241c8abd2200638d Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Thu, 11 Jul 2019 23:02:18 +0200 Subject: Limit the size of directory icons, fix text when icon size is none --- src/yuzu/game_list.cpp | 3 +-- src/yuzu/game_list_p.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index c525d3f17..d5fab2f1f 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -230,7 +230,7 @@ void GameList::onUpdateThemedIcons() { for (int i = 0; i < item_model->invisibleRootItem()->rowCount(); i++) { QStandardItem* child = item_model->invisibleRootItem()->child(i); - const int icon_size = UISettings::values.icon_size; + const int icon_size = std::min(static_cast(UISettings::values.icon_size), 64); switch (child->data(GameListItem::TypeRole).value()) { case GameListItemType::SdmcDir: child->setData( @@ -300,7 +300,6 @@ GameList::GameList(FileSys::VirtualFilesystem vfs, FileSys::ManualContentProvide tree_view->setHorizontalScrollMode(QHeaderView::ScrollPerPixel); tree_view->setSortingEnabled(true); tree_view->setEditTriggers(QHeaderView::NoEditTriggers); - tree_view->setUniformRowHeights(true); tree_view->setContextMenuPolicy(Qt::CustomContextMenu); tree_view->setStyleSheet(QStringLiteral("QTreeView{ border: none; }")); diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 87eb71c17..a8d888fee 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -221,7 +221,7 @@ public: UISettings::GameDir* game_dir = &directory; setData(QVariant::fromValue(game_dir), GameDirRole); - const int icon_size = UISettings::values.icon_size; + const int icon_size = std::min(static_cast(UISettings::values.icon_size), 64); switch (dir_type) { case GameListItemType::SdmcDir: setData( @@ -272,7 +272,7 @@ public: explicit GameListAddDir() { setData(type(), TypeRole); - const int icon_size = UISettings::values.icon_size; + const int icon_size = std::min(static_cast(UISettings::values.icon_size), 64); setData(QIcon::fromTheme(QStringLiteral("plus")) .pixmap(icon_size) .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), -- cgit v1.2.3