aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_titlebar/view_csd.vala
blob: 62360c428a8e948785dd8366e8ed8d81f7a1d5d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using Gtk;
using Gee;

using Dino.Entities;

namespace Dino.Ui {

public class ConversationTitlebarCsd : Gtk.HeaderBar {

    private StreamInteractor stream_interactor;
    private Window window;

    public ConversationTitlebarCsd(StreamInteractor stream_interactor, Window window) {
        this.stream_interactor = stream_interactor;
        this.window = window;

        this.get_style_context().add_class("dino-right");
        show_close_button = true;
        hexpand = true;

        Application app = GLib.Application.get_default() as Application;
        ArrayList<Plugins.ConversationTitlebarWidget> widgets = new ArrayList<Plugins.ConversationTitlebarWidget>();
        foreach(var e in app.plugin_registry.conversation_titlebar_entries) {
            Plugins.ConversationTitlebarWidget widget = e.get_widget(Plugins.WidgetType.GTK);
            if (widget != null) {
                widgets.insert(0, widget);
            }
        }
        foreach (var w in widgets) {
            Button gtk_widget = (Gtk.Button)w;
            this.pack_end(gtk_widget);
        }
    }
}

}