citra_qt: Add single line mode for game list
This single line mode is aimed at restoring the intended behavior with Small or None icons. Line breaks will be replaced with commas (Region row) or spaces (Name row). One can toggle this option in UI configuration.
This commit is contained in:
parent
b078122167
commit
4144f4480d
5 changed files with 21 additions and 2 deletions
|
@ -104,9 +104,11 @@ static QString GetRegionFromSMDH(const Loader::SMDH& smdh) {
|
|||
return QObject::tr("All regions");
|
||||
}
|
||||
|
||||
const QString separator =
|
||||
UISettings::values.game_list_single_line_mode ? QStringLiteral(", ") : QStringLiteral("\n");
|
||||
QString result = QObject::tr(regions_map.at(regions.front()));
|
||||
for (auto region = ++regions.begin(); region != regions.end(); ++region) {
|
||||
result += QStringLiteral("\n") + QObject::tr(regions_map.at(*region));
|
||||
result += separator + QObject::tr(regions_map.at(*region));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -200,7 +202,12 @@ public:
|
|||
QString row2;
|
||||
auto row_2_id = UISettings::values.game_list_row_2;
|
||||
if (row_2_id != UISettings::GameListText::NoText) {
|
||||
row2 = (row1.isEmpty() ? "" : "\n ") + display_texts.at(row_2_id);
|
||||
if (!row1.isEmpty()) {
|
||||
row2 = UISettings::values.game_list_single_line_mode
|
||||
? QStringLiteral(" ")
|
||||
: QStringLiteral("\n ");
|
||||
}
|
||||
row2 += display_texts.at(row_2_id);
|
||||
}
|
||||
return QString(row1 + row2);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue