diff options
| author | 2019-07-11 23:02:18 +0200 | |
|---|---|---|
| committer | 2019-09-04 16:47:33 +0200 | |
| commit | 053da44ecdc0ca2672d7a40b241c8abd2200638d (patch) | |
| tree | 7e5c66f82d8b74b66fa27491695c137edfb1834c /src | |
| parent | Change QList to QVector (diff) | |
| download | yuzu-053da44ecdc0ca2672d7a40b241c8abd2200638d.tar.gz yuzu-053da44ecdc0ca2672d7a40b241c8abd2200638d.tar.xz yuzu-053da44ecdc0ca2672d7a40b241c8abd2200638d.zip | |
Limit the size of directory icons, fix text when icon size is none
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/game_list.cpp | 3 | ||||
| -rw-r--r-- | 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() { | |||
| 230 | for (int i = 0; i < item_model->invisibleRootItem()->rowCount(); i++) { | 230 | for (int i = 0; i < item_model->invisibleRootItem()->rowCount(); i++) { |
| 231 | QStandardItem* child = item_model->invisibleRootItem()->child(i); | 231 | QStandardItem* child = item_model->invisibleRootItem()->child(i); |
| 232 | 232 | ||
| 233 | const int icon_size = UISettings::values.icon_size; | 233 | const int icon_size = std::min(static_cast<int>(UISettings::values.icon_size), 64); |
| 234 | switch (child->data(GameListItem::TypeRole).value<GameListItemType>()) { | 234 | switch (child->data(GameListItem::TypeRole).value<GameListItemType>()) { |
| 235 | case GameListItemType::SdmcDir: | 235 | case GameListItemType::SdmcDir: |
| 236 | child->setData( | 236 | child->setData( |
| @@ -300,7 +300,6 @@ GameList::GameList(FileSys::VirtualFilesystem vfs, FileSys::ManualContentProvide | |||
| 300 | tree_view->setHorizontalScrollMode(QHeaderView::ScrollPerPixel); | 300 | tree_view->setHorizontalScrollMode(QHeaderView::ScrollPerPixel); |
| 301 | tree_view->setSortingEnabled(true); | 301 | tree_view->setSortingEnabled(true); |
| 302 | tree_view->setEditTriggers(QHeaderView::NoEditTriggers); | 302 | tree_view->setEditTriggers(QHeaderView::NoEditTriggers); |
| 303 | tree_view->setUniformRowHeights(true); | ||
| 304 | tree_view->setContextMenuPolicy(Qt::CustomContextMenu); | 303 | tree_view->setContextMenuPolicy(Qt::CustomContextMenu); |
| 305 | tree_view->setStyleSheet(QStringLiteral("QTreeView{ border: none; }")); | 304 | tree_view->setStyleSheet(QStringLiteral("QTreeView{ border: none; }")); |
| 306 | 305 | ||
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: | |||
| 221 | UISettings::GameDir* game_dir = &directory; | 221 | UISettings::GameDir* game_dir = &directory; |
| 222 | setData(QVariant::fromValue(game_dir), GameDirRole); | 222 | setData(QVariant::fromValue(game_dir), GameDirRole); |
| 223 | 223 | ||
| 224 | const int icon_size = UISettings::values.icon_size; | 224 | const int icon_size = std::min(static_cast<int>(UISettings::values.icon_size), 64); |
| 225 | switch (dir_type) { | 225 | switch (dir_type) { |
| 226 | case GameListItemType::SdmcDir: | 226 | case GameListItemType::SdmcDir: |
| 227 | setData( | 227 | setData( |
| @@ -272,7 +272,7 @@ public: | |||
| 272 | explicit GameListAddDir() { | 272 | explicit GameListAddDir() { |
| 273 | setData(type(), TypeRole); | 273 | setData(type(), TypeRole); |
| 274 | 274 | ||
| 275 | const int icon_size = UISettings::values.icon_size; | 275 | const int icon_size = std::min(static_cast<int>(UISettings::values.icon_size), 64); |
| 276 | setData(QIcon::fromTheme(QStringLiteral("plus")) | 276 | setData(QIcon::fromTheme(QStringLiteral("plus")) |
| 277 | .pixmap(icon_size) | 277 | .pixmap(icon_size) |
| 278 | .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), | 278 | .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation), |