1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 03:09:06 +03:00

cursor_fg, cursor_bg, cursor_border now accept alpha values

refs: https://github.com/wez/wezterm/issues/1835
This commit is contained in:
Wez Furlong 2022-04-07 21:55:28 -07:00
parent d8cfdae27b
commit d356b72ca9
4 changed files with 11 additions and 10 deletions

View File

@ -27,6 +27,7 @@ As features stabilize some brief notes about them will accumulate here.
* Wayland: touchpad scroll is now more responsive/precise. Thanks to [@davidrios](https://github.com/davidrios)! [#1800](https://github.com/wez/wezterm/pull/1800)
* Kitty image protocol: now also supports shared memory data transmission. Thanks to [@tantei3](https://github.com/tantei3)! [#1810](https://github.com/wez/wezterm/pull/1810)
* Secondary DA response bumped up to persuade vim to set `ttymouse=sgr` by default. [#1825](https://github.com/wez/wezterm/issues/1825)
* `cursor_bg`, `cursor_fg` and `cursor_border` may now specify alpha values. [#1835](https://github.com/wez/wezterm/issues/1835)
#### Fixed
* Incorrect csi-u encoding with non-ascii characters. [#1746](https://github.com/wez/wezterm/issues/1746)

View File

@ -49,9 +49,9 @@ pub struct ColorPalette {
pub colors: Palette256,
pub foreground: RgbColor,
pub background: RgbColor,
pub cursor_fg: RgbColor,
pub cursor_bg: RgbColor,
pub cursor_border: RgbColor,
pub cursor_fg: SrgbaTuple,
pub cursor_bg: SrgbaTuple,
pub cursor_border: SrgbaTuple,
pub selection_fg: SrgbaTuple,
pub selection_bg: SrgbaTuple,
pub scrollbar_thumb: RgbColor,
@ -167,9 +167,9 @@ impl ColorPalette {
let foreground = colors[249]; // Grey70
let background = colors[AnsiColor::Black as usize];
let cursor_bg = RgbColor::new_8bpc(0x52, 0xad, 0x70);
let cursor_border = RgbColor::new_8bpc(0x52, 0xad, 0x70);
let cursor_fg = colors[AnsiColor::Black as usize];
let cursor_bg = RgbColor::new_8bpc(0x52, 0xad, 0x70).into();
let cursor_border = RgbColor::new_8bpc(0x52, 0xad, 0x70).into();
let cursor_fg = colors[AnsiColor::Black as usize].into();
let selection_fg = SrgbaTuple(0., 0., 0., 0.);
let selection_bg = SrgbaTuple(0.5, 0.4, 0.6, 0.5);

View File

@ -818,7 +818,7 @@ impl<'a> Performer<'a> {
// We set the border to the background color; we don't
// have an escape that sets that independently, and this
// way just looks better.
self.palette_mut().cursor_border = c;
self.palette_mut().cursor_border = c.into();
}
set_or_query!(cursor_bg)
}

View File

@ -1075,7 +1075,7 @@ impl super::TermWindow {
log::trace!("quad map elapsed {:?}", start.elapsed());
metrics::histogram!("quad.map", start.elapsed());
let cursor_border_color = rgbcolor_to_window_color(palette.cursor_border);
let cursor_border_color = palette.cursor_border.to_linear();
let foreground = rgbcolor_to_window_color(palette.foreground);
let white_space = gl_state.util_sprites.white_space.texture_coords();
let filled_box = gl_state.util_sprites.filled_box.texture_coords();
@ -1350,8 +1350,8 @@ impl super::TermWindow {
let start = Instant::now();
let selection_fg = palette.selection_fg.to_linear();
let selection_bg = palette.selection_bg.to_linear();
let cursor_fg = rgbcolor_to_window_color(palette.cursor_fg);
let cursor_bg = rgbcolor_to_window_color(palette.cursor_bg);
let cursor_fg = palette.cursor_fg.to_linear();
let cursor_bg = palette.cursor_bg.to_linear();
let cursor_is_default_color =
palette.cursor_fg == global_cursor_fg && palette.cursor_bg == global_cursor_bg;