in-app-notification: compose with GtkBin instead of subclassing GtkRevealer
Note that the GtkOverlay must pass-through interactions for this to work, meaning it's no longer possible to interact with the notifications. I'm leaving it like this since I'll need to replace it with AdwToast later anyways. Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
This commit is contained in:
@@ -35,6 +35,9 @@
|
||||
<object class="CallsInAppNotification" id="in_app_notification">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pass-through">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
<object class="CallsInAppNotification" id="in_app_notification">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pass-through">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="main_stack">
|
||||
|
||||
@@ -1,44 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<template class="CallsInAppNotification" parent="GtkRevealer">
|
||||
<property name="reveal-child">False</property>
|
||||
<property name="transition-type">slide-down</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="halign">center</property>
|
||||
<template class="CallsInAppNotification" parent="GtkBin">
|
||||
<property name="visible">False</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<object class="GtkRevealer" id="revealer">
|
||||
<property name="visible">True</property>
|
||||
<property name="reveal-child">False</property>
|
||||
<property name="transition-type">slide-down</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="halign">center</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="calls_in_app_notification_hide" swapped="yes"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon_name">window-close-symbolic</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="calls_in_app_notification_hide" swapped="yes"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon_name">window-close-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="margin-left">24</property>
|
||||
<property name="margin-right">24</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="flat"/>
|
||||
<class name="app-notification"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack_type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="visible">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="margin-left">24</property>
|
||||
<property name="margin-right">24</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="app-notification"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
@@ -49,6 +49,9 @@
|
||||
<object class="CallsInAppNotification" id="in_app_notification">
|
||||
<property name="visible">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pass-through">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
|
||||
Reference in New Issue
Block a user