mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-10 03:10:41 +00:00
Have child views take focus when added to StackView.
This commit is contained in:
parent
eb6af9b981
commit
5d9e8f760b
@ -199,6 +199,7 @@ impl Cursive {
|
||||
/// It will wait for user input (key presses) and trigger callbacks accordingly.
|
||||
/// Blocks until quit() is called.
|
||||
pub fn run(&mut self) {
|
||||
|
||||
// And the big event loop begins!
|
||||
while self.running {
|
||||
// Do we need to redraw everytime?
|
||||
|
@ -26,7 +26,8 @@ impl StackView {
|
||||
}
|
||||
|
||||
/// Add new view on top of the stack.
|
||||
pub fn add_layer<T: 'static + View>(&mut self, view: T) {
|
||||
pub fn add_layer<T: 'static + View>(&mut self, mut view: T) {
|
||||
view.take_focus();
|
||||
self.layers.push(Layer {
|
||||
view: Box::new(ShadowView::new(view)),
|
||||
size: Vec2::new(0,0),
|
||||
|
Loading…
Reference in New Issue
Block a user