Open michalfita opened 5 years ago
Hi, and thanks for the report!
I think the problem is just that TextView only draws the background for the text it contains; so even though it extends to the right end of the screen, you don't see it.
This is what you get with add_transparent_layer
. You can manually wrap a view in a Layer
, which will fill the background for the entire view.
Right, makes sense:
// Status bar
let mut panes = LinearLayout::vertical();
panes.add_child(BoxView::with_full_screen(DummyView));
panes.add_child(Layer::new(
PaddedView::new(
((1,1),(0,0)), TextView::new("© 2018 Cursive)
.h_align(align::HAlign::Right)
.with_id("status")
.full_width()
.fixed_height(1)
)
));
siv.screen_mut().add_transparent_layer(panes);
Produces what I want:
As these issues act as good additional documentation, I think my example may help.
Plus, I believe it demonstrates some deficiencies of the current Cursive API.
Bug Report/Asking for Help
Problem description
Following code snippet (excerpt from modified example code):
shows: While I expect the bottom bar to be extended to maximum screen width. I can't tell whether it's a bug in the code or I don't understand documentation. However, maybe somebody can help.
Environment
locale
in a terminal): No such thing in Windows, but my main language is Polish :-)