Allow modals to override their dismissal (#3565)

Release Notes:

- N/A
This commit is contained in:
Joseph T. Lyons 2023-12-08 16:28:16 -05:00 committed by GitHub
commit 1fecd3c327
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 115 additions and 58 deletions

View file

@ -13,6 +13,7 @@ use picker::{Picker, PickerDelegate};
use std::sync::Arc;
use ui::prelude::*;
use util::TryFutureExt;
use workspace::ModalView;
actions!(
SelectNextControl,
@ -140,6 +141,7 @@ impl ChannelModal {
}
impl EventEmitter<DismissEvent> for ChannelModal {}
impl ModalView for ChannelModal {}
impl FocusableView for ChannelModal {
fn focus_handle(&self, cx: &AppContext) -> gpui::FocusHandle {

View file

@ -9,6 +9,7 @@ use std::sync::Arc;
use theme::ActiveTheme as _;
use ui::prelude::*;
use util::{ResultExt as _, TryFutureExt};
use workspace::ModalView;
pub fn init(cx: &mut AppContext) {
//Picker::<ContactFinderDelegate>::init(cx);
@ -95,6 +96,7 @@ pub struct ContactFinderDelegate {
}
impl EventEmitter<DismissEvent> for ContactFinder {}
impl ModalView for ContactFinder {}
impl FocusableView for ContactFinder {
fn focus_handle(&self, cx: &AppContext) -> FocusHandle {