From 9f3cb078377449b9422d8cb6bf23c24965a39fd5 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Wed, 25 Jan 2023 20:48:36 +0100 Subject: [PATCH] WIP: Notification widget --- src/ui/gemgraph.ui | 47 ++++++++++++++++++++++++++++++++++++++++++++-- src/ui/window.c | 10 +++++++--- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/src/ui/gemgraph.ui b/src/ui/gemgraph.ui index b2f63cc..9a926e7 100644 --- a/src/ui/gemgraph.ui +++ b/src/ui/gemgraph.ui @@ -46,7 +46,7 @@ - + 300 @@ -154,7 +154,50 @@ - + + + + True + False + center + start + + + True + False + start + 20 + + + True + False + This is an app-notification. Click the button to dismiss + + + + + True + True + True + + + True + False + window-close-symbolic + + + + + + + + + + diff --git a/src/ui/window.c b/src/ui/window.c index 82861db..3560e7b 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -206,7 +206,8 @@ struct _GemGraphClientWindow GtkPaned *main_paned; GtkMenuButton *main_button_mode; GtkToggleButton *main_button_sidebar; - GtkOverlay *toast_overlay; + GtkRevealer *toast_revealer; + GtkButton *toast_close_button; }; G_DEFINE_FINAL_TYPE (GemGraphClientWindow, @@ -248,7 +249,10 @@ static void gem_graph_client_window_class_init(GemGraphClientWindowClass *klass) main_button_sidebar); gtk_widget_class_bind_template_child(widget_class, GemGraphClientWindow, - toast_overlay); + toast_revealer); + gtk_widget_class_bind_template_child(widget_class, + GemGraphClientWindow, + toast_close_button); } static void gem_graph_client_window_init(GemGraphClientWindow *self) @@ -303,7 +307,7 @@ void ui_set_stack(const char *mode) void ui_send_internal_notification(const char *message) { - if (window->toast_overlay == NULL) { + if (window->toast_revealer == NULL) { g_printerr("Can't find self->toast_overlay !\n"); return; }