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/darwin/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/darwin/mod.rs')
-rw-r--r-- | font/src/darwin/mod.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs index a6deba3b..56685dd5 100644 --- a/font/src/darwin/mod.rs +++ b/font/src/darwin/mod.rs @@ -470,8 +470,8 @@ impl Font { let width = self.glyph_advance('0') as i32; // Return the new custom glyph return 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 metrics = self.metrics(); let height = metrics.line_height; @@ -483,9 +483,13 @@ impl Font { // Get the width of the cell let width = self.glyph_advance('0') as i32; // Return the new custom glyph - return super::get_beam_cursor_glyph(ascent as i32, height as i32, width); - }, - _ => (), + if character == super::BEAM_CURSOR_CHAR { + return super::get_beam_cursor_glyph(ascent as i32, height as i32, width); + } else { + return super::get_box_cursor_glyph(ascent as i32, height as i32, width); + } + } + _ => () } let glyph_index = self.glyph_index(character) |