aboutsummaryrefslogtreecommitdiff
path: root/src/ui.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.rs')
-rw-r--r--src/ui.rs57
1 files changed, 25 insertions, 32 deletions
diff --git a/src/ui.rs b/src/ui.rs
index 85574989..c4789ea4 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -17,6 +17,7 @@ mod scrollbar;
mod settings;
mod sidebar;
mod status;
+mod tab_surface;
mod tabs;
mod text;
mod widgets;
@@ -39,9 +40,7 @@ use self::navigator::render_navigator_overlay;
pub(crate) use self::onboarding::onboarding_welcome_continue_rect;
use self::onboarding::render_onboarding_overlay;
pub(crate) use self::panes::popup_pane_rects;
-use self::panes::{
- compute_pane_infos, render_panes, render_popup_pane, resize_popup_pane, resize_tab_panes,
-};
+use self::panes::{render_empty, render_popup_pane, resize_popup_pane};
pub(crate) use self::release_notes::{
product_announcement_display_lines, release_notes_close_button_rect,
release_notes_display_lines, release_notes_wrapped_line_count, PRODUCT_ANNOUNCEMENT_MODAL_SIZE,
@@ -58,6 +57,9 @@ use self::status::{
copy_feedback_rect, render_config_diagnostic, render_copy_feedback, render_toast_notification,
toast_notification_rect,
};
+pub(crate) use self::tab_surface::{
+ compute_tab_surface, render_tab_surface, resize_tab_surface, TabSurfaceLayout,
+};
use self::tabs::render_tab_bar;
pub(crate) use self::{
dialogs::{
@@ -89,6 +91,7 @@ pub(crate) use self::{
mobile_switcher_workspace_doc_range, MobileSwitcherTarget,
},
panes::{apply_pane_chrome, pane_inner_rect, pane_is_scrolled_back},
+ tab_surface::{tab_surface_cursor, tab_surface_hyperlinks, TabSurfaceView},
tabs::compute_tab_bar_view,
widgets::{centered_popup_rect, modal_stack_areas},
};
@@ -168,7 +171,7 @@ fn resize_background_tab_panes_to_area(
if app.active == Some(ws_idx) && tab_idx == ws.active_tab_index() {
continue;
}
- resize_tab_panes(app, terminal_runtimes, tab, terminal_area, cell_size);
+ resize_tab_surface(app, terminal_runtimes, tab, terminal_area, cell_size);
}
}
}
@@ -185,7 +188,7 @@ fn resize_background_tab_panes_for_desktop(
if app.active == Some(ws_idx) && tab_idx == ws.active_tab_index() {
continue;
}
- resize_tab_panes(app, terminal_runtimes, tab, terminal_area, cell_size);
+ resize_tab_surface(app, terminal_runtimes, tab, terminal_area, cell_size);
}
}
}
@@ -269,19 +272,10 @@ fn compute_view_internal(
.unwrap_or_default();
app.tab_scroll = tab_bar_view.scroll;
- let split_borders = app
- .active
- .and_then(|i| app.workspaces.get(i))
- .map(|ws| {
- if ws.zoomed {
- Vec::new()
- } else {
- ws.layout.splits(terminal_area)
- }
- })
- .unwrap_or_default();
-
- let pane_infos = compute_pane_infos(
+ let TabSurfaceLayout {
+ pane_infos,
+ split_borders,
+ } = compute_tab_surface(
app,
terminal_runtimes,
terminal_area,
@@ -347,19 +341,10 @@ fn compute_mobile_view(
app.mobile_switcher_scroll = app.mobile_switcher_scroll.min(max_scroll);
}
- let split_borders = app
- .active
- .and_then(|i| app.workspaces.get(i))
- .map(|ws| {
- if ws.zoomed {
- Vec::new()
- } else {
- ws.layout.splits(terminal_area)
- }
- })
- .unwrap_or_default();
-
- let pane_infos = compute_pane_infos(
+ let TabSurfaceLayout {
+ pane_infos,
+ split_borders,
+ } = compute_tab_surface(
app,
terminal_runtimes,
terminal_area,
@@ -425,7 +410,15 @@ pub fn render_with_runtime_registry(
if app.view.layout != ViewLayout::Mobile {
render_tab_bar(app, frame, tab_bar_area);
}
- render_panes(app, terminal_runtimes, frame, terminal_area);
+ if app
+ .active
+ .and_then(|ws_idx| app.workspaces.get(ws_idx))
+ .is_some()
+ {
+ render_tab_surface(app, terminal_runtimes, app.view.tab_surface(), frame);
+ } else {
+ render_empty(app, frame, terminal_area);
+ }
// Ambient notifications sit above panes, but below interactive overlays.
render_notifications(app, frame, terminal_area);