mirror of
https://github.com/veeso/termscp.git
synced 2026-04-05 09:41:53 -07:00
Redraw UI on window resize
This commit is contained in:
committed by
Christian Visintin
parent
c1edc20462
commit
edd0842273
@@ -81,6 +81,7 @@ impl Component<Msg, NoUserEvent> for GlobalListener {
|
||||
code: Key::Function(4),
|
||||
modifiers: KeyModifiers::NONE,
|
||||
}) => Some(Msg::Common(CommonMsg::ShowSavePopup)),
|
||||
Event::WindowResize(_, _) => Some(Msg::Common(CommonMsg::WindowResized)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,6 +145,7 @@ pub enum CommonMsg {
|
||||
ShowKeybindings,
|
||||
ShowQuitPopup,
|
||||
ShowSavePopup,
|
||||
WindowResized,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
||||
@@ -116,6 +116,9 @@ impl SetupActivity {
|
||||
CommonMsg::ShowSavePopup => {
|
||||
self.mount_save_popup();
|
||||
}
|
||||
CommonMsg::WindowResized => {
|
||||
self.redraw = true;
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
@@ -255,6 +255,7 @@ impl SetupActivity {
|
||||
}),
|
||||
Self::no_popup_mounted_clause(),
|
||||
),
|
||||
Sub::new(SubEventClause::WindowResize, SubClause::Always)
|
||||
]
|
||||
)
|
||||
.is_ok());
|
||||
|
||||
Reference in New Issue
Block a user