@@ -142,6 +142,20 @@ func createSidestuff(nDaemon *notificationDaemon.Daemon) *gtk.Box {
142142 sc , _ = notificationBox .GetStyleContext ()
143143 sc .AddClass ("notification-bell-wrapper" )
144144
145+ notificationBar := createNotificationBar (nDaemon )
146+ notificationButton .Connect ("clicked" , func () {
147+ if notificationBar .IsVisible () {
148+ notificationBar .Hide ()
149+ } else {
150+ if len (nDaemon .Notifications ) != 0 {
151+ notificationBar .ShowAll ()
152+ }
153+
154+ }
155+ })
156+
157+ ntStack , _ := gtk .StackNew ()
158+
145159 notificationImage , _ := gtk .ImageNewFromIconName ("preferences-system-notifications-symbolic" , gtk .ICON_SIZE_BUTTON )
146160 sc , _ = notificationImage .GetStyleContext ()
147161 sc .AddClass ("notification-bell" )
@@ -150,12 +164,22 @@ func createSidestuff(nDaemon *notificationDaemon.Daemon) *gtk.Box {
150164 sc , _ = notificationText .GetStyleContext ()
151165 sc .AddClass ("h2" )
152166
153- notificationBox .PackStart (notificationText , false , false , 0 )
167+ ntStack .Add (notificationImage )
168+ ntStack .Add (notificationText )
169+
170+ notificationBox .PackStart (ntStack , false , false , 0 )
154171 notificationButton .Add (notificationBox )
155172
156173 glib .TimeoutAdd (uint (100 ), func () bool {
157174 // Get new date/time info.
158175 notificationText .SetText (strconv .Itoa (len (nDaemon .Notifications )))
176+ if len (nDaemon .Notifications ) == 0 {
177+ ntStack .SetVisibleChild (notificationImage )
178+ ntStack .SetTransitionType (gtk .STACK_TRANSITION_TYPE_SLIDE_LEFT )
179+ } else {
180+ ntStack .SetVisibleChild (notificationText )
181+ ntStack .SetTransitionType (gtk .STACK_TRANSITION_TYPE_SLIDE_RIGHT )
182+ }
159183
160184 // Return true to keep the timeout active.
161185 return true
0 commit comments