diff --git a/crates/git_graph/src/git_graph.rs b/crates/git_graph/src/git_graph.rs index 78e2bac486385b2a0228c8f98d95415f6ec66946..ec5065e5c2a953341d212df610ea3bced6691d89 100644 --- a/crates/git_graph/src/git_graph.rs +++ b/crates/git_graph/src/git_graph.rs @@ -21,8 +21,8 @@ use std::{ops::Range, rc::Rc, sync::Arc, sync::OnceLock}; use theme::{AccentColors, ThemeSettings}; use time::{OffsetDateTime, UtcOffset, format_description::BorrowedFormatItem}; use ui::{ - CommonAnimationExt as _, ContextMenu, ScrollableHandle, Table, TableInteractionState, Tooltip, - prelude::*, + CommonAnimationExt as _, ContextMenu, ScrollableHandle, Table, TableColumnWidths, + TableInteractionState, TableResizeBehavior, Tooltip, prelude::*, }; use workspace::{ Workspace, @@ -573,6 +573,7 @@ pub struct GitGraph { context_menu: Option<(Entity, Point, Subscription)>, row_height: Pixels, table_interaction_state: Entity, + table_column_widths: Entity, horizontal_scroll_offset: Pixels, graph_viewport_width: Pixels, selected_entry_idx: Option, @@ -633,6 +634,7 @@ impl GitGraph { } let table_interaction_state = cx.new(|cx| TableInteractionState::new(cx)); + let table_column_widths = cx.new(|cx| TableColumnWidths::new(4, cx)); let mut row_height = Self::row_height(cx); cx.observe_global_in::(window, move |this, _window, cx| { @@ -657,6 +659,7 @@ impl GitGraph { context_menu: None, row_height, table_interaction_state, + table_column_widths, horizontal_scroll_offset: px(0.), graph_viewport_width: px(88.), selected_entry_idx: None, @@ -1546,6 +1549,16 @@ impl Render for GitGraph { ] .to_vec(), ) + .resizable_columns( + vec![ + TableResizeBehavior::Resizable, + TableResizeBehavior::Resizable, + TableResizeBehavior::Resizable, + TableResizeBehavior::Resizable, + ], + &self.table_column_widths, + cx, + ) .map_row(move |(index, row), _window, cx| { let is_selected = selected_entry_idx == Some(index); let weak = weak_self.clone();