Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit f736e73

Browse files
author
bleakgrey
committed
Fix toast overlay
1 parent 7488146 commit f736e73

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/InstanceAccount.vala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ public class Tootle.InstanceAccount : GLib.Object {
8383
if (settings.notifications)
8484
app.send_notification (app.application_id + ":" + obj.id.to_string (), notification);
8585

86-
network.notification (ref obj);
86+
if (accounts.formal.token == this.token)
87+
network.notification (ref obj);
8788
}
8889

8990
private void status_added (ref Status status) {

src/MainWindow.vala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ public class Tootle.MainWindow: Gtk.Window {
2323
settings.changed.connect (update_theme);
2424
update_theme ();
2525

26-
toast = new Granite.Widgets.Toast ("");
27-
overlay = new Gtk.Overlay ();
28-
overlay.add_overlay (toast);
2926
secondary_stack = new Stack();
3027
secondary_stack.transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT;
3128
secondary_stack.show ();
@@ -61,25 +58,27 @@ public class Tootle.MainWindow: Gtk.Window {
6158
header = new Gtk.HeaderBar ();
6259
header.show_close_button = true;
6360
header.custom_title = button_mode;
64-
header.show_all ();
6561
header.pack_start (button_back);
6662
header.pack_start (button_toot);
6763
header.pack_end (button_accounts);
6864
header.pack_end (spinner);
69-
set_titlebar (header);
65+
header.show_all ();
7066

7167
grid = new Gtk.Grid ();
72-
grid.set_size_request (450, 600);
7368
grid.attach (primary_stack, 0, 0, 1, 1);
74-
grid.attach (overlay, 0, 0, 1, 1);
7569

7670
add_header_view (new TimelineView ("home"));
7771
add_header_view (new NotificationsView ());
7872
add_header_view (new LocalView ());
7973
add_header_view (new FederatedView ());
8074
button_mode.set_active (0);
8175

82-
add (grid);
76+
toast = new Granite.Widgets.Toast ("");
77+
overlay = new Gtk.Overlay ();
78+
overlay.add_overlay (grid);
79+
overlay.add_overlay (toast);
80+
overlay.set_size_request (450, 600);
81+
add (overlay);
8382
show_all ();
8483

8584
button_mode.valign = Gtk.Align.FILL;
@@ -93,6 +92,7 @@ public class Tootle.MainWindow: Gtk.Window {
9392
);
9493
window_position = WindowPosition.CENTER;
9594
update_header ();
95+
set_titlebar (header);
9696

9797
app.toast.connect (on_toast);
9898
network.started.connect (() => spinner.show ());

0 commit comments

Comments
 (0)