Fixes #161
This commit is contained in:
@@ -25,6 +25,8 @@ public:
|
|||||||
|
|
||||||
/// Appearance
|
/// Appearance
|
||||||
BoolSetting showTimestamps = {"/appearance/messages/showTimestamps", true};
|
BoolSetting showTimestamps = {"/appearance/messages/showTimestamps", true};
|
||||||
|
BoolSetting enableAnimationsWhenFocused = {
|
||||||
|
"/appearance/enableAnimationsWhenFocused", false};
|
||||||
QStringSetting timestampFormat = {"/appearance/messages/timestampFormat",
|
QStringSetting timestampFormat = {"/appearance/messages/timestampFormat",
|
||||||
"h:mm"};
|
"h:mm"};
|
||||||
BoolSetting showBadges = {"/appearance/messages/showBadges", true};
|
BoolSetting showBadges = {"/appearance/messages/showBadges", true};
|
||||||
|
|||||||
@@ -11,18 +11,19 @@ void GIFTimer::initialize()
|
|||||||
this->timer.setInterval(30);
|
this->timer.setInterval(30);
|
||||||
|
|
||||||
getSettings()->enableGifAnimations.connect([this](bool enabled, auto) {
|
getSettings()->enableGifAnimations.connect([this](bool enabled, auto) {
|
||||||
if (enabled) {
|
if (enabled)
|
||||||
this->timer.start();
|
this->timer.start();
|
||||||
} else {
|
else
|
||||||
this->timer.stop();
|
this->timer.stop();
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
QObject::connect(&this->timer, &QTimer::timeout, [this] {
|
QObject::connect(&this->timer, &QTimer::timeout, [this] {
|
||||||
|
if (getSettings()->enableAnimationsWhenFocused &&
|
||||||
|
qApp->activeWindow() == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
this->signal.invoke();
|
this->signal.invoke();
|
||||||
// fourtf:
|
getApp()->windows->repaintGifEmotes();
|
||||||
auto app = getApp();
|
|
||||||
app->windows->repaintGifEmotes();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -218,6 +218,9 @@ void LookPage::addEmoteTab(LayoutCreator<QVBoxLayout> layout)
|
|||||||
*/
|
*/
|
||||||
layout.append(
|
layout.append(
|
||||||
this->createCheckBox("Animations", getSettings()->enableGifAnimations));
|
this->createCheckBox("Animations", getSettings()->enableGifAnimations));
|
||||||
|
layout.append(
|
||||||
|
this->createCheckBox("Animations only when chatterino has focus",
|
||||||
|
getSettings()->enableAnimationsWhenFocused));
|
||||||
|
|
||||||
auto scaleBox = layout.emplace<QHBoxLayout>().withoutMargin();
|
auto scaleBox = layout.emplace<QHBoxLayout>().withoutMargin();
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user