Fix some UI issues

This commit is contained in:
Marvin W 2017-08-21 23:21:13 +02:00
parent dff8e08669
commit a24e88f48b
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
5 changed files with 13 additions and 6 deletions

View file

@ -9,7 +9,7 @@ namespace Dino.Ui.ConversationSummary {
public class MergedMessageItem : MessageItem { public class MergedMessageItem : MessageItem {
private Label name_label = new Label("") { xalign=0, visible=true }; private Label name_label = new Label("") { xalign=0, visible=true, hexpand=true };
private MessageTextView textview = new MessageTextView() { visible=true }; private MessageTextView textview = new MessageTextView() { visible=true };
public MergedMessageItem(StreamInteractor stream_interactor, Conversation conversation, Message message) { public MergedMessageItem(StreamInteractor stream_interactor, Conversation conversation, Message message) {

View file

@ -21,6 +21,12 @@ public class MessageTextView : TextView {
style_updated.connect(update_display_style); style_updated.connect(update_display_style);
} }
// Workaround GTK TextView issues
public override void get_preferred_width (out int minimum_width, out int natural_width) {
base.get_preferred_width(out minimum_width, out natural_width);
minimum_width = 0;
}
public void add_text(string text) { public void add_text(string text) {
TextIter end; TextIter end;
buffer.get_end_iter(out end); buffer.get_end_iter(out end);

View file

@ -199,6 +199,7 @@ public class View : Box {
} }
} }
// Workaround GTK TextView issues
private void force_alloc_width(Widget widget, int width) { private void force_alloc_width(Widget widget, int width) {
Allocation alloc = Allocation(); Allocation alloc = Allocation();
widget.get_preferred_width(out alloc.width, null); widget.get_preferred_width(out alloc.width, null);

View file

@ -78,15 +78,15 @@ public class UnifiedWindow : Window {
grid.add(chat_input); grid.add(chat_input);
paned.set_position(300); paned.set_position(300);
paned.add1(filterable_conversation_list); paned.pack1(filterable_conversation_list, false, false);
paned.add2(grid); paned.pack2(grid, true, false);
} }
private void setup_headerbar() { private void setup_headerbar() {
conversation_titlebar = new ConversationTitlebar(stream_interactor, this) { visible=true }; conversation_titlebar = new ConversationTitlebar(stream_interactor, this) { visible=true };
conversation_list_titlebar = new ConversationListTitlebar(stream_interactor, this) { visible=true }; conversation_list_titlebar = new ConversationListTitlebar(stream_interactor, this) { visible=true };
headerbar_paned.add1(conversation_list_titlebar); headerbar_paned.pack1(conversation_list_titlebar, false, false);
headerbar_paned.add2(conversation_titlebar); headerbar_paned.pack2(conversation_titlebar, true, false);
// Distribute start/end decoration_layout buttons to left/right headerbar. Ensure app menu fallback. // Distribute start/end decoration_layout buttons to left/right headerbar. Ensure app menu fallback.
Gtk.Settings? gtk_settings = Gtk.Settings.get_default(); Gtk.Settings? gtk_settings = Gtk.Settings.get_default();

View file

@ -33,7 +33,7 @@ public class XmppLog {
} }
if (d.contains(":") && d.index_of("{") == 0 && d.index_of("}") != -1) { if (d.contains(":") && d.index_of("{") == 0 && d.index_of("}") != -1) {
int end = d.index_of("}"); int end = d.index_of("}");
this.ns_uri = d.substring(1, end - 2); this.ns_uri = d.substring(1, end - 1);
d = d.substring(end + 2); d = d.substring(end + 2);
} }
if (d.contains(".")) { if (d.contains(".")) {