Fix variable names
This commit is contained in:
parent
7cef4a5d40
commit
317eb7535c
2 changed files with 16 additions and 16 deletions
|
@ -45,8 +45,8 @@ pub fn init(system_specs: SystemSpecs, app_state: Arc<AppState>, cx: &mut Mutabl
|
|||
});
|
||||
|
||||
cx.add_async_action(
|
||||
|toolbar_button: &mut ToolbarButton, _: &SubmitFeedback, cx| {
|
||||
if let Some(active_item) = toolbar_button.active_item.as_ref() {
|
||||
|submit_feedback_button: &mut SubmitFeedbackButton, _: &SubmitFeedback, cx| {
|
||||
if let Some(active_item) = submit_feedback_button.active_item.as_ref() {
|
||||
Some(active_item.update(cx, |feedback_editor, cx| feedback_editor.handle_save(cx)))
|
||||
} else {
|
||||
None
|
||||
|
@ -55,15 +55,15 @@ pub fn init(system_specs: SystemSpecs, app_state: Arc<AppState>, cx: &mut Mutabl
|
|||
);
|
||||
}
|
||||
|
||||
pub struct StatusBarButton;
|
||||
pub struct DeployFeedbackButton;
|
||||
|
||||
impl Entity for StatusBarButton {
|
||||
impl Entity for DeployFeedbackButton {
|
||||
type Event = ();
|
||||
}
|
||||
|
||||
impl View for StatusBarButton {
|
||||
impl View for DeployFeedbackButton {
|
||||
fn ui_name() -> &'static str {
|
||||
"StatusBarButton"
|
||||
"DeployFeedbackButton"
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut RenderContext<'_, Self>) -> ElementBox {
|
||||
|
@ -87,7 +87,7 @@ impl View for StatusBarButton {
|
|||
}
|
||||
}
|
||||
|
||||
impl StatusItemView for StatusBarButton {
|
||||
impl StatusItemView for DeployFeedbackButton {
|
||||
fn set_active_pane_item(&mut self, _: Option<&dyn ItemHandle>, _: &mut ViewContext<Self>) {}
|
||||
}
|
||||
|
||||
|
@ -442,11 +442,11 @@ impl SearchableItem for FeedbackEditor {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct ToolbarButton {
|
||||
pub struct SubmitFeedbackButton {
|
||||
active_item: Option<ViewHandle<FeedbackEditor>>,
|
||||
}
|
||||
|
||||
impl ToolbarButton {
|
||||
impl SubmitFeedbackButton {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
active_item: Default::default(),
|
||||
|
@ -454,13 +454,13 @@ impl ToolbarButton {
|
|||
}
|
||||
}
|
||||
|
||||
impl Entity for ToolbarButton {
|
||||
impl Entity for SubmitFeedbackButton {
|
||||
type Event = ();
|
||||
}
|
||||
|
||||
impl View for ToolbarButton {
|
||||
impl View for SubmitFeedbackButton {
|
||||
fn ui_name() -> &'static str {
|
||||
"ToolbarButton"
|
||||
"SubmitFeedbackButton"
|
||||
}
|
||||
|
||||
fn render(&mut self, cx: &mut RenderContext<Self>) -> ElementBox {
|
||||
|
@ -484,7 +484,7 @@ impl View for ToolbarButton {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToolbarItemView for ToolbarButton {
|
||||
impl ToolbarItemView for SubmitFeedbackButton {
|
||||
fn set_active_pane_item(
|
||||
&mut self,
|
||||
active_pane_item: Option<&dyn ItemHandle>,
|
||||
|
|
|
@ -11,7 +11,7 @@ use collections::VecDeque;
|
|||
pub use editor;
|
||||
use editor::{Editor, MultiBuffer};
|
||||
|
||||
use feedback::feedback_editor::ToolbarButton;
|
||||
use feedback::feedback_editor::SubmitFeedbackButton;
|
||||
use futures::StreamExt;
|
||||
use gpui::{
|
||||
actions,
|
||||
|
@ -288,7 +288,7 @@ pub fn initialize_workspace(
|
|||
toolbar.add_item(buffer_search_bar, cx);
|
||||
let project_search_bar = cx.add_view(|_| ProjectSearchBar::new());
|
||||
toolbar.add_item(project_search_bar, cx);
|
||||
let submit_feedback_button = cx.add_view(|_| ToolbarButton::new());
|
||||
let submit_feedback_button = cx.add_view(|_| SubmitFeedbackButton::new());
|
||||
toolbar.add_item(submit_feedback_button, cx);
|
||||
})
|
||||
});
|
||||
|
@ -347,7 +347,7 @@ pub fn initialize_workspace(
|
|||
let activity_indicator =
|
||||
activity_indicator::ActivityIndicator::new(workspace, app_state.languages.clone(), cx);
|
||||
let cursor_position = cx.add_view(|_| editor::items::CursorPosition::new());
|
||||
let feedback_button = cx.add_view(|_| feedback::feedback_editor::StatusBarButton {});
|
||||
let feedback_button = cx.add_view(|_| feedback::feedback_editor::DeployFeedbackButton {});
|
||||
workspace.status_bar().update(cx, |status_bar, cx| {
|
||||
status_bar.add_left_item(diagnostic_summary, cx);
|
||||
status_bar.add_left_item(activity_indicator, cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue