Implement preferred emote quality setting.

This doesn't work super well for Twitch emotes because they don't
conform to a proper emote scaling standard

Fixes #150
This commit is contained in:
Rasmus Karlsson
2018-01-07 02:56:45 +01:00
parent 5baba39cdc
commit 9fa9d7f0e3
8 changed files with 194 additions and 72 deletions
+23
View File
@@ -426,6 +426,29 @@ QVBoxLayout *SettingsDialog::createEmotesTab()
layout->addWidget(createCheckbox("Enable Twitch Emotes", settings.enableTwitchEmotes));
// Preferred emote quality
{
auto box = new QHBoxLayout();
auto label = new QLabel("Preferred emote quality");
label->setToolTip("Select which emote quality you prefer to download");
auto widget = new QComboBox();
widget->addItems({"1x", "2x", "4x"});
box->addWidget(label);
box->addWidget(widget);
settings.preferredEmoteQuality.connect([widget](int newIndex, auto) {
widget->setCurrentIndex(newIndex); //
});
QObject::connect(
widget, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [](int index) {
singletons::SettingManager &settings = singletons::SettingManager::getInstance();
settings.preferredEmoteQuality = index; //
});
layout->addLayout(box);
}
return layout;
}