From 19ea9e13377d4a6f82a057bc9daf1baad0b31895 Mon Sep 17 00:00:00 2001 From: iamazy Date: Tue, 12 Aug 2025 07:59:36 +0800 Subject: [PATCH 1/3] chore: unified scroll pixels --- crates/egui-term/src/input/mod.rs | 6 +++--- crates/egui-term/src/view.rs | 1 - nxshell/src/app.rs | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/egui-term/src/input/mod.rs b/crates/egui-term/src/input/mod.rs index dba8a30..ae9a85f 100644 --- a/crates/egui-term/src/input/mod.rs +++ b/crates/egui-term/src/input/mod.rs @@ -105,9 +105,9 @@ impl TerminalView<'_> { } (MouseWheelUnit::Point, _) => { let font_size = self.options.font.font_size(); - state.scroll_pixels -= delta.y; - let lines = (state.scroll_pixels / font_size).trunc(); - state.scroll_pixels %= font_size; + state.scrollbar_state.scroll_pixels -= delta.y; + let lines = (state.scrollbar_state.scroll_pixels / font_size).trunc(); + state.scrollbar_state.scroll_pixels %= font_size; if lines != 0.0 { Some(InputAction::BackendCall(BackendCommand::Scroll( -lines as i32, diff --git a/crates/egui-term/src/view.rs b/crates/egui-term/src/view.rs index d1f6553..88e6da9 100644 --- a/crates/egui-term/src/view.rs +++ b/crates/egui-term/src/view.rs @@ -20,7 +20,6 @@ use egui::{Response, Vec2}; #[derive(Clone, Default)] pub struct TerminalViewState { pub is_dragged: bool, - pub scroll_pixels: f32, // for terminal pub mouse_point: Point, pub mouse_position: Option, diff --git a/nxshell/src/app.rs b/nxshell/src/app.rs index 9476328..0426cef 100644 --- a/nxshell/src/app.rs +++ b/nxshell/src/app.rs @@ -91,6 +91,7 @@ impl NxShell { state_manager, }) } + pub fn start(options: NativeOptions) -> eframe::Result<()> { eframe::run_native( "NxShell", From 11615629344531e8ff767c0d450b6f19ecc95a06 Mon Sep 17 00:00:00 2001 From: iamazy Date: Tue, 12 Aug 2025 07:59:59 +0800 Subject: [PATCH 2/3] chore: unified scroll pixels --- nxshell/src/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nxshell/src/app.rs b/nxshell/src/app.rs index 0426cef..32424fe 100644 --- a/nxshell/src/app.rs +++ b/nxshell/src/app.rs @@ -91,7 +91,7 @@ impl NxShell { state_manager, }) } - + pub fn start(options: NativeOptions) -> eframe::Result<()> { eframe::run_native( "NxShell", From 0885781859e2ed6e65695329cd8db7ff397ac642 Mon Sep 17 00:00:00 2001 From: iamazy Date: Tue, 12 Aug 2025 08:18:06 +0800 Subject: [PATCH 3/3] chore: unified scroll pixels --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b201b6..1db2ea7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ An open-source, cross-platform SSH session manager powered by