diff options
Diffstat (limited to 'src/gui/Conversation.vala')
-rw-r--r-- | src/gui/Conversation.vala | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/gui/Conversation.vala b/src/gui/Conversation.vala index 629461e..811fa5c 100644 --- a/src/gui/Conversation.vala +++ b/src/gui/Conversation.vala @@ -16,17 +16,16 @@ public class Conversation { Gtk.Button closeButton = new Gtk.Button(); Gdk.Pixbuf closeImage = render_icon(Gtk.STOCK_CLOSE, (Gtk.IconSize)(-1), null); - //Gtk.Image closeImage = new Gtk.Image.from_stock(Gtk.STOCK_CLOSE, (Gtk.IconSize)4); closeButton.image = new Gtk.Image.from_pixbuf(closeImage.scale_simple(16, 16, Gdk.InterpType.BILINEAR)); - //closeButton.width_request = 20; closeButton.height_request = 20; + closeButton.relief = Gtk.ReliefStyle.NONE; pack_end(closeButton, false, false, 0); show_all(); } } - public Conversation(Gtk.Notebook conversations0, string me0, string jid0, string? display_name0) { + public Conversation(Gtk.Notebook conversations0, string me0, string jid0, string? display_name0, bool explicit = true) { conversations = conversations0; me = me0; jid = jid0; @@ -55,7 +54,10 @@ public class Conversation { unowned Gtk.Label title = builder.get_object("ConversationTitle") as Gtk.Label; title.set_text("Conversation with " + display_name); - conversations.append_page(widget, new TabLabel(display_name)); + int page = conversations.append_page(widget, new TabLabel(display_name)); + conversations.set_tab_reorderable(widget, true); + if(explicit) + conversations.page = page; } ~Conversation() { @@ -66,13 +68,23 @@ public class Conversation { if(type != "chat") return; - content.buffer.text += me + ": " + message + "\n"; + string str = me + ": " + message; + + if(content.buffer.text.length != 0) + str = "\n" + str; + + content.buffer.text += str; } public void receive_message(string type, string message) { if(type != "chat") return; - content.buffer.text += display_name + ": " + message + "\n"; + string str = display_name + ": " + message; + + if(content.buffer.text.length != 0) + str = "\n" + str; + + content.buffer.text += str; } } |