From 064879c4ce9268e29d299aa1e0c60ebdfa7e62e3 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Fri, 9 Mar 2018 19:46:46 +0200 Subject: [PATCH] InAppNotification: Remove reduntant Overlay. --- hammond-gtk/resources/gtk/inapp_notif.ui | 132 +++++++++++------------ hammond-gtk/src/app.rs | 2 +- hammond-gtk/src/appnotif.rs | 5 +- 3 files changed, 68 insertions(+), 71 deletions(-) diff --git a/hammond-gtk/resources/gtk/inapp_notif.ui b/hammond-gtk/resources/gtk/inapp_notif.ui index 2b14bd1..14761b6 100644 --- a/hammond-gtk/resources/gtk/inapp_notif.ui +++ b/hammond-gtk/resources/gtk/inapp_notif.ui @@ -2,100 +2,100 @@ - + True False center start - + True False + center + center + 0 + none - + True False center center - 0 - none + 6 + 6 + 6 - + True False center center - 6 - 6 - 6 + An in-app action notification + + + False + False + 0 + + + + + True + True + False + True + center + center + none - + True False - center - center - An in-app action notification + window-close-symbolic - - False - False - 0 - - - - - True - True - False - True - center - center - none - - - True - False - window-close-symbolic - - - - - False - False - end - 1 - - - - - Undo - True - True - True - center - center - - - False - False - end - 2 - + + + False + False + end + 1 + - - + + + Undo + True + True + True + center + center + + + + False + False + end + 2 + - + + + + - - -1 - + diff --git a/hammond-gtk/src/app.rs b/hammond-gtk/src/app.rs index a9a125b..4fbdfd0 100644 --- a/hammond-gtk/src/app.rs +++ b/hammond-gtk/src/app.rs @@ -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(¬if.overlay); + overlay.add_overlay(¬if.revealer); // We need to display the notification after the widget is added to the overlay // so there will be a nice animation. notif.show(); diff --git a/hammond-gtk/src/appnotif.rs b/hammond-gtk/src/appnotif.rs index a949fae..1ba012e 100644 --- a/hammond-gtk/src/appnotif.rs +++ b/hammond-gtk/src/appnotif.rs @@ -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,