GPUI custom window prompts (#8980)
This adds a GPUI fallback for window prompts. Linux does not support this feature by default, so we have to implement it ourselves. This implementation also makes it possible for GPUI clients to override the platform prompts with their own implementations. This is just a first pass. These alerts are not keyboard accessible yet, does not reflect the prompt level, they're implemented in-window, rather than as popups, and the whole feature need a pass from a designer. Regardless, this gets us one step closer to Linux support :) <img width="650" alt="Screenshot 2024-03-06 at 5 58 08 PM" src="https://github.com/zed-industries/zed/assets/2280405/972ebb55-fd1f-4066-969c-a87f63b22a6f"> Release Notes: - N/A
This commit is contained in:
@@ -310,15 +310,14 @@ impl PlatformWindow for WaylandWindow {
|
||||
self.0.inner.borrow_mut().input_handler.take()
|
||||
}
|
||||
|
||||
// todo(linux)
|
||||
fn prompt(
|
||||
&self,
|
||||
level: PromptLevel,
|
||||
msg: &str,
|
||||
detail: Option<&str>,
|
||||
answers: &[&str],
|
||||
) -> Receiver<usize> {
|
||||
unimplemented!()
|
||||
) -> Option<Receiver<usize>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn activate(&self) {
|
||||
|
||||
@@ -399,15 +399,14 @@ impl PlatformWindow for X11Window {
|
||||
self.0.inner.borrow_mut().input_handler.take()
|
||||
}
|
||||
|
||||
// todo(linux)
|
||||
fn prompt(
|
||||
&self,
|
||||
_level: PromptLevel,
|
||||
_msg: &str,
|
||||
_detail: Option<&str>,
|
||||
_answers: &[&str],
|
||||
) -> futures::channel::oneshot::Receiver<usize> {
|
||||
unimplemented!()
|
||||
) -> Option<futures::channel::oneshot::Receiver<usize>> {
|
||||
None
|
||||
}
|
||||
|
||||
fn activate(&self) {
|
||||
|
||||
Reference in New Issue
Block a user