diff options
| author | mimi89999 <michel@lebihan.pl> | 2021-01-17 19:50:32 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-10-05 14:32:08 +0200 |
| commit | 7edf7303cbd1b6c4dcea7c87573eb9c99a2d5988 (patch) | |
| tree | 43db10a5162fd1872a8123da875aabfa3ba79f22 /main/src/ui/conversation_titlebar | |
| parent | 1b4cc3a6aafa23e6bc8308e7784b06cfe7fd5cb3 (diff) | |
| download | dino-7edf7303cbd1b6c4dcea7c87573eb9c99a2d5988.tar.gz | |
Add separators and back button to non csd header
Diffstat (limited to 'main/src/ui/conversation_titlebar')
| -rw-r--r-- | main/src/ui/conversation_titlebar/conversation_titlebar.vala | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/main/src/ui/conversation_titlebar/conversation_titlebar.vala b/main/src/ui/conversation_titlebar/conversation_titlebar.vala index e1e5cda1..3afdbfce 100644 --- a/main/src/ui/conversation_titlebar/conversation_titlebar.vala +++ b/main/src/ui/conversation_titlebar/conversation_titlebar.vala @@ -10,6 +10,10 @@ public interface ConversationTitlebar : Widget { public abstract string? subtitle { get; set; } public abstract string? title { get; set; } + public abstract bool back_button { get; set; } + + public signal void back_pressed(); + public abstract void insert_entry(Plugins.ConversationTitlebarEntry entry); } @@ -28,6 +32,12 @@ public class ConversationTitlebarNoCsd : ConversationTitlebar, Gtk.Box { } } + private Revealer back_revealer; + public bool back_button { + get { return back_revealer.reveal_child; } + set { back_revealer.reveal_child = value; } + } + private Box widgets_box = new Box(Orientation.HORIZONTAL, 0) { margin_start=15, valign=Align.END, visible=true }; private Label title_label = new Label("") { ellipsize=EllipsizeMode.END, visible=true }; private Label subtitle_label = new Label("") { use_markup=true, ellipsize=EllipsizeMode.END, visible=false }; @@ -36,6 +46,13 @@ public class ConversationTitlebarNoCsd : ConversationTitlebar, Gtk.Box { Box content_box = new Box(Orientation.HORIZONTAL, 0) { margin=5, margin_start=15, margin_end=10, hexpand=true, visible=true }; this.add(content_box); + back_revealer = new Revealer() { visible = true, transition_type = RevealerTransitionType.SLIDE_RIGHT, transition_duration = 200, can_focus = false, reveal_child = false }; + Button back_button = new Button.from_icon_name("go-previous-symbolic") { visible = true, valign = Align.CENTER, use_underline = true, relief = ReliefStyle.NONE }; + back_button.get_style_context().add_class("image-button"); + back_button.clicked.connect(() => back_pressed()); + back_revealer.add(back_button); + content_box.add(back_revealer); + Box titles_box = new Box(Orientation.VERTICAL, 0) { valign=Align.CENTER, hexpand=true, visible=true }; content_box.add(titles_box); @@ -70,7 +87,6 @@ public class ConversationTitlebarCsd : ConversationTitlebar, Gtk.HeaderBar { get { return back_revealer.reveal_child; } set { back_revealer.reveal_child = value; } } - public signal void back_pressed(); public ConversationTitlebarCsd() { this.get_style_context().add_class("dino-right"); |
