summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-20 18:42:00 +0300
committerVika <vika@fireburn.ru>2024-08-20 18:42:00 +0300
commite89bd14809aab98fc5edf7f83f8dae2dec923a95 (patch)
tree360064e95d460ffa440cc281b4d129772af9c46a /src
parent7e403c00af4956a3996e5570eb0aa578745c520d (diff)
downloadbowl-e89bd14809aab98fc5edf7f83f8dae2dec923a95.tar.zst
Make the TextView scrollable
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f5cb19e..e97a9fa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -190,20 +190,27 @@ impl AsyncComponent for PostComposerModel {
                         },
 
                         #[name = "content_textarea"]
-                        gtk::TextView {
-                            set_buffer: Some(&model.content_buffer),
-                            set_hexpand: true,
+                        gtk::ScrolledWindow {
                             set_vexpand: true,
-                            set_css_classes: &["frame", "view"],
-                            set_monospace: true,
-                            set_left_margin: 8,
-                            set_right_margin: 8,
-                            set_top_margin: 8,
-                            set_bottom_margin: 8,
 
-                            #[track = "model.changed(Self::submit_busy_guard())"]
-                            set_sensitive: model.submit_busy_guard.is_none(),
-                        },
+                            gtk::TextView {
+                                set_buffer: Some(&model.content_buffer),
+                                set_hexpand: true,
+                                set_css_classes: &["frame", "view"],
+
+                                set_monospace: true,
+                                set_wrap_mode: gtk::WrapMode::Word,
+                                set_vscroll_policy: gtk::ScrollablePolicy::Natural,
+
+                                set_left_margin: 8,
+                                set_right_margin: 8,
+                                set_top_margin: 8,
+                                set_bottom_margin: 8,
+
+                                #[track = "model.changed(Self::submit_busy_guard())"]
+                                set_sensitive: model.submit_busy_guard.is_none(),
+                            }
+                        }
                     },
 
                     add_breakpoint = adw::Breakpoint::new(