mirror of
https://github.com/elementary/gala.git
synced 2024-11-27 15:45:31 +03:00
add fallback support for icons, drop icon animation for NORMAL priority notifications
This commit is contained in:
parent
dad8b78624
commit
8175fdf04b
@ -108,37 +108,7 @@ namespace Gala.Plugins.Notify
|
||||
|
||||
switch (urgency) {
|
||||
case NotificationUrgency.LOW:
|
||||
return;
|
||||
case NotificationUrgency.NORMAL:
|
||||
var icon_entry = new TransitionGroup ();
|
||||
icon_entry.duration = 1000;
|
||||
icon_entry.remove_on_complete = true;
|
||||
icon_entry.progress_mode = AnimationMode.EASE_IN_OUT_CUBIC;
|
||||
|
||||
var icon_opacity_transition = new KeyframeTransition ("opacity");
|
||||
icon_opacity_transition.set_from_value (0);
|
||||
icon_opacity_transition.set_to_value (255);
|
||||
icon_opacity_transition.set_key_frames ({ 0.1, 0.6 });
|
||||
icon_opacity_transition.set_values ({ 0, 255 });
|
||||
|
||||
var scale_x_transition = new KeyframeTransition ("scale-x");
|
||||
scale_x_transition.set_from_value (0.0);
|
||||
scale_x_transition.set_to_value (1.0);
|
||||
scale_x_transition.set_key_frames ({ 0.1, 0.6 });
|
||||
scale_x_transition.set_values ({ 0, 1.3 });
|
||||
|
||||
var scale_y_transition = new KeyframeTransition ("scale-y");
|
||||
scale_y_transition.set_from_value (0.0);
|
||||
scale_y_transition.set_to_value (1.0);
|
||||
scale_y_transition.set_key_frames ({ 0.15, 0.6 });
|
||||
scale_y_transition.set_values ({ 0, 1.3 });
|
||||
|
||||
icon_entry.add_transition (icon_opacity_transition);
|
||||
icon_entry.add_transition (scale_x_transition);
|
||||
icon_entry.add_transition (scale_y_transition);
|
||||
|
||||
icon_texture.add_transition ("entry", icon_entry);
|
||||
|
||||
return;
|
||||
case NotificationUrgency.CRITICAL:
|
||||
var icon_entry = new TransitionGroup ();
|
||||
@ -349,4 +319,4 @@ namespace Gala.Plugins.Notify
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -187,13 +187,11 @@ namespace Gala.Plugins.Notify
|
||||
|
||||
} else if (icon != "") {
|
||||
|
||||
var actual_icon = icon;
|
||||
// fix icon names that are sent to notify-osd to the ones that actually exist
|
||||
if (icon.has_prefix ("notification-audio"))
|
||||
actual_icon = icon.substring (13) + "-symbolic";
|
||||
|
||||
try {
|
||||
pixbuf = Gtk.IconTheme.get_default ().load_icon (actual_icon, size, 0);
|
||||
var themed = new ThemedIcon.with_default_fallbacks (icon);
|
||||
var info = Gtk.IconTheme.get_default ().lookup_by_gicon (themed, size, 0);
|
||||
if (info != null)
|
||||
pixbuf = info.load_icon ();
|
||||
} catch (Error e) { warning (e.message); }
|
||||
|
||||
} else if (hints.contains ("icon_data")) {
|
||||
|
Loading…
Reference in New Issue
Block a user