-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement bell #2469
base: main
Are you sure you want to change the base?
feat: Implement bell #2469
Conversation
Another option for the bell is to use a configurable external command like Alacritty: That's probably the only easy way on X11/Wayland. On Windows and macOS it could still default to built-ins like you do here, but allow a command for more customization. |
I've added |
eb4a0bc
to
3b09d35
Compare
Sorry for not coming back to you earlier. Supporting vectors is indeed not supported by our settings system right now. But I think a single command is good enough. You can always call a shell script if you want a more complex command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs rebasing on the latest master
} | ||
RedrawEvent::VisualBell => { | ||
tracy_zone!("EditorVisualBell"); | ||
// TODO: Implement visual bell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need help implementing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I am not familiar with skia...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can add draw_rect
(https://rust-skia.github.io/doc/skia_safe/canvas/struct.Canvas.html#method.draw_rect) to renderer::draw_frame
after everything else is rendered. Either black or white, with some alpha that animates in and out. Compare against the default background color, and select using this condition
Lines 595 to 597 in 4096e4c
fn is_light_color(color: &Color4f) -> bool { | |
0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b > 0.5 | |
} |
The updating of the alpha value could be done in renderer::animate_frame
#[cfg(target_os = "windows")] | ||
MessageBeep(MB_OK); | ||
} | ||
#[cfg(not(any(target_os = "macos", target_os = "windows")))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be enabled on all platforms. And used instead of the platform bells if defined.
What kind of change does this PR introduce?
Implement bell sound on macOS and Windows. For users of other OS,
g:neovide_bell_command
can be used.Close #1967
TODO
neovide.bell
rpc method for user?Did this PR introduce a breaking change?
A breaking change includes anything that breaks backwards compatibility either at compile or run time.