update secondary selection head color
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ impl App {
|
|||||||
|
|
||||||
fn tab_for(buffer: &Buffer, is_active: bool) -> Span<'static> {
|
fn tab_for(buffer: &Buffer, is_active: bool) -> Span<'static> {
|
||||||
let background = if is_active {
|
let background = if is_active {
|
||||||
Color::select_grey()
|
Color::selection_tail_grey()
|
||||||
} else {
|
} else {
|
||||||
Color::ui_grey()
|
Color::ui_grey()
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -260,15 +260,15 @@ use ratatui::{style::{Color, Style, Stylize}, text::Span};
|
|||||||
|
|
||||||
match place_in_cursor {
|
match place_in_cursor {
|
||||||
InCursor::Head => span.bg(head_color),
|
InCursor::Head => span.bg(head_color),
|
||||||
InCursor::Rest => span.bg(Color::select_grey()),
|
InCursor::Rest => span.bg(Color::selection_tail_grey()),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
match self.cursors
|
match self.cursors
|
||||||
.iter()
|
.iter()
|
||||||
.find_map(|cursor| cursor.contains(address))
|
.find_map(|cursor| cursor.contains(address))
|
||||||
{
|
{
|
||||||
Some(InCursor::Head) => span.on_gray(),
|
Some(InCursor::Head) => span.bg(Color::secondary_selection_head_grey()),
|
||||||
Some(InCursor::Rest) => span.bg(Color::select_grey()),
|
Some(InCursor::Rest) => span.bg(Color::selection_tail_grey()),
|
||||||
None => span,
|
None => span,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -286,7 +286,7 @@ use ratatui::{style::{Color, Style, Stylize}, text::Span};
|
|||||||
.chain(&self.cursors)
|
.chain(&self.cursors)
|
||||||
.any(|cursor| cursor.contains_space_before(address))
|
.any(|cursor| cursor.contains_space_before(address))
|
||||||
{
|
{
|
||||||
span.bg(Color::select_grey())
|
span.bg(Color::selection_tail_grey())
|
||||||
} else {
|
} else {
|
||||||
span
|
span
|
||||||
}
|
}
|
||||||
@@ -303,7 +303,7 @@ use ratatui::{style::{Color, Style, Stylize}, text::Span};
|
|||||||
.chain(&self.cursors)
|
.chain(&self.cursors)
|
||||||
.any(|cursor| cursor.contains_space_before(address))
|
.any(|cursor| cursor.contains_space_before(address))
|
||||||
{
|
{
|
||||||
span.bg(Color::select_grey())
|
span.bg(Color::selection_tail_grey())
|
||||||
} else {
|
} else {
|
||||||
span
|
span
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ mod character_panel {
|
|||||||
.chain(&self.cursors)
|
.chain(&self.cursors)
|
||||||
.find_map(|cursor| cursor.contains(address))
|
.find_map(|cursor| cursor.contains(address))
|
||||||
{
|
{
|
||||||
Some(InCursor::Head) => span.bg(Color::select_grey()),
|
Some(InCursor::Head) => span.bg(Color::selection_tail_grey()),
|
||||||
Some(InCursor::Rest) => span.on_dark_gray(),
|
Some(InCursor::Rest) => span.on_dark_gray(),
|
||||||
None => span,
|
None => span,
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-2
@@ -1,15 +1,20 @@
|
|||||||
use ratatui::style::Color;
|
use ratatui::style::Color;
|
||||||
|
|
||||||
pub trait CustomGreys {
|
pub trait CustomGreys {
|
||||||
fn select_grey() -> Self;
|
fn selection_tail_grey() -> Self;
|
||||||
|
fn secondary_selection_head_grey() -> Self;
|
||||||
fn ui_grey() -> Self;
|
fn ui_grey() -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CustomGreys for Color {
|
impl CustomGreys for Color {
|
||||||
fn select_grey() -> Self {
|
fn selection_tail_grey() -> Self {
|
||||||
Self::Indexed(242)
|
Self::Indexed(242)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn secondary_selection_head_grey() -> Self {
|
||||||
|
Self::Indexed(246)
|
||||||
|
}
|
||||||
|
|
||||||
fn ui_grey() -> Self {
|
fn ui_grey() -> Self {
|
||||||
Self::Indexed(238)
|
Self::Indexed(238)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user