Add box around /me
This commit is contained in:
parent
db2766bbb4
commit
7aa192047b
1 changed files with 30 additions and 11 deletions
|
|
@ -140,10 +140,14 @@ impl Drawer {
|
|||
.node()
|
||||
.with_border_all(length(1.0))
|
||||
.with_padding_horiz(length(1.0))
|
||||
.with_margin_right(length(4.0))
|
||||
.with_flex_shrink(0.0) // Avoid wrapping
|
||||
.and_child(username)
|
||||
.register(&mut tree)?;
|
||||
|
||||
let content = if let Some(content) = content.strip_prefix("/me") {
|
||||
let content = content.trim_start();
|
||||
|
||||
let content = Text::new()
|
||||
.and_plain(content)
|
||||
.widget(&mut self.ctx.font_stuff)
|
||||
|
|
@ -151,17 +155,32 @@ impl Drawer {
|
|||
.with_max_size_height(length(max_content_height_in_lines * 16.0))
|
||||
.register(&mut tree)?;
|
||||
|
||||
let content = Node::empty()
|
||||
Block::new()
|
||||
.with_border(BLACK)
|
||||
.node()
|
||||
.with_border_all(length(1.0))
|
||||
.with_padding_horiz(length(1.0))
|
||||
.and_child(content)
|
||||
.register(&mut tree)?
|
||||
} else {
|
||||
let content = Text::new()
|
||||
.and_plain(content)
|
||||
.widget(&mut self.ctx.font_stuff)
|
||||
.node()
|
||||
.with_max_size_height(length(max_content_height_in_lines * 16.0))
|
||||
.register(&mut tree)?;
|
||||
|
||||
Node::empty()
|
||||
.with_padding_vert(length(1.0))
|
||||
.and_child(content)
|
||||
.register(&mut tree)?;
|
||||
.register(&mut tree)?
|
||||
};
|
||||
|
||||
let root = Node::empty()
|
||||
.with_size_width(percent(1.0))
|
||||
.with_padding_vert(length(1.0))
|
||||
.with_flex_direction(FlexDirection::Row)
|
||||
.with_align_items(Some(AlignItems::Start))
|
||||
.with_gap_width(length(4.0))
|
||||
.and_child(username)
|
||||
.and_child(content)
|
||||
.register(&mut tree)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue