Skip to content

Commit

Permalink
Preferences: Fixed style changing to native when switching language
Browse files Browse the repository at this point in the history
Was a problem with the way the translated values of the style combo box
were being updated.
  • Loading branch information
bjorn committed Aug 15, 2016
1 parent 7f28109 commit 8690582
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
9 changes: 9 additions & 0 deletions src/tiled/preferencesdialog.cpp
Expand Up @@ -61,6 +61,11 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
mUi->languageCombo->model()->sort(0);
mUi->languageCombo->insertItem(0, tr("System default"));

mUi->styleCombo->addItems(QStringList()
<< QApplication::translate("PreferencesDialog", "Native")
<< QApplication::translate("PreferencesDialog", "Fusion")
<< QApplication::translate("PreferencesDialog", "Tiled Fusion"));

PluginListModel *pluginListModel = new PluginListModel(this);
QSortFilterProxyModel *pluginProxyModel = new QSortFilterProxyModel(this);
pluginProxyModel->setSortLocaleAware(true);
Expand Down Expand Up @@ -178,6 +183,10 @@ void PreferencesDialog::fromPreferences()
void PreferencesDialog::retranslateUi()
{
mUi->languageCombo->setItemText(0, tr("System default"));

mUi->styleCombo->setItemText(0, QApplication::translate("PreferencesDialog", "Native"));
mUi->styleCombo->setItemText(1, QApplication::translate("PreferencesDialog", "Fusion"));
mUi->styleCombo->setItemText(2, QApplication::translate("PreferencesDialog", "Tiled Fusion"));
}

void PreferencesDialog::styleComboChanged(int index)
Expand Down
18 changes: 1 addition & 17 deletions src/tiled/preferencesdialog.ui
Expand Up @@ -204,23 +204,7 @@
</spacer>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="styleCombo">
<item>
<property name="text">
<string>Native</string>
</property>
</item>
<item>
<property name="text">
<string>Fusion</string>
</property>
</item>
<item>
<property name="text">
<string>Tiled Fusion</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="styleCombo"/>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="selectionColorLabel">
Expand Down

0 comments on commit 8690582

Please sign in to comment.