aboutsummaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2022-01-12 21:04:54 +0100
committerfiaxh <git@lightrise.org>2022-01-12 22:52:55 +0100
commiteefce3fd81d7fcb349acb073941ebf5ca9140507 (patch)
tree230f223c2bce71c6142c4cdf75f5ed9e4115bf83 /main/src
parent4e9e09a648a6bec75e0baeb934dbe5dcef0108b6 (diff)
downloaddino-eefce3fd81d7fcb349acb073941ebf5ca9140507.tar.gz
dino-eefce3fd81d7fcb349acb073941ebf5ca9140507.zip
Prevent ChatTextView from increasing in height after text was entered
fixes #1064
Diffstat (limited to 'main/src')
-rw-r--r--main/src/ui/chat_input/chat_text_view.vala9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/src/ui/chat_input/chat_text_view.vala b/main/src/ui/chat_input/chat_text_view.vala
index 2f8393d2..928c81ed 100644
--- a/main/src/ui/chat_input/chat_text_view.vala
+++ b/main/src/ui/chat_input/chat_text_view.vala
@@ -35,7 +35,9 @@ public class ChatTextView : ScrolledWindow {
public signal void send_text();
public signal void cancel_input();
- public TextView text_view = new TextView() { can_focus=true, hexpand=true, margin=8, wrap_mode=Gtk.WrapMode.WORD_CHAR, valign=Align.CENTER, visible=true };
+ public TextView text_view = new TextView() { can_focus=true, hexpand=true, wrap_mode=Gtk.WrapMode.WORD_CHAR, valign=Align.CENTER, visible=true };
+ // Hack to prevent the ChatTextView from increasing in height after text was entered
+ private Label zero_width_label_hack = new Label("​") { hexpand=false, valign=Align.CENTER, opacity=0, visible=true };
private int vscrollbar_min_height;
private SmileyConverter smiley_converter;
public EditHistory edit_history;
@@ -44,7 +46,10 @@ public class ChatTextView : ScrolledWindow {
construct {
max_content_height = 300;
propagate_natural_height = true;
- this.add(text_view);
+ Box box = new Box(Orientation.HORIZONTAL, 0) { hexpand=true, margin=8, valign=Align.CENTER, visible=true };
+ box.add(text_view);
+ box.add(zero_width_label_hack);
+ this.add(box);
smiley_converter = new SmileyConverter(text_view);
edit_history = new EditHistory(text_view);