Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions crates/one_ui/src/edit_table/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use gpui_component::{
};

const SCROLLBAR_WIDTH: Pixels = px(16.);
const COLUMN_SEPARATOR_WIDTH: Pixels = px(1.);
Comment on lines 25 to +26

gpui::actions!(
edit_table_internal,
Expand Down Expand Up @@ -1938,14 +1939,27 @@ where

let is_single_select_active =
(is_active_cell || is_select_cell) && !is_editing && !is_multi_selection;
let show_column_separator = !is_editing && !border_right && !is_single_select_active;

let mut cell = div()
.id(cell_id)
.w(col_width)
.h_full()
.relative()
.flex_shrink_0()
.overflow_hidden()
.whitespace_nowrap()
.when(show_column_separator, |this| {
this.child(
div()
.absolute()
.top_0()
.right_0()
.bottom_0()
.w(COLUMN_SEPARATOR_WIDTH)
.bg(cx.theme().border),
)
})
// 选区内的所有单元格使用背景色
.when(is_in_selection && !is_editing, |this| {
this.bg(cx.theme().table_active)
Expand Down