Detailed changes
@@ -54,6 +54,7 @@ impl ThemeColors {
element_disabled: neutral().light_alpha().step_3(),
element_selection_background: blue().light().step_3().alpha(0.25),
drop_target_background: blue().light_alpha().step_2(),
+ drop_target_border: neutral().light().step_12(),
ghost_element_background: system.transparent,
ghost_element_hover: neutral().light_alpha().step_3(),
ghost_element_active: neutral().light_alpha().step_4(),
@@ -179,6 +180,7 @@ impl ThemeColors {
element_disabled: neutral().dark_alpha().step_3(),
element_selection_background: blue().dark().step_3().alpha(0.25),
drop_target_background: blue().dark_alpha().step_2(),
+ drop_target_border: neutral().dark().step_12(),
ghost_element_background: system.transparent,
ghost_element_hover: neutral().dark_alpha().step_4(),
ghost_element_active: neutral().dark_alpha().step_5(),
@@ -115,6 +115,7 @@ pub(crate) fn zed_default_dark() -> Theme {
element_disabled: SystemColors::default().transparent,
element_selection_background: player.local().selection.alpha(0.25),
drop_target_background: hsla(220.0 / 360., 8.3 / 100., 21.4 / 100., 1.0),
+ drop_target_border: hsla(221. / 360., 11. / 100., 86. / 100., 1.0),
ghost_element_background: SystemColors::default().transparent,
ghost_element_hover: hover,
ghost_element_active: hsla(220.0 / 360., 11.8 / 100., 20.0 / 100., 1.0),
@@ -225,6 +225,10 @@ pub struct ThemeColorsContent {
#[serde(rename = "drop_target.background")]
pub drop_target_background: Option<String>,
+ /// Border Color. Used for the border that shows where a dragged element will be dropped.
+ #[serde(rename = "drop_target.border")]
+ pub drop_target_border: Option<String>,
+
/// Used for the background of a ghost element that should have the same background as the surface it's on.
///
/// Elements might include: Buttons, Inputs, Checkboxes, Radio Buttons...
@@ -747,6 +751,10 @@ impl ThemeColorsContent {
.drop_target_background
.as_ref()
.and_then(|color| try_parse_color(color).ok()),
+ drop_target_border: self
+ .drop_target_border
+ .as_ref()
+ .and_then(|color| try_parse_color(color).ok()),
ghost_element_background: self
.ghost_element_background
.as_ref()
@@ -59,6 +59,8 @@ pub struct ThemeColors {
pub element_disabled: Hsla,
/// Background Color. Used for the area that shows where a dragged element will be dropped.
pub drop_target_background: Hsla,
+ /// Border Color. Used for the border that shows where a dragged element will be dropped.
+ pub drop_target_border: Hsla,
/// Used for the background of a ghost element that should have the same background as the surface it's on.
///
/// Elements might include: Buttons, Inputs, Checkboxes, Radio Buttons...
@@ -304,6 +306,7 @@ pub enum ThemeColorField {
ElementSelected,
ElementDisabled,
DropTargetBackground,
+ DropTargetBorder,
GhostElementBackground,
GhostElementHover,
GhostElementActive,
@@ -418,6 +421,7 @@ impl ThemeColors {
ThemeColorField::ElementSelected => self.element_selected,
ThemeColorField::ElementDisabled => self.element_disabled,
ThemeColorField::DropTargetBackground => self.drop_target_background,
+ ThemeColorField::DropTargetBorder => self.drop_target_border,
ThemeColorField::GhostElementBackground => self.ghost_element_background,
ThemeColorField::GhostElementHover => self.ghost_element_hover,
ThemeColorField::GhostElementActive => self.ghost_element_active,
@@ -2478,8 +2478,19 @@ impl Pane {
},
|tab, _, _, cx| cx.new(|_| tab.clone()),
)
- .drag_over::<DraggedTab>(|tab, _, _, cx| {
- tab.bg(cx.theme().colors().drop_target_background)
+ .drag_over::<DraggedTab>(move |tab, dragged_tab: &DraggedTab, _, cx| {
+ let mut styled_tab = tab
+ .bg(cx.theme().colors().drop_target_background)
+ .border_color(cx.theme().colors().drop_target_border)
+ .border_0();
+
+ if ix < dragged_tab.ix {
+ styled_tab = styled_tab.border_l_2();
+ } else if ix > dragged_tab.ix {
+ styled_tab = styled_tab.border_r_2();
+ }
+
+ styled_tab
})
.drag_over::<DraggedSelection>(|tab, _, _, cx| {
tab.bg(cx.theme().colors().drop_target_background)