InAppNotification: Remove reduntant Overlay.

This commit is contained in:
Jordan Petridis
2018-03-09 19:46:46 +02:00
parent 8614922213
commit 064879c4ce
3 changed files with 68 additions and 71 deletions
+1 -1
View File
@@ -171,7 +171,7 @@ impl App {
let text = "Marked all episodes as listened";
let notif = InAppNotification::new(text.into(), callback, sender.clone());
overlay.add_overlay(&notif.overlay);
overlay.add_overlay(&notif.revealer);
// We need to display the notification after the widget is added to the overlay
// so there will be a nice animation.
notif.show();
+1 -4
View File
@@ -10,8 +10,7 @@ use std::sync::mpsc::Sender;
#[derive(Debug, Clone)]
pub struct InAppNotification {
pub overlay: gtk::Overlay,
revealer: gtk::Revealer,
pub revealer: gtk::Revealer,
text: gtk::Label,
undo: gtk::Button,
close: gtk::Button,
@@ -21,14 +20,12 @@ impl Default for InAppNotification {
fn default() -> Self {
let builder = gtk::Builder::new_from_resource("/org/gnome/hammond/gtk/inapp_notif.ui");
let overlay: gtk::Overlay = builder.get_object("overlay").unwrap();
let revealer: gtk::Revealer = builder.get_object("revealer").unwrap();
let text: gtk::Label = builder.get_object("text").unwrap();
let undo: gtk::Button = builder.get_object("undo").unwrap();
let close: gtk::Button = builder.get_object("close").unwrap();
InAppNotification {
overlay,
revealer,
text,
undo,