Redraw UI on window resize

This commit is contained in:
veeso
2021-12-28 11:00:00 +01:00
committed by Christian Visintin
parent c1edc20462
commit edd0842273
12 changed files with 18 additions and 0 deletions

View File

@@ -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,
}
}

View File

@@ -145,6 +145,7 @@ pub enum CommonMsg {
ShowKeybindings,
ShowQuitPopup,
ShowSavePopup,
WindowResized,
}
#[derive(Debug, Clone, PartialEq)]

View File

@@ -116,6 +116,9 @@ impl SetupActivity {
CommonMsg::ShowSavePopup => {
self.mount_save_popup();
}
CommonMsg::WindowResized => {
self.redraw = true;
}
}
None
}

View File

@@ -255,6 +255,7 @@ impl SetupActivity {
}),
Self::no_popup_mounted_clause(),
),
Sub::new(SubEventClause::WindowResize, SubClause::Always)
]
)
.is_ok());