chore: add zoom on scroll message handling

This commit is contained in:
Justin Gross 2024-09-12 20:29:27 -04:00
parent 8900966300
commit 8e74a08704
No known key found for this signature in database
GPG key ID: C263DFAAD9E18BB2

View file

@ -828,6 +828,8 @@ pub enum Message {
ZoomDefault,
ZoomIn,
ZoomOut,
ScrollUp,
ScrollDown,
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
@ -1546,6 +1548,16 @@ impl Tab {
Message::AddNetworkDrive => {
commands.push(Command::AddNetworkDrive);
}
Message::ScrollUp => {
if mod_ctrl {
self.update(Message::ZoomIn, modifiers);
}
}
Message::ScrollDown => {
if mod_ctrl {
self.update(Message::ZoomOut, modifiers);
}
}
Message::ClickRelease(click_i_opt) => {
if click_i_opt == self.clicked.take() {
return commands;