mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 02:20:10 +00:00
Pull git indicator colors out of theme
Co-Authored-By: Kay Simmons <kay@zed.dev> Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
parent
632f47930f
commit
8d2de1074b
5 changed files with 23 additions and 5 deletions
|
@ -545,10 +545,19 @@ impl EditorElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let (inserted_color, modified_color, deleted_color) = {
|
||||||
|
let editor = &cx.global::<Settings>().theme.editor;
|
||||||
|
(
|
||||||
|
editor.diff_background_inserted,
|
||||||
|
editor.diff_background_modified,
|
||||||
|
editor.diff_background_deleted,
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
for hunk in &layout.diff_hunks {
|
for hunk in &layout.diff_hunks {
|
||||||
let color = match hunk.status() {
|
let color = match hunk.status() {
|
||||||
DiffHunkStatus::Added => Color::green(),
|
DiffHunkStatus::Added => inserted_color,
|
||||||
DiffHunkStatus::Modified => Color::blue(),
|
DiffHunkStatus::Modified => modified_color,
|
||||||
|
|
||||||
//TODO: This rendering is entirely a horrible hack
|
//TODO: This rendering is entirely a horrible hack
|
||||||
DiffHunkStatus::Removed => {
|
DiffHunkStatus::Removed => {
|
||||||
|
@ -565,7 +574,7 @@ impl EditorElement {
|
||||||
|
|
||||||
cx.scene.push_quad(Quad {
|
cx.scene.push_quad(Quad {
|
||||||
bounds: highlight_bounds,
|
bounds: highlight_bounds,
|
||||||
background: Some(Color::red()),
|
background: Some(deleted_color),
|
||||||
border: Border::new(0., Color::transparent_black()),
|
border: Border::new(0., Color::transparent_black()),
|
||||||
corner_radius: 1. * line_height,
|
corner_radius: 1. * line_height,
|
||||||
});
|
});
|
||||||
|
|
|
@ -490,6 +490,7 @@ pub struct Editor {
|
||||||
pub document_highlight_write_background: Color,
|
pub document_highlight_write_background: Color,
|
||||||
pub diff_background_deleted: Color,
|
pub diff_background_deleted: Color,
|
||||||
pub diff_background_inserted: Color,
|
pub diff_background_inserted: Color,
|
||||||
|
pub diff_background_modified: Color,
|
||||||
pub line_number: Color,
|
pub line_number: Color,
|
||||||
pub line_number_active: Color,
|
pub line_number_active: Color,
|
||||||
pub guest_selections: Vec<SelectionStyle>,
|
pub guest_selections: Vec<SelectionStyle>,
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
player,
|
player,
|
||||||
popoverShadow,
|
popoverShadow,
|
||||||
text,
|
text,
|
||||||
|
textColor,
|
||||||
TextColor,
|
TextColor,
|
||||||
} from "./components";
|
} from "./components";
|
||||||
import hoverPopover from "./hoverPopover";
|
import hoverPopover from "./hoverPopover";
|
||||||
|
@ -59,8 +60,9 @@ export default function editor(theme: Theme) {
|
||||||
indicator: iconColor(theme, "secondary"),
|
indicator: iconColor(theme, "secondary"),
|
||||||
verticalScale: 0.618
|
verticalScale: 0.618
|
||||||
},
|
},
|
||||||
diffBackgroundDeleted: backgroundColor(theme, "error"),
|
diffBackgroundDeleted: theme.ramps.red(0.3).hex(),
|
||||||
diffBackgroundInserted: backgroundColor(theme, "ok"),
|
diffBackgroundInserted: theme.ramps.green(0.3).hex(),
|
||||||
|
diffBackgroundModified: theme.ramps.blue(0.3).hex(),
|
||||||
documentHighlightReadBackground: theme.editor.highlight.occurrence,
|
documentHighlightReadBackground: theme.editor.highlight.occurrence,
|
||||||
documentHighlightWriteBackground: theme.editor.highlight.activeOccurrence,
|
documentHighlightWriteBackground: theme.editor.highlight.activeOccurrence,
|
||||||
errorColor: theme.textColor.error,
|
errorColor: theme.textColor.error,
|
||||||
|
|
|
@ -113,6 +113,11 @@ export function createTheme(
|
||||||
hovered: sample(ramps.blue, 0.1),
|
hovered: sample(ramps.blue, 0.1),
|
||||||
active: sample(ramps.blue, 0.15),
|
active: sample(ramps.blue, 0.15),
|
||||||
},
|
},
|
||||||
|
on500Ok: {
|
||||||
|
base: sample(ramps.green, 0.05),
|
||||||
|
hovered: sample(ramps.green, 0.1),
|
||||||
|
active: sample(ramps.green, 0.15)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const borderColor = {
|
const borderColor = {
|
||||||
|
|
|
@ -78,6 +78,7 @@ export default interface Theme {
|
||||||
// Hacks for elements on top of the editor
|
// Hacks for elements on top of the editor
|
||||||
on500: BackgroundColorSet;
|
on500: BackgroundColorSet;
|
||||||
ok: BackgroundColorSet;
|
ok: BackgroundColorSet;
|
||||||
|
on500Ok: BackgroundColorSet;
|
||||||
error: BackgroundColorSet;
|
error: BackgroundColorSet;
|
||||||
on500Error: BackgroundColorSet;
|
on500Error: BackgroundColorSet;
|
||||||
warning: BackgroundColorSet;
|
warning: BackgroundColorSet;
|
||||||
|
|
Loading…
Reference in a new issue