mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
add TextView margins
This commit is contained in:
parent
ef615e2e03
commit
bf58e69817
@ -3,6 +3,8 @@ use gtk::{
|
|||||||
};
|
};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
const MARGIN: i32 = 16;
|
||||||
|
|
||||||
pub struct Widget {
|
pub struct Widget {
|
||||||
gobject: TextView,
|
gobject: TextView,
|
||||||
}
|
}
|
||||||
@ -16,11 +18,15 @@ impl Widget {
|
|||||||
motion_controller: EventControllerMotion,
|
motion_controller: EventControllerMotion,
|
||||||
) -> Arc<Self> {
|
) -> Arc<Self> {
|
||||||
let gobject = TextView::builder()
|
let gobject = TextView::builder()
|
||||||
.editable(false)
|
.bottom_margin(MARGIN)
|
||||||
.cursor_visible(false)
|
|
||||||
.wrap_mode(WrapMode::Word)
|
|
||||||
.vexpand(true)
|
|
||||||
.buffer(buffer)
|
.buffer(buffer)
|
||||||
|
.cursor_visible(false)
|
||||||
|
.editable(false)
|
||||||
|
.left_margin(MARGIN)
|
||||||
|
.right_margin(MARGIN)
|
||||||
|
.top_margin(MARGIN)
|
||||||
|
.vexpand(true)
|
||||||
|
.wrap_mode(WrapMode::Word)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
gobject.add_controller(primary_button_controller);
|
gobject.add_controller(primary_button_controller);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user