Improve Table head to not show selected bg and remove drag border color. (#134)
https://github.com/user-attachments/assets/0836014d-9240-4e77-9daf-dd1ef8d81cd5
This commit is contained in:
parent
b301c5b8fe
commit
7d309acd2f
1 changed files with 2 additions and 10 deletions
|
|
@ -359,18 +359,14 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_resize_handle(&self, ix: usize, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
fn render_resize_handle(&self, ix: usize, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||||
const HANDLE_SIZE: Pixels = px(3.);
|
const HANDLE_SIZE: Pixels = px(2.);
|
||||||
|
|
||||||
if !self.delegate.can_resize_col(ix) {
|
if !self.delegate.can_resize_col(ix) {
|
||||||
return div().into_any_element();
|
return div().into_any_element();
|
||||||
}
|
}
|
||||||
|
|
||||||
let group_id: SharedString = format!("resizable-handle-{}", ix).into();
|
|
||||||
let is_resizing = self.resizing_col == Some(ix);
|
|
||||||
|
|
||||||
h_flex()
|
h_flex()
|
||||||
.id(("resizable-handle", ix))
|
.id(("resizable-handle", ix))
|
||||||
.group(group_id.clone())
|
|
||||||
.occlude()
|
.occlude()
|
||||||
.cursor_col_resize()
|
.cursor_col_resize()
|
||||||
.h_full()
|
.h_full()
|
||||||
|
|
@ -384,12 +380,8 @@ where
|
||||||
.h_5()
|
.h_5()
|
||||||
.justify_center()
|
.justify_center()
|
||||||
.bg(cx.theme().border)
|
.bg(cx.theme().border)
|
||||||
.when(is_resizing, |this| this.bg(cx.theme().drag_border))
|
|
||||||
.group_hover(group_id, |this| this.bg(cx.theme().drag_border))
|
|
||||||
.w(px(1.)),
|
.w(px(1.)),
|
||||||
)
|
)
|
||||||
.hover(|this| this.bg(cx.theme().drag_border))
|
|
||||||
.when(is_resizing, |this| this.bg(cx.theme().drag_border))
|
|
||||||
.on_drag_move(cx.listener(move |view, e: &DragMoveEvent<ResizeCol>, cx| {
|
.on_drag_move(cx.listener(move |view, e: &DragMoveEvent<ResizeCol>, cx| {
|
||||||
match e.drag(cx) {
|
match e.drag(cx) {
|
||||||
ResizeCol((entity_id, ix)) => {
|
ResizeCol((entity_id, ix)) => {
|
||||||
|
|
@ -562,7 +554,7 @@ where
|
||||||
let col_group = self.col_groups.get(col_ix).expect("BUG: invalid col index");
|
let col_group = self.col_groups.get(col_ix).expect("BUG: invalid col index");
|
||||||
|
|
||||||
let name = self.delegate.col_name(col_ix);
|
let name = self.delegate.col_name(col_ix);
|
||||||
self.col_wrap(col_ix, cx)
|
h_flex()
|
||||||
.child(
|
.child(
|
||||||
self.render_cell(col_ix, cx)
|
self.render_cell(col_ix, cx)
|
||||||
.id(("col-header", col_ix))
|
.id(("col-header", col_ix))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue