Smooth scroll to new animation in notification center (#41)
If the user has disabled animations in GTK, then there will be no animations. This is all handled internally by GTK.
This commit is contained in:
@@ -194,17 +194,12 @@ namespace SwayNotificatonCenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void scroll_to_start (bool reverse) {
|
private void scroll_to_start (bool reverse) {
|
||||||
var adj = viewport.vadjustment;
|
const bool horizontal_scroll = false;
|
||||||
double val = adj.get_lower ();
|
Gtk.ScrollType scroll_type = Gtk.ScrollType.START;
|
||||||
list_position = 0;
|
|
||||||
if (reverse) {
|
if (reverse) {
|
||||||
val = adj.get_upper ();
|
scroll_type = Gtk.ScrollType.END;
|
||||||
list_position = list_reverse ?
|
|
||||||
(list_box.get_children ().length () - 1) : 0;
|
|
||||||
if (list_position == uint.MAX) list_position = -1;
|
|
||||||
}
|
}
|
||||||
adj.set_value (val);
|
scrolled_window.scroll_child (scroll_type, horizontal_scroll);
|
||||||
navigate_list (list_position);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint notification_count () {
|
public uint notification_count () {
|
||||||
|
Reference in New Issue
Block a user