diff options
author | Christian Duerr <contact@christianduerr.com> | 2017-12-10 00:33:58 +0100 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-12-24 09:46:54 -0800 |
commit | fe29b8c6873c82517a218067abbf56b64cae413b (patch) | |
tree | a2cff4b838448d9e45ed56374db363dbcf724259 /font/src/ft/mod.rs | |
parent | 8195d7103498043270523bd81d703cb678cd11a2 (diff) | |
download | alacritty-fe29b8c6873c82517a218067abbf56b64cae413b.tar.gz alacritty-fe29b8c6873c82517a218067abbf56b64cae413b.zip |
Add custom box cursor for unfocused window
Diffstat (limited to 'font/src/ft/mod.rs')
-rw-r--r-- | font/src/ft/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index 765e8efb..44dc0be3 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -310,7 +310,7 @@ impl FreeTypeRasterizer { // Return the new custom glyph super::get_underline_cursor_glyph(descent, width) } - super::BEAM_CURSOR_CHAR => { + super::BEAM_CURSOR_CHAR | super::BOX_CURSOR_CHAR => { // Get the top of the bounding box let size_metrics = face.ft_face .size_metrics() @@ -326,7 +326,11 @@ impl FreeTypeRasterizer { let width = (metrics.vertAdvance as f32 / 128.).round() as i32; // Return the new custom glyph - super::get_beam_cursor_glyph(ascent, height, width) + if glyph_key.c == super::BEAM_CURSOR_CHAR { + super::get_beam_cursor_glyph(ascent, height, width) + } else { + super::get_box_cursor_glyph(ascent, height, width) + } } _ => { // If it's not a special char, return the normal glyph |