Add a global ToggleDictation keybinding
This commit is contained in:
@@ -2,11 +2,13 @@ use std::collections::BTreeMap;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Result;
|
||||
use chat_ui::ToggleDictation;
|
||||
use gpui::prelude::FluentBuilder;
|
||||
use gpui::{
|
||||
Action, AnyElement, App, AppContext, Context, Entity, EventEmitter, FocusHandle, Focusable,
|
||||
FollowMode, IntoElement, ListAlignment, ListScrollEvent, ListState, ParentElement, Render,
|
||||
SharedString, Styled, Subscription, Task, WeakEntity, Window, div, list, px,
|
||||
FollowMode, InteractiveElement, IntoElement, ListAlignment, ListScrollEvent, ListState,
|
||||
ParentElement, Render, SharedString, Styled, Subscription, Task, WeakEntity, Window, div, list,
|
||||
px,
|
||||
};
|
||||
use gpui_kit::assets::IconName;
|
||||
use gpui_kit::base::StyledExt as _;
|
||||
@@ -1063,6 +1065,17 @@ impl GroupPanel {
|
||||
)
|
||||
}
|
||||
|
||||
fn toggle_dictation(
|
||||
&mut self,
|
||||
_ev: &ToggleDictation,
|
||||
_window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
self.speech.update(cx, |speech, cx| {
|
||||
speech.toggle(cx);
|
||||
});
|
||||
}
|
||||
|
||||
fn render_composer(&self, cx: &mut Context<Self>) -> AnyElement {
|
||||
let notice = self.group.upgrade().and_then(|group| {
|
||||
let group = group.read(cx);
|
||||
@@ -1341,6 +1354,7 @@ impl Render for GroupPanel {
|
||||
v_flex()
|
||||
.size_full()
|
||||
.min_w_0()
|
||||
.on_action(cx.listener(Self::toggle_dictation))
|
||||
.child(self.render_encryption_notice(cx))
|
||||
.child(self.render_banner(cx))
|
||||
.child(self.render_pins(cx))
|
||||
|
||||
Reference in New Issue
Block a user