The folder icon for the gamelistInfo field is now placed according to the selected alignment.

This commit is contained in:
Leon Styhre 2021-03-21 11:59:53 +01:00
parent d90f29b931
commit 26b593455e
3 changed files with 15 additions and 3 deletions

View file

@ -358,8 +358,9 @@ void DetailedGameListView::updateInfoPanel()
// If a filter has been applied, then the number of filtered and total games replaces // If a filter has been applied, then the number of filtered and total games replaces
// the game counter. // the game counter.
std::string gamelistInfoString; std::string gamelistInfoString;
Alignment infoAlign = mGamelistInfo.getHorizontalAlignment();
if (mIsFolder) if (mIsFolder && infoAlign == ALIGN_RIGHT)
gamelistInfoString = ViewController::FOLDER_CHAR + " "; gamelistInfoString = ViewController::FOLDER_CHAR + " ";
if (mIsFiltered) { if (mIsFiltered) {
@ -382,6 +383,9 @@ void DetailedGameListView::updateInfoPanel()
+ std::to_string(mFavoritesGameCount); + std::to_string(mFavoritesGameCount);
} }
if (mIsFolder && infoAlign != ALIGN_RIGHT)
gamelistInfoString += " " + ViewController::FOLDER_CHAR;
mGamelistInfo.setValue(gamelistInfoString); mGamelistInfo.setValue(gamelistInfoString);
// Fade in the game image. // Fade in the game image.

View file

@ -458,6 +458,10 @@ void GridGameListView::updateInfoPanel()
// If a filter has been applied, then the number of filtered and total games replaces // If a filter has been applied, then the number of filtered and total games replaces
// the game counter. // the game counter.
std::string gamelistInfoString; std::string gamelistInfoString;
Alignment infoAlign = mGamelistInfo.getHorizontalAlignment();
if (mIsFolder && infoAlign == ALIGN_RIGHT)
gamelistInfoString = ViewController::FOLDER_CHAR + " ";
if (mIsFiltered) { if (mIsFiltered) {
if (mFilteredGameCountAll == mFilteredGameCount) if (mFilteredGameCountAll == mFilteredGameCount)
@ -478,7 +482,7 @@ void GridGameListView::updateInfoPanel()
std::to_string(mFavoritesGameCount); std::to_string(mFavoritesGameCount);
} }
if (mIsFolder) if (mIsFolder && infoAlign != ALIGN_RIGHT)
gamelistInfoString += " " + ViewController::FOLDER_CHAR; gamelistInfoString += " " + ViewController::FOLDER_CHAR;
mGamelistInfo.setValue(gamelistInfoString); mGamelistInfo.setValue(gamelistInfoString);

View file

@ -401,8 +401,9 @@ void VideoGameListView::updateInfoPanel()
// If a filter has been applied, then the number of filtered and total games replaces // If a filter has been applied, then the number of filtered and total games replaces
// the game counter. // the game counter.
std::string gamelistInfoString; std::string gamelistInfoString;
Alignment infoAlign = mGamelistInfo.getHorizontalAlignment();
if (mIsFolder) if (mIsFolder && infoAlign == ALIGN_RIGHT)
gamelistInfoString = ViewController::FOLDER_CHAR + " "; gamelistInfoString = ViewController::FOLDER_CHAR + " ";
if (mIsFiltered) { if (mIsFiltered) {
@ -425,6 +426,9 @@ void VideoGameListView::updateInfoPanel()
+ std::to_string(mFavoritesGameCount); + std::to_string(mFavoritesGameCount);
} }
if (mIsFolder && infoAlign != ALIGN_RIGHT)
gamelistInfoString += " " + ViewController::FOLDER_CHAR;
mGamelistInfo.setValue(gamelistInfoString); mGamelistInfo.setValue(gamelistInfoString);
// Fade in the game image. // Fade in the game image.