aboutsummaryrefslogtreecommitdiff
path: root/src/app/input/sidebar.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-05 18:32:14 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-05 18:32:42 +0300
commitf7b0ee2f758440db3a3ff4cc727f879b420255d7 (patch)
tree764149deada51f6196f3eecda46374ec45ff097a /src/app/input/sidebar.rs
parent6885c8873971d79332376137a14572f8440ef42e (diff)
feat: add mobile terminal layout
Diffstat (limited to 'src/app/input/sidebar.rs')
-rw-r--r--src/app/input/sidebar.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/app/input/sidebar.rs b/src/app/input/sidebar.rs
index f3ae2b06..fe8f14c1 100644
--- a/src/app/input/sidebar.rs
+++ b/src/app/input/sidebar.rs
@@ -1,6 +1,6 @@
use ratatui::layout::Rect;
-use crate::app::state::{AppState, Mode};
+use crate::app::state::{AppState, Mode, ViewLayout};
use super::ScrollbarClickTarget;
@@ -170,6 +170,10 @@ impl AppState {
}
pub(crate) fn global_launcher_rect(&self) -> Rect {
+ if self.view.layout == ViewLayout::Mobile {
+ return self.view.mobile_menu_hit_area;
+ }
+
let footer = self.sidebar_footer_rect();
let width = if self.update_available.is_some() {
8
@@ -983,7 +987,7 @@ mod tests {
app.state.workspaces = vec![ws];
app.state.active = Some(0);
app.state.selected = 0;
- crate::ui::compute_view(&mut app.state, Rect::new(0, 0, 52, 20));
+ crate::ui::compute_view(&mut app.state, Rect::new(0, 0, 65, 20));
let right = app.state.view.tab_scroll_right_hit_area;
assert!(right.width > 0);
@@ -1019,7 +1023,7 @@ mod tests {
app.state.selected = 0;
app.state.tab_scroll = usize::MAX;
app.state.tab_scroll_follow_active = false;
- crate::ui::compute_view(&mut app.state, Rect::new(0, 0, 52, 20));
+ crate::ui::compute_view(&mut app.state, Rect::new(0, 0, 65, 20));
let last_idx = app.state.workspaces[0].tabs.len() - 1;
let target = app.state.view.tab_hit_areas[last_idx];