aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_view.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-04-22 15:44:12 +0200
committerfiaxh <git@lightrise.org>2020-04-22 15:44:12 +0200
commit51a23728694a3f1312cc9396fc093ca178457c3c (patch)
tree321771ae3d807d19387a8656805a648d75347994 /main/src/ui/conversation_view.vala
parent7c4260eed718961874fc0ea665263ea2ce59338b (diff)
downloaddino-51a23728694a3f1312cc9396fc093ca178457c3c.tar.gz
dino-51a23728694a3f1312cc9396fc093ca178457c3c.zip
Add file upload preview
fixes #756
Diffstat (limited to 'main/src/ui/conversation_view.vala')
-rw-r--r--main/src/ui/conversation_view.vala27
1 files changed, 26 insertions, 1 deletions
diff --git a/main/src/ui/conversation_view.vala b/main/src/ui/conversation_view.vala
index b521b5ad..5d27e138 100644
--- a/main/src/ui/conversation_view.vala
+++ b/main/src/ui/conversation_view.vala
@@ -7,13 +7,38 @@ using Dino.Entities;
namespace Dino.Ui {
[GtkTemplate (ui = "/im/dino/Dino/conversation_view.ui")]
-public class ConversationView : Gtk.Box {
+public class ConversationView : Gtk.Overlay {
[GtkChild] public Revealer goto_end_revealer;
[GtkChild] public Button goto_end_button;
[GtkChild] public ChatInput.View chat_input;
[GtkChild] public ConversationSummary.ConversationView conversation_frame;
+ [GtkChild] public Revealer white_revealer;
+ construct {
+ white_revealer.notify["child-revealed"].connect_after(on_child_revealed_changed);
+ }
+
+ public void add_overlay_dialog(Widget widget) {
+ Revealer revealer = new Revealer() { transition_type=RevealerTransitionType.CROSSFADE , transition_duration= 100, visible=true };
+ revealer.add(widget);
+
+ this.add_overlay(revealer);
+
+ revealer.reveal_child = true;
+ white_revealer.visible = true;
+ white_revealer.reveal_child = true;
+ widget.destroy.connect(() => {
+ revealer.destroy();
+ white_revealer.reveal_child = false;
+ });
+ }
+
+ private void on_child_revealed_changed() {
+ if (!white_revealer.child_revealed) {
+ white_revealer.visible = false;
+ }
+ }
}
}