Skip to content

Commit e74d155

Browse files
authored
chore: unified scroll pixels (#35)
* chore: unified scroll pixels * chore: unified scroll pixels * chore: unified scroll pixels
1 parent 022a905 commit e74d155

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ An open-source, cross-platform SSH session manager powered by <a href="https://g
4040

4141
### Roadmap 🏁
4242

43-
- [ ] Scrollbar
43+
- [x] Scrollbar
4444
- [ ] Minimap
4545
- [ ] Colorful terminal
4646
- [ ] Sftp

crates/egui-term/src/input/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ impl TerminalView<'_> {
105105
}
106106
(MouseWheelUnit::Point, _) => {
107107
let font_size = self.options.font.font_size();
108-
state.scroll_pixels -= delta.y;
109-
let lines = (state.scroll_pixels / font_size).trunc();
110-
state.scroll_pixels %= font_size;
108+
state.scrollbar_state.scroll_pixels -= delta.y;
109+
let lines = (state.scrollbar_state.scroll_pixels / font_size).trunc();
110+
state.scrollbar_state.scroll_pixels %= font_size;
111111
if lines != 0.0 {
112112
Some(InputAction::BackendCall(BackendCommand::Scroll(
113113
-lines as i32,

crates/egui-term/src/view.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use egui::{Response, Vec2};
2020
#[derive(Clone, Default)]
2121
pub struct TerminalViewState {
2222
pub is_dragged: bool,
23-
pub scroll_pixels: f32,
2423
// for terminal
2524
pub mouse_point: Point,
2625
pub mouse_position: Option<Pos2>,

nxshell/src/app.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ impl NxShell {
9191
state_manager,
9292
})
9393
}
94+
9495
pub fn start(options: NativeOptions) -> eframe::Result<()> {
9596
eframe::run_native(
9697
"NxShell",

0 commit comments

Comments
 (0)