Add seperate scrollbar styling
This commit is contained in:
parent
2200a22c07
commit
af73c1af06
4 changed files with 21 additions and 2 deletions
|
@ -1052,7 +1052,7 @@ impl EditorElement {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
let diff_style = theme::current(cx).editor.diff.clone();
|
let diff_style = &theme::current(cx).editor.scrollbar.git;
|
||||||
for hunk in layout
|
for hunk in layout
|
||||||
.position_map
|
.position_map
|
||||||
.snapshot
|
.snapshot
|
||||||
|
|
|
@ -682,6 +682,14 @@ pub struct Scrollbar {
|
||||||
pub thumb: ContainerStyle,
|
pub thumb: ContainerStyle,
|
||||||
pub width: f32,
|
pub width: f32,
|
||||||
pub min_height_factor: f32,
|
pub min_height_factor: f32,
|
||||||
|
pub git: GitDiffColors
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Deserialize, Default)]
|
||||||
|
pub struct GitDiffColors {
|
||||||
|
pub inserted: Color,
|
||||||
|
pub modified: Color,
|
||||||
|
pub deleted: Color
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Deserialize, Default)]
|
#[derive(Clone, Deserialize, Default)]
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::borrow::Cow;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
color::Color,
|
color::Color,
|
||||||
elements::{
|
elements::{
|
||||||
ConstrainedBox, Container, ContainerStyle, Empty, Flex, KeystrokeLabel, Label, LabelStyle,
|
ConstrainedBox, Container, ContainerStyle, Empty, Flex, KeystrokeLabel, Label,
|
||||||
MouseEventHandler, ParentElement, Stack, Svg,
|
MouseEventHandler, ParentElement, Stack, Svg,
|
||||||
},
|
},
|
||||||
fonts::TextStyle,
|
fonts::TextStyle,
|
||||||
|
|
|
@ -247,6 +247,17 @@ export default function editor(colorScheme: ColorScheme) {
|
||||||
color: borderColor(layer, "variant"),
|
color: borderColor(layer, "variant"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
git: {
|
||||||
|
deleted: isLight
|
||||||
|
? colorScheme.ramps.red(0.5).hex()
|
||||||
|
: colorScheme.ramps.red(0.4).hex(),
|
||||||
|
modified: isLight
|
||||||
|
? colorScheme.ramps.yellow(0.3).hex()
|
||||||
|
: colorScheme.ramps.yellow(0.5).hex(),
|
||||||
|
inserted: isLight
|
||||||
|
? colorScheme.ramps.green(0.4).hex()
|
||||||
|
: colorScheme.ramps.green(0.5).hex(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
compositionMark: {
|
compositionMark: {
|
||||||
underline: {
|
underline: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue