1919*/
2020
2121public class Notifications.AbstractBubble : Gtk .Window {
22- public signal void closed (uint32 reason );
22+ public signal void closed (uint32 reason ) {
23+ close ();
24+ }
2325
2426 public uint32 timeout { get ; set ; }
2527
2628 protected Gtk . Stack content_area;
2729
2830 private Gtk . Revealer close_revealer;
29- private Gtk . Revealer revealer;
3031 private Gtk . Box draw_area;
3132
32- private Gtk . EventControllerMotion motion_controller;
3333 private uint timeout_id;
3434
3535 construct {
@@ -64,25 +64,14 @@ public class Notifications.AbstractBubble : Gtk.Window {
6464 };
6565 overlay. add_overlay (close_revealer);
6666
67- revealer = new Gtk .Revealer () {
68- reveal_child = true ,
69- transition_duration = 195 ,
70- transition_type = Gtk . RevealerTransitionType . CROSSFADE ,
71- child = overlay
72- };
73-
7467 var carousel = new Adw .Carousel () {
75- allow_mouse_drag = true ,
76- interactive = true ,
77- halign = Gtk . Align . END ,
7868 hexpand = true
7969 };
8070 carousel. append (new Gtk .Grid ());
81- carousel. append (revealer );
82- carousel. scroll_to (revealer , false );
71+ carousel. append (overlay );
72+ carousel. scroll_to (overlay , false );
8373
8474 child = carousel;
85- default_height = 0 ;
8675 default_width = 332 ;
8776 resizable = false ;
8877 add_css_class (" notification" );
@@ -96,28 +85,11 @@ public class Notifications.AbstractBubble : Gtk.Window {
9685 }
9786 });
9887 close_button. clicked. connect (() = > closed (Notifications . Server . CloseReason . DISMISSED ));
99- closed. connect (close);
10088
101- motion_controller = new Gtk .EventControllerMotion () {
102- propagation_phase = TARGET
103- };
89+ var motion_controller = new Gtk .EventControllerMotion ();
10490 motion_controller. enter. connect (pointer_enter);
10591 motion_controller. leave. connect (pointer_leave);
106-
10792 carousel. add_controller (motion_controller);
108-
109- close_request. connect (on_close);
110- }
111-
112- private bool on_close (Gtk .Window window ) {
113- revealer. reveal_child = false ;
114-
115- Timeout . add (revealer. transition_duration, () = > {
116- destroy ();
117- return Source . REMOVE ;
118- });
119-
120- return Gdk . EVENT_PROPAGATE ;
12193 }
12294
12395 public new void present () {
0 commit comments