This commit is contained in:
fourtf 2018-08-15 23:48:16 +02:00
parent af7b742a23
commit 5068c9a64e
3 changed files with 12 additions and 6 deletions

View file

@ -25,6 +25,8 @@ public:
/// Appearance
BoolSetting showTimestamps = {"/appearance/messages/showTimestamps", true};
BoolSetting enableAnimationsWhenFocused = {
"/appearance/enableAnimationsWhenFocused", false};
QStringSetting timestampFormat = {"/appearance/messages/timestampFormat",
"h:mm"};
BoolSetting showBadges = {"/appearance/messages/showBadges", true};

View file

@ -11,18 +11,19 @@ void GIFTimer::initialize()
this->timer.setInterval(30);
getSettings()->enableGifAnimations.connect([this](bool enabled, auto) {
if (enabled) {
if (enabled)
this->timer.start();
} else {
else
this->timer.stop();
}
});
QObject::connect(&this->timer, &QTimer::timeout, [this] {
if (getSettings()->enableAnimationsWhenFocused &&
qApp->activeWindow() == nullptr)
return;
this->signal.invoke();
// fourtf:
auto app = getApp();
app->windows->repaintGifEmotes();
getApp()->windows->repaintGifEmotes();
});
}

View file

@ -218,6 +218,9 @@ void LookPage::addEmoteTab(LayoutCreator<QVBoxLayout> layout)
*/
layout.append(
this->createCheckBox("Animations", getSettings()->enableGifAnimations));
layout.append(
this->createCheckBox("Animations only when chatterino has focus",
getSettings()->enableAnimationsWhenFocused));
auto scaleBox = layout.emplace<QHBoxLayout>().withoutMargin();
{