Reformat [GtkChild]

This commit is contained in:
fiaxh 2017-03-10 18:07:28 +01:00
parent cf51e1dee2
commit 4c48c5c16d
30 changed files with 127 additions and 215 deletions

View file

@ -8,23 +8,12 @@ namespace Dino.Ui.AddConversation.Chat {
[GtkTemplate (ui = "/org/dino-im/add_conversation/add_contact_dialog.ui")] [GtkTemplate (ui = "/org/dino-im/add_conversation/add_contact_dialog.ui")]
protected class AddContactDialog : Gtk.Dialog { protected class AddContactDialog : Gtk.Dialog {
[GtkChild] [GtkChild] private ComboBoxText accounts_comboboxtext;
private ComboBoxText accounts_comboboxtext; [GtkChild] private Button ok_button;
[GtkChild] private Button cancel_button;
[GtkChild] [GtkChild] private Entry jid_entry;
private Button ok_button; [GtkChild] private Entry alias_entry;
[GtkChild] private CheckButton subscribe_checkbutton;
[GtkChild]
private Button cancel_button;
[GtkChild]
private Entry jid_entry;
[GtkChild]
private Entry alias_entry;
[GtkChild]
private CheckButton subscribe_checkbutton;
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;

View file

@ -79,4 +79,5 @@ public class Dialog : Gtk.Dialog {
close(); close();
} }
} }
} }

View file

@ -5,6 +5,7 @@ using Dino.Entities;
using Xmpp; using Xmpp;
namespace Dino.Ui.AddConversation.Chat { namespace Dino.Ui.AddConversation.Chat {
protected class RosterList : FilterableList { protected class RosterList : FilterableList {
public signal void conversation_selected(Conversation? conversation); public signal void conversation_selected(Conversation? conversation);
@ -74,4 +75,5 @@ protected class RosterList : FilterableList {
return c1.name_label.label.collate(c2.name_label.label); return c1.name_label.label.collate(c2.name_label.label);
} }
} }
} }

View file

@ -8,32 +8,15 @@ namespace Dino.Ui.AddConversation.Conference {
[GtkTemplate (ui = "/org/dino-im/add_conversation/add_groupchat_dialog.ui")] [GtkTemplate (ui = "/org/dino-im/add_conversation/add_groupchat_dialog.ui")]
protected class AddGroupchatDialog : Gtk.Dialog { protected class AddGroupchatDialog : Gtk.Dialog {
[GtkChild] [GtkChild] private Stack accounts_stack;
private Stack accounts_stack; [GtkChild] private ComboBoxText accounts_comboboxtext;
[GtkChild] private Label account_label;
[GtkChild] [GtkChild] private Button ok_button;
private ComboBoxText accounts_comboboxtext; [GtkChild] private Button cancel_button;
[GtkChild] private Entry jid_entry;
[GtkChild] [GtkChild] private Entry alias_entry;
private Label account_label; [GtkChild] private Entry nick_entry;
[GtkChild] private CheckButton autojoin_checkbutton;
[GtkChild]
private Button ok_button;
[GtkChild]
private Button cancel_button;
[GtkChild]
private Entry jid_entry;
[GtkChild]
private Entry alias_entry;
[GtkChild]
private Entry nick_entry;
[GtkChild]
private CheckButton autojoin_checkbutton;
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
private Xmpp.Xep.Bookmarks.Conference? edit_confrence = null; private Xmpp.Xep.Bookmarks.Conference? edit_confrence = null;
@ -104,4 +87,5 @@ protected class AddGroupchatDialog : Gtk.Dialog {
close(); close();
} }
} }
} }

View file

@ -53,53 +53,25 @@ protected class ConferenceDetailsFragment : Box {
} }
} }
[GtkChild] [GtkChild] private Stack accounts_stack;
private Stack accounts_stack; [GtkChild] private Button accounts_button;
[GtkChild] private Label accounts_label;
[GtkChild] private ComboBoxText accounts_comboboxtext;
[GtkChild] [GtkChild] private Stack jid_stack;
private Stack jid_stack; [GtkChild] private Button jid_button;
[GtkChild] private Label jid_label;
[GtkChild] private Entry jid_entry;
[GtkChild] [GtkChild] private Stack nick_stack;
private Stack nick_stack; [GtkChild] private Button nick_button;
[GtkChild] private Label nick_label;
[GtkChild] private Entry nick_entry;
[GtkChild] [GtkChild] private Stack password_stack;
private Stack password_stack; [GtkChild] private Button password_button;
[GtkChild] private Label password_label;
[GtkChild] [GtkChild] private Entry password_entry;
private Button accounts_button;
[GtkChild]
private Button jid_button;
[GtkChild]
private Button nick_button;
[GtkChild]
private Button password_button;
[GtkChild]
private Label accounts_label;
[GtkChild]
private Label jid_label;
[GtkChild]
private Label nick_label;
[GtkChild]
private Label password_label;
[GtkChild]
private ComboBoxText accounts_comboboxtext;
[GtkChild]
private Entry jid_entry;
[GtkChild]
private Entry nick_entry;
[GtkChild]
private Entry password_entry;
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;

View file

@ -5,6 +5,7 @@ using Xmpp;
using Dino.Entities; using Dino.Entities;
namespace Dino.Ui.AddConversation.Conference { namespace Dino.Ui.AddConversation.Conference {
protected class ConferenceList : FilterableList { protected class ConferenceList : FilterableList {
public signal void conversation_selected(Conversation? conversation); public signal void conversation_selected(Conversation? conversation);
@ -102,4 +103,5 @@ internal class ConferenceListRow : ListRow {
image.set_from_pixbuf((new AvatarGenerator(35, 35)).set_stateless(true).draw_jid(stream_interactor, jid, account)); image.set_from_pixbuf((new AvatarGenerator(35, 35)).set_stateless(true).draw_jid(stream_interactor, jid, account));
} }
} }
} }

View file

@ -8,14 +8,9 @@ namespace Dino.Ui.AddConversation {
[GtkTemplate (ui = "/org/dino-im/add_conversation/list_row.ui")] [GtkTemplate (ui = "/org/dino-im/add_conversation/list_row.ui")]
public class ListRow : ListBoxRow { public class ListRow : ListBoxRow {
[GtkChild] [GtkChild] public Image image;
public Image image; [GtkChild] public Label name_label;
[GtkChild] public Label via_label;
[GtkChild]
public Label name_label;
[GtkChild]
public Label via_label;
public Jid? jid; public Jid? jid;
public Account? account; public Account? account;
@ -40,4 +35,5 @@ public class ListRow : ListBoxRow {
image.set_from_pixbuf((new AvatarGenerator(35, 35)).draw_jid(stream_interactor, jid, account)); image.set_from_pixbuf((new AvatarGenerator(35, 35)).draw_jid(stream_interactor, jid, account));
} }
} }
} }

View file

@ -17,20 +17,11 @@ public class SelectJidFragment : Gtk.Box {
} }
private set {} } private set {} }
[GtkChild] [GtkChild] private Entry entry;
private Entry entry; [GtkChild] private Box box;
[GtkChild] private Button add_button;
[GtkChild] [GtkChild] private Button edit_button;
private Box box; [GtkChild] private Button remove_button;
[GtkChild]
private Button add_button;
[GtkChild]
private Button edit_button;
[GtkChild]
private Button remove_button;
private FilterableList filterable_list; private FilterableList filterable_list;
private ArrayList<AddListRow> added_rows = new ArrayList<AddListRow>(); private ArrayList<AddListRow> added_rows = new ArrayList<AddListRow>();

View file

@ -6,6 +6,7 @@ using Gtk;
using Dino.Entities; using Dino.Entities;
namespace Dino.Ui { namespace Dino.Ui {
public class AvatarGenerator { public class AvatarGenerator {
private const string COLOR_GREY = "E0E0E0"; private const string COLOR_GREY = "E0E0E0";
@ -230,4 +231,5 @@ public class AvatarGenerator {
hex_color.length > 6 ? (double) hex_color.substring(6, 2).to_long(null, 16) / 255 : 1); hex_color.length > 6 ? (double) hex_color.substring(6, 2).to_long(null, 16) / 255 : 1);
} }
} }
} }

View file

@ -6,11 +6,11 @@ using Dino.Entities;
using Xmpp; using Xmpp;
namespace Dino.Ui { namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/chat_input.ui")] [GtkTemplate (ui = "/org/dino-im/chat_input.ui")]
public class ChatInput : Grid { public class ChatInput : Grid {
[GtkChild] [GtkChild] private TextView text_input;
private TextView text_input;
private Conversation? conversation; private Conversation? conversation;
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
@ -120,4 +120,5 @@ public class ChatInput : Grid {
return false; return false;
} }
} }
} }

View file

@ -2,16 +2,15 @@ using Gtk;
using Dino.Entities; using Dino.Entities;
namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/conversation_list_titlebar.ui")] [GtkTemplate (ui = "/org/dino-im/conversation_list_titlebar.ui")]
public class Dino.Ui.ConversationListTitlebar : Gtk.HeaderBar { public class ConversationListTitlebar : Gtk.HeaderBar {
public signal void conversation_opened(Conversation conversation); public signal void conversation_opened(Conversation conversation);
[GtkChild] [GtkChild] private MenuButton add_button;
private MenuButton add_button; [GtkChild] public ToggleButton search_button;
[GtkChild]
public ToggleButton search_button;
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
@ -45,3 +44,4 @@ public class Dino.Ui.ConversationListTitlebar : Gtk.HeaderBar {
} }
} }
}

View file

@ -6,6 +6,7 @@ using Xmpp;
using Dino.Entities; using Dino.Entities;
namespace Dino.Ui.ConversationSelector { namespace Dino.Ui.ConversationSelector {
public class ChatRow : ConversationRow { public class ChatRow : ConversationRow {
public ChatRow(StreamInteractor stream_interactor, Conversation conversation) { public ChatRow(StreamInteractor stream_interactor, Conversation conversation) {
@ -85,4 +86,5 @@ public class ChatRow : ConversationRow {
return main_box; return main_box;
} }
} }
} }

View file

@ -11,29 +11,14 @@ namespace Dino.Ui.ConversationSelector {
[GtkTemplate (ui = "/org/dino-im/conversation_selector/conversation_row.ui")] [GtkTemplate (ui = "/org/dino-im/conversation_selector/conversation_row.ui")]
public abstract class ConversationRow : ListBoxRow { public abstract class ConversationRow : ListBoxRow {
[GtkChild] [GtkChild] protected Image image;
protected Image image; [GtkChild] private Label name_label;
[GtkChild] private Label time_label;
[GtkChild] [GtkChild] private Label message_label;
private Label name_label; [GtkChild] protected Button x_button;
[GtkChild] private Revealer time_revealer;
[GtkChild] [GtkChild] private Revealer xbutton_revealer;
private Label time_label; [GtkChild] public Revealer main_revealer;
[GtkChild]
private Label message_label;
[GtkChild]
protected Button x_button;
[GtkChild]
private Revealer time_revealer;
[GtkChild]
private Revealer xbutton_revealer;
[GtkChild]
public Revealer main_revealer;
public Conversation conversation { get; private set; } public Conversation conversation { get; private set; }
@ -170,6 +155,6 @@ public abstract class ConversationRow : ListBoxRow {
return "Just now"; return "Just now";
} }
} }
}
} }
}

View file

@ -1,6 +1,7 @@
using Dino.Entities; using Dino.Entities;
namespace Dino.Ui.ConversationSelector { namespace Dino.Ui.ConversationSelector {
public class GroupchatRow : ConversationRow { public class GroupchatRow : ConversationRow {
public GroupchatRow(StreamInteractor stream_interactor, Conversation conversation) { public GroupchatRow(StreamInteractor stream_interactor, Conversation conversation) {
@ -30,4 +31,5 @@ public class GroupchatRow : ConversationRow {
MucManager.get_instance(stream_interactor).part(conversation.account, conversation.counterpart); MucManager.get_instance(stream_interactor).part(conversation.account, conversation.counterpart);
} }
} }
} }

View file

@ -5,6 +5,7 @@ using Xmpp;
using Dino.Entities; using Dino.Entities;
namespace Dino.Ui.ConversationSelector { namespace Dino.Ui.ConversationSelector {
public class List : ListBox { public class List : ListBox {
public signal void conversation_selected(Conversation conversation); public signal void conversation_selected(Conversation conversation);
@ -170,4 +171,5 @@ public class List : ListBox {
return 0; return 0;
} }
} }
} }

View file

@ -10,14 +10,9 @@ namespace Dino.Ui.ConversationSelector {
public class View : Grid { public class View : Grid {
public List conversation_list; public List conversation_list;
[GtkChild] [GtkChild] public SearchEntry search_entry;
public SearchEntry search_entry; [GtkChild] public SearchBar search_bar;
[GtkChild] private ScrolledWindow scrolled;
[GtkChild]
public SearchBar search_bar;
[GtkChild]
private ScrolledWindow scrolled;
public View(StreamInteractor stream_interactor) { public View(StreamInteractor stream_interactor) {
conversation_list = new List(stream_interactor); conversation_list = new List(stream_interactor);
@ -53,4 +48,5 @@ public class View : Grid {
return false; return false;
} }
} }
} }

View file

@ -15,23 +15,12 @@ public class MergedMessageItem : Grid {
public DateTime initial_time { get; private set; } public DateTime initial_time { get; private set; }
public ArrayList<Message> messages = new ArrayList<Message>(Message.equals_func); public ArrayList<Message> messages = new ArrayList<Message>(Message.equals_func);
[GtkChild] [GtkChild] private Image image;
private Image image; [GtkChild] private Label time_label;
[GtkChild] private Label name_label;
[GtkChild] [GtkChild] private Image encryption_image;
private Label time_label; [GtkChild] private Image received_image;
[GtkChild] private TextView message_text_view;
[GtkChild]
private Label name_label;
[GtkChild]
private Image encryption_image;
[GtkChild]
private Image received_image;
[GtkChild]
private TextView message_text_view;
public MergedMessageItem(StreamInteractor stream_interactor, Conversation conversation, Message message) { public MergedMessageItem(StreamInteractor stream_interactor, Conversation conversation, Message message) {
this.conversation = conversation; this.conversation = conversation;

View file

@ -27,4 +27,5 @@ private class MergedStatusItem : Expander {
} }
} }
} }
} }

View file

@ -26,4 +26,5 @@ private class StatusItem : Grid {
show_all(); show_all();
} }
} }
} }

View file

@ -13,11 +13,8 @@ public class View : Box {
public Conversation? conversation { get; private set; } public Conversation? conversation { get; private set; }
public HashMap<Entities.Message, MergedMessageItem> message_items = new HashMap<Entities.Message, MergedMessageItem>(Entities.Message.hash_func, Entities.Message.equals_func); public HashMap<Entities.Message, MergedMessageItem> message_items = new HashMap<Entities.Message, MergedMessageItem>(Entities.Message.hash_func, Entities.Message.equals_func);
[GtkChild] [GtkChild] private ScrolledWindow scrolled;
private ScrolledWindow scrolled; [GtkChild] private Box main;
[GtkChild]
private Box main;
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
private MergedMessageItem? last_message_item; private MergedMessageItem? last_message_item;
@ -219,4 +216,5 @@ public class View : Box {
main.@foreach((widget) => { main.remove(widget); }); main.@foreach((widget) => { main.remove(widget); });
} }
} }
} }

View file

@ -2,20 +2,18 @@ using Gtk;
using Dino.Entities; using Dino.Entities;
namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/conversation_titlebar.ui")] [GtkTemplate (ui = "/org/dino-im/conversation_titlebar.ui")]
public class Dino.Ui.ConversationTitlebar : Gtk.HeaderBar { public class ConversationTitlebar : Gtk.HeaderBar {
[GtkChild] [GtkChild] private MenuButton menu_button;
private MenuButton menu_button; [GtkChild] private MenuButton encryption_button;
[GtkChild] private MenuButton groupchat_button;
[GtkChild]
private MenuButton encryption_button;
private RadioButton? button_unencrypted; private RadioButton? button_unencrypted;
private RadioButton? button_pgp; private RadioButton? button_pgp;
[GtkChild]
private MenuButton groupchat_button;
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
private Conversation? conversation; private Conversation? conversation;
@ -122,3 +120,4 @@ public class Dino.Ui.ConversationTitlebar : Gtk.HeaderBar {
} }
} }
}

View file

@ -7,11 +7,8 @@ namespace Dino.Ui.ManageAccounts {
[GtkTemplate (ui = "/org/dino-im/manage_accounts/account_row.ui")] [GtkTemplate (ui = "/org/dino-im/manage_accounts/account_row.ui")]
public class AccountRow : Gtk.ListBoxRow { public class AccountRow : Gtk.ListBoxRow {
[GtkChild] [GtkChild] public Image image;
public Image image; [GtkChild] public Label jid_label;
[GtkChild]
public Label jid_label;
public Account account; public Account account;
@ -21,4 +18,5 @@ public class AccountRow : Gtk.ListBoxRow {
jid_label.set_label(account.bare_jid.to_string()); jid_label.set_label(account.bare_jid.to_string());
} }
} }
} }

View file

@ -10,20 +10,11 @@ public class AddAccountDialog : Gtk.Dialog {
public signal void added(Account account); public signal void added(Account account);
[GtkChild] [GtkChild] private Button cancel_button;
private Button cancel_button; [GtkChild] private Button ok_button;
[GtkChild] private Entry alias_entry;
[GtkChild] [GtkChild] private Entry jid_entry;
private Button ok_button; [GtkChild] private Entry password_entry;
[GtkChild]
private Entry alias_entry;
[GtkChild]
private Entry jid_entry;
[GtkChild]
private Entry password_entry;
public AddAccountDialog(StreamInteractor stream_interactor) { public AddAccountDialog(StreamInteractor stream_interactor) {
Object(use_header_bar : 1); Object(use_header_bar : 1);
@ -67,4 +58,5 @@ public class AddAccountDialog : Gtk.Dialog {
close(); close();
} }
} }
} }

View file

@ -20,14 +20,17 @@ public class Dialog : Gtk.Window {
[GtkChild] public Button image_button; [GtkChild] public Button image_button;
[GtkChild] public Label jid_label; [GtkChild] public Label jid_label;
[GtkChild] public Switch active_switch; [GtkChild] public Switch active_switch;
[GtkChild] public Stack password_stack; [GtkChild] public Stack password_stack;
[GtkChild] public Label password_label; [GtkChild] public Label password_label;
[GtkChild] public Button password_button; [GtkChild] public Button password_button;
[GtkChild] public Entry password_entry; [GtkChild] public Entry password_entry;
[GtkChild] public Stack alias_stack; [GtkChild] public Stack alias_stack;
[GtkChild] public Label alias_label; [GtkChild] public Label alias_label;
[GtkChild] public Button alias_button; [GtkChild] public Button alias_button;
[GtkChild] public Entry alias_entry; [GtkChild] public Entry alias_entry;
[GtkChild] public Stack pgp_stack; [GtkChild] public Stack pgp_stack;
[GtkChild] public Label pgp_label; [GtkChild] public Label pgp_label;
[GtkChild] public Button pgp_button; [GtkChild] public Button pgp_button;
@ -189,5 +192,6 @@ public class Dialog : Gtk.Window {
if (stack != pgp_stack) pgp_stack.set_visible_child_name("label"); if (stack != pgp_stack) pgp_stack.set_visible_child_name("label");
} }
} }
} }

View file

@ -2,6 +2,7 @@ using Dino.Entities;
using Xmpp; using Xmpp;
namespace Dino.Ui { namespace Dino.Ui {
public class Notifications : GLib.Object { public class Notifications : GLib.Object {
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
@ -52,4 +53,5 @@ public class Notifications : GLib.Object {
} catch (Error error) { } } catch (Error error) { }
} }
} }
} }

View file

@ -4,17 +4,15 @@ using Gtk;
using Dino.Entities; using Dino.Entities;
namespace Dino.Ui{ namespace Dino.Ui{
[GtkTemplate (ui = "/org/dino-im/occupant_list.ui")] [GtkTemplate (ui = "/org/dino-im/occupant_list.ui")]
public class OccupantList : Box { public class OccupantList : Box {
public signal void conversation_selected(Conversation? conversation); public signal void conversation_selected(Conversation? conversation);
private StreamInteractor stream_interactor; private StreamInteractor stream_interactor;
[GtkChild] [GtkChild] private ListBox list_box;
private ListBox list_box; [GtkChild] private SearchEntry search_entry;
[GtkChild]
private SearchEntry search_entry;
private Conversation? conversation; private Conversation? conversation;
private string[]? filter_values; private string[]? filter_values;
@ -109,4 +107,5 @@ public class OccupantList : Box {
return 0; return 0;
} }
} }
} }

View file

@ -8,11 +8,8 @@ namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/occupant_list_item.ui")] [GtkTemplate (ui = "/org/dino-im/occupant_list_item.ui")]
public class OccupantListRow : ListBoxRow { public class OccupantListRow : ListBoxRow {
[GtkChild] [GtkChild] private Image image;
private Image image; [GtkChild] public Label name_label;
[GtkChild]
public Label name_label;
public OccupantListRow(StreamInteractor stream_interactor, Account account, Jid jid) { public OccupantListRow(StreamInteractor stream_interactor, Account account, Jid jid) {
name_label.label = Util.get_display_name(stream_interactor, jid, account); name_label.label = Util.get_display_name(stream_interactor, jid, account);
@ -24,4 +21,5 @@ public class OccupantListRow : ListBoxRow {
} }
} }
} }

View file

@ -5,11 +5,8 @@ namespace Dino.Ui {
[GtkTemplate (ui = "/org/dino-im/settings_dialog.ui")] [GtkTemplate (ui = "/org/dino-im/settings_dialog.ui")]
class SettingsDialog : Dialog { class SettingsDialog : Dialog {
[GtkChild] [GtkChild] private CheckButton marker_checkbutton;
private CheckButton marker_checkbutton; [GtkChild] private CheckButton emoji_checkbutton;
[GtkChild]
private CheckButton emoji_checkbutton;
Dino.Settings settings = Dino.Settings.instance(); Dino.Settings settings = Dino.Settings.instance();

View file

@ -2,7 +2,9 @@ using Gtk;
using Dino.Entities; using Dino.Entities;
public class Dino.Ui.UnifiedWindow : Window { namespace Dino.Ui {
public class UnifiedWindow : Window {
public ChatInput chat_input; public ChatInput chat_input;
public ConversationListTitlebar conversation_list_titlebar; public ConversationListTitlebar conversation_list_titlebar;
public ConversationSelector.View filterable_conversation_list; public ConversationSelector.View filterable_conversation_list;
@ -76,3 +78,4 @@ public class Dino.Ui.UnifiedWindow : Window {
} }
} }
}

View file

@ -3,7 +3,9 @@ using Gtk;
using Dino.Entities; using Dino.Entities;
using Xmpp; using Xmpp;
public class Dino.Ui.Util : GLib.Object { namespace Dino.Ui {
public class Util : Object {
private const string[] tango_colors_light = {"FCE94F", "FCAF3E", "E9B96E", "8AE234", "729FCF", "AD7FA8", "EF2929"}; private const string[] tango_colors_light = {"FCE94F", "FCAF3E", "E9B96E", "8AE234", "729FCF", "AD7FA8", "EF2929"};
private const string[] tango_colors_medium = {"EDD400", "F57900", "C17D11", "73D216", "3465A4", "75507B", "CC0000"}; private const string[] tango_colors_medium = {"EDD400", "F57900", "C17D11", "73D216", "3465A4", "75507B", "CC0000"};
@ -69,3 +71,5 @@ public class Dino.Ui.Util : GLib.Object {
image.set_from_surface(Gdk.cairo_surface_create_from_pixbuf(pixbuf, scale, image.get_window())); image.set_from_surface(Gdk.cairo_surface_create_from_pixbuf(pixbuf, scale, image.get_window()));
} }
} }
}