client: move ComponentsInAppNotification as a toast

Fix #1207
This commit is contained in:
Cédric Bellegarde 2023-08-24 07:42:26 +02:00
parent 83bd8e0353
commit 46ec026404
3 changed files with 9 additions and 2 deletions

View file

@ -8,6 +8,7 @@
* Represents an in-app notification. * Represents an in-app notification.
* *
* Following the GNOME HIG, it should only contain a label and maybe a button. * Following the GNOME HIG, it should only contain a label and maybe a button.
* Looks like libadwaita toast, remove this when porting toward GTK4
*/ */
[GtkTemplate (ui = "/org/gnome/Geary/components-in-app-notification.ui")] [GtkTemplate (ui = "/org/gnome/Geary/components-in-app-notification.ui")]
public class Components.InAppNotification : Gtk.Revealer { public class Components.InAppNotification : Gtk.Revealer {
@ -30,7 +31,7 @@ public class Components.InAppNotification : Gtk.Revealer {
*/ */
public InAppNotification(string message, public InAppNotification(string message,
uint duration = DEFAULT_DURATION) { uint duration = DEFAULT_DURATION) {
this.transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN; this.transition_type = Gtk.RevealerTransitionType.CROSSFADE;
this.message_label.label = message; this.message_label.label = message;
this.duration = duration; this.duration = duration;
} }

View file

@ -4,9 +4,10 @@
<template class="ComponentsInAppNotification" parent="GtkRevealer"> <template class="ComponentsInAppNotification" parent="GtkRevealer">
<property name="visible">False</property> <property name="visible">False</property>
<property name="halign">center</property> <property name="halign">center</property>
<property name="valign">start</property> <property name="valign">end</property>
<property name="margin-start">12</property> <property name="margin-start">12</property>
<property name="margin-end">12</property> <property name="margin-end">12</property>
<property name="margin-bottom">30</property>
<signal name="notify::child-revealed" handler="on_child_revealed" swapped="no"/> <signal name="notify::child-revealed" handler="on_child_revealed" swapped="no"/>
<child> <child>
<object class="GtkBox" id="layout"> <object class="GtkBox" id="layout">

View file

@ -25,6 +25,11 @@ geary-conversation-list revealer {
border-right: 0; border-right: 0;
} }
.app-notification {
border-radius: 30px;
padding-left: 18px;
}
.geary-info-bar-stack > border { .geary-info-bar-stack > border {
border-width: 0; border-width: 0;
border-left-width: 0; border-left-width: 0;