Skip to content

Commit

Permalink
Merge pull request #1290 from Riksu9000/smoother-animation
Browse files Browse the repository at this point in the history
Make filter icon animation smoother
  • Loading branch information
alainm23 authored Jun 13, 2024
2 parents b11e975 + ec2a45f commit 3a9bf72
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Layouts/FilterPaneRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ public class Layouts.FilterPaneRow : Gtk.FlowBoxChild {
Services.EventBus.get_default ().pane_selected.connect ((pane_type, id) => {
if (pane_type == PaneType.FILTER && filter_type.to_string () == id) {
add_css_class ("selected");
add_css_class ("animation");
Timeout.add (1000, () => {
remove_css_class ("animation");
return GLib.Source.REMOVE;
});

if (!has_css_class ("animation")) {
add_css_class ("animation");
Timeout.add (700, () => {
remove_css_class ("animation");
return GLib.Source.REMOVE;
});
}
} else {
remove_css_class ("selected");
remove_css_class ("animation");
}
});
}
Expand Down

0 comments on commit 3a9bf72

Please sign in to comment.