summaryrefslogtreecommitdiff
path: root/launcher
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2014-04-16 03:24:08 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2014-04-16 03:24:08 +0200
commit1bcc8a8ceaacffa309907953dd7ac51e0901c356 (patch)
treecc6dd193e3c2b6034851c68a77873044ec2a6255 /launcher
parentb523fd2a7c3dadc6ac34be19102cbccc38431337 (diff)
Launcher: glow launcher icons under the dnd if they accept dropping on them
Fixes LP: #839728 (bzr r3785.5.8)
Diffstat (limited to 'launcher')
-rw-r--r--launcher/Launcher.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp
index a54e16d71..a487d3c0e 100644
--- a/launcher/Launcher.cpp
+++ b/launcher/Launcher.cpp
@@ -600,7 +600,7 @@ void Launcher::SetupRenderArg(AbstractLauncherIcon::Ptr const& icon, RenderArg&
else
urgent_progress = CLAMP(urgent_progress * 3.0f - 2.0f, 0.0f, 1.0f); // we want to go 3x faster than the urgent normal cycle
- arg.glow_intensity = urgent_progress;
+ arg.glow_intensity = icon->GetQuirkProgress(AbstractLauncherIcon::Quirk::GLOW, monitor()) + urgent_progress;
if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
{
@@ -1596,6 +1596,7 @@ void Launcher::SetupIconAnimations(AbstractLauncherIcon::Ptr const& icon)
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());
if (options()->urgent_animation() == URGENT_ANIMATION_WIGGLE)
icon->SetQuirkDuration(AbstractLauncherIcon::Quirk::URGENT, (ANIM_DURATION_SHORT * WIGGLE_CYCLES), monitor());
@@ -2527,7 +2528,10 @@ void Launcher::DndHoveredIconReset()
}
if (!steal_drag_ && dnd_hovered_icon_)
+ {
dnd_hovered_icon_->SendDndLeave();
+ dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, false, monitor());
+ }
steal_drag_ = false;
drag_edge_touching_ = false;
@@ -2585,7 +2589,10 @@ void Launcher::ProcessDndMove(int x, int y, std::list<char*> mimes)
mouse_position_.y <= (parent_->GetGeometry().height - icon_size_.CP(cv_) - 2 * SPACE_BETWEEN_ICONS.CP(cv_)))
{
if (dnd_hovered_icon_)
- dnd_hovered_icon_->SendDndLeave();
+ {
+ dnd_hovered_icon_->SendDndLeave();
+ dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, false, monitor());
+ }
animation::StartOrReverse(dnd_hide_animation_, animation::Direction::FORWARD);
drag_edge_touching_ = true;
@@ -2644,6 +2651,9 @@ void Launcher::ProcessDndMove(int x, int y, std::list<char*> mimes)
{
hovered_icon->SendDndEnter();
drag_action_ = hovered_icon->QueryAcceptDrop(dnd_data_);
+
+ if (drag_action_ != nux::DNDACTION_NONE)
+ hovered_icon->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, true, monitor());
}
else
{
@@ -2651,7 +2661,10 @@ void Launcher::ProcessDndMove(int x, int y, std::list<char*> mimes)
}
if (dnd_hovered_icon_)
+ {
dnd_hovered_icon_->SendDndLeave();
+ dnd_hovered_icon_->SetQuirk(AbstractLauncherIcon::Quirk::GLOW, false, monitor());
+ }
dnd_hovered_icon_ = hovered_icon;
}