aboutsummaryrefslogtreecommitdiff
path: root/src/window.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-11-01 17:23:49 +0000
committerGitHub <noreply@github.com>2018-11-01 17:23:49 +0000
commita7d95540384c0b37e75a4bedb0bff688fee7dcf1 (patch)
tree8f019477e5d27efbbff9872d3804c05882142eef /src/window.rs
parentf0579345ea2fbe4c091b9df2f4725c22395a5b72 (diff)
downloadalacritty-a7d95540384c0b37e75a4bedb0bff688fee7dcf1.tar.gz
alacritty-a7d95540384c0b37e75a4bedb0bff688fee7dcf1.zip
Rework cursor configuration
There are a couple of cursor-related options in the Alacritty config file now, however they aren't grouped together in any way. To resolve this a new `cursor` field has been added where all cursor configuration options (besides colors) have been moved. The `custom_cursor_colors` option has also been removed, since it's not necessary anymore. Simply making the `colors.cursor.*` fields optional, allows overriding the cursor colors whenever one of them is present. Like that the user doesn't have to think about a relation between two separate configuration options. This PR initially put the `hide_cursor_when_typing` variable under `cursor.hide_when_typing`. However this field is completely unrelated to the cursor, but instead relates to the mouse cursor. Since the word `cursor` is already used for the active cell in the grid of a terminal emulator, all occurences of the word `cursor` when talking about the mouse have been replaced with the word `mouse`. The configuration option has also been moved to `mouse.hide_when_typing`, to make it clear what this option is changing. This fixes #1080.
Diffstat (limited to 'src/window.rs')
-rw-r--r--src/window.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/window.rs b/src/window.rs
index 2c1bf7b2..cb753d40 100644
--- a/src/window.rs
+++ b/src/window.rs
@@ -70,7 +70,7 @@ type Result<T> = ::std::result::Result<T, Error>;
pub struct Window {
event_loop: EventsLoop,
window: glutin::GlWindow,
- cursor_visible: bool,
+ mouse_visible: bool,
/// Whether or not the window is the focused window.
pub is_focused: bool,
@@ -243,7 +243,7 @@ impl Window {
let window = Window {
event_loop,
window,
- cursor_visible: true,
+ mouse_visible: true,
is_focused: false,
};
@@ -326,16 +326,16 @@ impl Window {
});
}
- /// Set cursor visible
- pub fn set_cursor_visible(&mut self, visible: bool) {
- if visible != self.cursor_visible {
- self.cursor_visible = visible;
+ /// Set mouse cursor visible
+ pub fn set_mouse_visible(&mut self, visible: bool) {
+ if visible != self.mouse_visible {
+ self.mouse_visible = visible;
if let Err(err) = self.window.set_cursor_state(if visible {
CursorState::Normal
} else {
CursorState::Hide
}) {
- warn!("Failed to set cursor visibility: {}", err);
+ warn!("Failed to set mouse cursor visibility: {}", err);
}
}
}