Redraw UI on window resize

This commit is contained in:
veeso
2022-01-06 10:44:34 +01:00
committed by Christian Visintin
parent c1edc20462
commit edd0842273
12 changed files with 18 additions and 0 deletions
+1
View File
@@ -84,6 +84,7 @@ impl Component<Msg, NoUserEvent> for GlobalListener {
code: Key::Char('s'), code: Key::Char('s'),
modifiers: KeyModifiers::CONTROL, modifiers: KeyModifiers::CONTROL,
}) => Some(Msg::Ui(UiMsg::ShowSaveBookmarkPopup)), }) => Some(Msg::Ui(UiMsg::ShowSaveBookmarkPopup)),
Event::WindowResize(_, _) => Some(Msg::Ui(UiMsg::WindowResized)),
_ => None, _ => None,
} }
} }
+1
View File
@@ -135,6 +135,7 @@ pub enum UiMsg {
ShowSaveBookmarkPopup, ShowSaveBookmarkPopup,
UsernameBlurDown, UsernameBlurDown,
UsernameBlurUp, UsernameBlurUp,
WindowResized,
} }
/// Auth form input mask /// Auth form input mask
+3
View File
@@ -255,6 +255,9 @@ impl AuthActivity {
UiMsg::UsernameBlurUp => { UiMsg::UsernameBlurUp => {
assert!(self.app.active(&Id::Port).is_ok()); assert!(self.app.active(&Id::Port).is_ok());
} }
UiMsg::WindowResized => {
self.redraw = true;
}
} }
None None
+1
View File
@@ -842,6 +842,7 @@ impl AuthActivity {
}), }),
Self::no_popup_mounted_clause(), Self::no_popup_mounted_clause(),
), ),
Sub::new(SubEventClause::WindowResize, SubClause::Always)
] ]
) )
.is_ok()); .is_ok());
@@ -69,6 +69,7 @@ impl Component<Msg, NoUserEvent> for GlobalListener {
code: Key::Char('h') | Key::Function(1), code: Key::Char('h') | Key::Function(1),
modifiers: KeyModifiers::NONE, modifiers: KeyModifiers::NONE,
}) => Some(Msg::Ui(UiMsg::ShowKeybindingsPopup)), }) => Some(Msg::Ui(UiMsg::ShowKeybindingsPopup)),
Event::WindowResize(_, _) => Some(Msg::Ui(UiMsg::WindowResized)),
_ => None, _ => None,
} }
} }
+1
View File
@@ -177,6 +177,7 @@ enum UiMsg {
ShowSymlinkPopup, ShowSymlinkPopup,
ToggleHiddenFiles, ToggleHiddenFiles,
ToggleSyncBrowsing, ToggleSyncBrowsing,
WindowResized,
} }
/// Log level type /// Log level type
+3
View File
@@ -503,6 +503,9 @@ impl FileTransferActivity {
self.browser.toggle_sync_browsing(); self.browser.toggle_sync_browsing();
self.refresh_remote_status_bar(); self.refresh_remote_status_bar();
} }
UiMsg::WindowResized => {
self.redraw = true;
}
} }
None None
} }
+1
View File
@@ -896,6 +896,7 @@ impl FileTransferActivity {
}), }),
Self::no_popup_mounted_clause(), Self::no_popup_mounted_clause(),
), ),
Sub::new(SubEventClause::WindowResize, SubClause::Always)
] ]
) )
.is_ok()); .is_ok());
@@ -81,6 +81,7 @@ impl Component<Msg, NoUserEvent> for GlobalListener {
code: Key::Function(4), code: Key::Function(4),
modifiers: KeyModifiers::NONE, modifiers: KeyModifiers::NONE,
}) => Some(Msg::Common(CommonMsg::ShowSavePopup)), }) => Some(Msg::Common(CommonMsg::ShowSavePopup)),
Event::WindowResize(_, _) => Some(Msg::Common(CommonMsg::WindowResized)),
_ => None, _ => None,
} }
} }
+1
View File
@@ -145,6 +145,7 @@ pub enum CommonMsg {
ShowKeybindings, ShowKeybindings,
ShowQuitPopup, ShowQuitPopup,
ShowSavePopup, ShowSavePopup,
WindowResized,
} }
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
+3
View File
@@ -116,6 +116,9 @@ impl SetupActivity {
CommonMsg::ShowSavePopup => { CommonMsg::ShowSavePopup => {
self.mount_save_popup(); self.mount_save_popup();
} }
CommonMsg::WindowResized => {
self.redraw = true;
}
} }
None None
} }
+1
View File
@@ -255,6 +255,7 @@ impl SetupActivity {
}), }),
Self::no_popup_mounted_clause(), Self::no_popup_mounted_clause(),
), ),
Sub::new(SubEventClause::WindowResize, SubClause::Always)
] ]
) )
.is_ok()); .is_ok());