2017-03-02 14:37:32 +00:00
|
|
|
using Gtk;
|
|
|
|
|
|
|
|
using Dino.Entities;
|
|
|
|
|
2017-03-10 17:07:28 +00:00
|
|
|
namespace Dino.Ui {
|
|
|
|
|
2017-12-03 18:42:15 +00:00
|
|
|
[GtkTemplate (ui = "/im/dino/Dino/conversation_list_titlebar.ui")]
|
2019-01-27 14:24:58 +00:00
|
|
|
public class ConversationListTitlebar : Gtk.Box {
|
2017-03-02 14:37:32 +00:00
|
|
|
|
2017-03-10 17:07:28 +00:00
|
|
|
[GtkChild] private MenuButton add_button;
|
2019-01-27 14:24:58 +00:00
|
|
|
[GtkChild] private MenuButton menu_button;
|
2017-03-02 14:37:32 +00:00
|
|
|
|
2020-02-21 01:42:19 +00:00
|
|
|
public ConversationListTitlebar() {
|
|
|
|
create_add_menu(add_button, menu_button);
|
2017-03-02 14:37:32 +00:00
|
|
|
}
|
2020-02-21 01:42:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[GtkTemplate (ui = "/im/dino/Dino/conversation_list_titlebar_csd.ui")]
|
|
|
|
public class ConversationListTitlebarCsd : Gtk.HeaderBar {
|
2017-03-02 14:37:32 +00:00
|
|
|
|
2020-02-21 01:42:19 +00:00
|
|
|
[GtkChild] private MenuButton add_button;
|
|
|
|
[GtkChild] private MenuButton menu_button;
|
2019-01-27 14:24:58 +00:00
|
|
|
|
2020-02-21 01:42:19 +00:00
|
|
|
public ConversationListTitlebarCsd() {
|
|
|
|
custom_title = new Label("Dino") { visible = true, hexpand = true, xalign = 0 };
|
|
|
|
custom_title.get_style_context().add_class("title");
|
|
|
|
|
|
|
|
create_add_menu(add_button, menu_button);
|
2017-03-02 14:37:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-21 01:42:19 +00:00
|
|
|
private static void create_add_menu(MenuButton add_button, MenuButton menu_button) {
|
|
|
|
Builder add_builder = new Builder.from_resource("/im/dino/Dino/menu_add.ui");
|
|
|
|
MenuModel add_menu_model = add_builder.get_object("menu_add") as MenuModel;
|
|
|
|
add_button.set_menu_model(add_menu_model);
|
|
|
|
|
|
|
|
Builder menu_builder = new Builder.from_resource("/im/dino/Dino/menu_app.ui");
|
|
|
|
MenuModel menu_menu_model = menu_builder.get_object("menu_app") as MenuModel;
|
|
|
|
menu_button.set_menu_model(menu_menu_model);
|
|
|
|
}
|
|
|
|
|
2017-05-09 12:53:26 +00:00
|
|
|
}
|