mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
add margins to list tag
This commit is contained in:
parent
d646c95563
commit
918838fe96
@ -136,14 +136,22 @@ impl Reader {
|
|||||||
// Is list
|
// Is list
|
||||||
if let Some(list) = List::from(line) {
|
if let Some(list) = List::from(line) {
|
||||||
// Build tag from level parsed
|
// Build tag from level parsed
|
||||||
let tag = TextTag::builder().wrap_mode(gtk::WrapMode::Word).build();
|
let tag = TextTag::builder()
|
||||||
|
.left_margin(28)
|
||||||
|
.pixels_above_lines(4)
|
||||||
|
.pixels_below_lines(4)
|
||||||
|
.wrap_mode(gtk::WrapMode::Word)
|
||||||
|
.build();
|
||||||
|
|
||||||
// Register tag in buffer
|
// Register tag in buffer
|
||||||
buffer.tag_table().add(&tag);
|
buffer.tag_table().add(&tag);
|
||||||
|
|
||||||
// Append value to buffer
|
// Append value to buffer
|
||||||
buffer.insert(&mut buffer.end_iter(), " • ");
|
buffer.insert_with_tags(
|
||||||
buffer.insert_with_tags(&mut buffer.end_iter(), list.value.as_str(), &[&tag]);
|
&mut buffer.end_iter(),
|
||||||
|
format!("• {}", list.value).as_str(),
|
||||||
|
&[&tag],
|
||||||
|
);
|
||||||
buffer.insert(&mut buffer.end_iter(), "\n");
|
buffer.insert(&mut buffer.end_iter(), "\n");
|
||||||
|
|
||||||
// Skip other actions for this line
|
// Skip other actions for this line
|
||||||
|
Loading…
x
Reference in New Issue
Block a user