Skip to content

Commit

Permalink
Merge pull request #971 from FashionFreedom/issue-970-add-flag-icons-…
Browse files Browse the repository at this point in the history
…to-label-language-dropdown

feat: add flag icons to label language dropdown
  • Loading branch information
slspencer committed Jun 12, 2023
2 parents 2be514e + 4de494a commit a9c007d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ void PreferencesConfigurationPage::SetLabelComboBox(const QStringList &list)
for (int i = 0; i < list.size(); ++i)
{
QLocale loc = QLocale(list.at(i));
ui->labelCombo->addItem(loc.nativeLanguageName(), list.at(i));
QString country = QLocale::countryToString(loc.country());
QIcon ico(QString("%1/%2.png").arg(":/flags").arg(country));
ui->labelCombo->addItem(ico, loc.nativeLanguageName(), list.at(i));
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/libs/vmisc/share/resources/flags.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@
<file>flags/Poland.png</file>
<file>flags/Romania.png</file>
<file>flags/China.png</file>
<file>flags/Serbia.png</file>
<file>flags/Bosnia And Herzegowina.png</file>
<file>flags/Croatia.png</file>
</qresource>
</RCC>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/libs/vmisc/share/resources/flags/Croatia.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/libs/vmisc/share/resources/flags/Serbia.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a9c007d

Please sign in to comment.