use WrapMode::Word for text/plain

This commit is contained in:
yggverse 2025-03-14 20:42:36 +02:00
parent c58936d336
commit 1aae5a0f28

View file

@ -1,4 +1,4 @@
use gtk::{TextBuffer, TextView}; use gtk::TextView;
pub trait Plain { pub trait Plain {
fn plain(data: &str) -> Self; fn plain(data: &str) -> Self;
@ -10,13 +10,14 @@ impl Plain for TextView {
TextView::builder() TextView::builder()
.bottom_margin(MARGIN) .bottom_margin(MARGIN)
.cursor_visible(false) .cursor_visible(false)
.buffer(&TextBuffer::builder().text(data).build()) .buffer(&gtk::TextBuffer::builder().text(data).build())
.editable(false) .editable(false)
.left_margin(MARGIN) .left_margin(MARGIN)
.monospace(true) .monospace(true)
.right_margin(MARGIN) .right_margin(MARGIN)
.top_margin(MARGIN) .top_margin(MARGIN)
.vexpand(true) .vexpand(true)
.wrap_mode(gtk::WrapMode::Word)
.build() .build()
} }
} }