summaryrefslogtreecommitdiff
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2017-07-17 16:18:47 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2017-07-17 16:18:47 +0200
commit68d428dd880e98df38ec96aef9fab06e418540ec (patch)
tree42fb83fb15dd71701b6b2ab70c042f567012f507
parente37aa12080db798e725accada4c69933d2cbc610 (diff)
Launcher: disable or reduce most icon effects on lowgfx
Fixes LP: #1700859 (bzr r4245.3.2)
-rw-r--r--launcher/Launcher.cpp45
1 files changed, 24 insertions, 21 deletions
diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp
index 139f9590a..e744757b2 100644
--- a/launcher/Launcher.cpp
+++ b/launcher/Launcher.cpp
@@ -191,7 +191,6 @@ Launcher::Launcher(MockableBaseWindow* parent,
QueueDraw();
});
-//FIXME, move to single function
Settings::Instance().dpi_changed.connect(sigc::mem_fun(this, &Launcher::OnDPIChanged));
Settings::Instance().low_gfx.changed.connect(sigc::hide(sigc::mem_fun(this, &Launcher::UpdateAnimations)));
@@ -1342,12 +1341,7 @@ void Launcher::UpdateOptions(Options::Ptr options)
SetLauncherMinimizeWindow(options->minimize_window_on_click);
OnMonitorChanged(monitor);
- if (model_)
- {
- for (auto const& icon : *model_)
- SetupIconAnimations(icon);
- }
-
+ UpdateAnimations();
ConfigureBarrier();
QueueDraw();
}
@@ -1364,6 +1358,12 @@ void Launcher::UpdateAnimations()
dnd_hide_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION * 3);
dash_showing_animation_.SetDuration(low_gfx ? 0 : ANIM_DURATION_DASH_SHOWING);
+ if (model_)
+ {
+ for (auto const& icon : *model_)
+ SetupIconAnimations(icon);
+ }
+
QueueDraw();
}
@@ -1740,23 +1740,26 @@ void Launcher::OnIconRemoved(AbstractLauncherIcon::Ptr const& icon)
void Launcher::SetupIconAnimations(AbstractLauncherIcon::Ptr const& icon)
{
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::VISIBLE, ANIM_DURATION_SHORT, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::RUNNING, ANIM_DURATION_SHORT, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::ACTIVE, ANIM_DURATION_SHORT, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::STARTING, (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PULSE_ONCE, (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PRESENTED, ANIM_DURATION, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::UNFOLDED, ANIM_DURATION, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::SHIMMER, ANIM_DURATION_LONG, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::CENTER_SAVED, ANIM_DURATION, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PROGRESS, ANIM_DURATION, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::DESAT, ANIM_DURATION_SHORT_SHORT, monitor());
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::GLOW, ANIM_DURATION_SHORT, monitor());
+ bool display = monitor();
+ bool low_gfx = Settings::Instance().low_gfx();
+
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::VISIBLE, low_gfx ? 0 : ANIM_DURATION_SHORT, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::RUNNING, low_gfx ? 0 : ANIM_DURATION_SHORT, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::ACTIVE, low_gfx ? 0 : ANIM_DURATION_SHORT, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::STARTING, (ANIM_DURATION_LONG * MAX_STARTING_BLINKS * STARTING_BLINK_LAMBDA * 2), display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PULSE_ONCE, (ANIM_DURATION_LONG * PULSE_BLINK_LAMBDA * 2), display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PRESENTED, low_gfx ? 0 : ANIM_DURATION, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::UNFOLDED, low_gfx ? 0 : ANIM_DURATION, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::SHIMMER, low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION_LONG, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::CENTER_SAVED, low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::PROGRESS, low_gfx ? ANIM_DURATION_SHORT_SHORT : ANIM_DURATION, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::DESAT, low_gfx ? 0 : ANIM_DURATION_SHORT_SHORT, display);
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::GLOW, low_gfx ? 0 : ANIM_DURATION_SHORT, display);
if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_SHORT * WIGGLE_CYCLES), monitor());
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_SHORT * WIGGLE_CYCLES), display);
else
- icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_LONG * URGENT_BLINKS * 2), monitor());
+ icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_LONG * URGENT_BLINKS * 2), display);
}
void Launcher::SetModel(LauncherModel::Ptr model)