Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was still learning Rust. But now it's just &mut AppContext vs &AppContext.
This commit is contained in:
@@ -2,7 +2,7 @@ use fuzzy::{match_strings, StringMatch, StringMatchCandidate};
|
||||
use gpui::{
|
||||
actions,
|
||||
elements::{ChildView, Element as _, Label},
|
||||
AnyViewHandle, Entity, MutableAppContext, View, ViewContext, ViewHandle,
|
||||
AnyViewHandle, Entity, AppContext, View, ViewContext, ViewHandle,
|
||||
};
|
||||
use picker::{Picker, PickerDelegate};
|
||||
use settings::{settings_file::SettingsFile, BaseKeymap, Settings};
|
||||
@@ -16,7 +16,7 @@ pub struct BaseKeymapSelector {
|
||||
|
||||
actions!(welcome, [ToggleBaseKeymapSelector]);
|
||||
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
Picker::<BaseKeymapSelector>::init(cx);
|
||||
cx.add_action({
|
||||
move |workspace, _: &ToggleBaseKeymapSelector, cx| BaseKeymapSelector::toggle(workspace, cx)
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::sync::Arc;
|
||||
use db::kvp::KEY_VALUE_STORE;
|
||||
use gpui::{
|
||||
elements::{Flex, Label, ParentElement},
|
||||
Element, ElementBox, Entity, MutableAppContext, Subscription, View, ViewContext,
|
||||
Element, ElementBox, Entity, AppContext, Subscription, View, ViewContext,
|
||||
};
|
||||
use settings::{settings_file::SettingsFile, Settings};
|
||||
|
||||
@@ -18,7 +18,7 @@ use crate::base_keymap_picker::ToggleBaseKeymapSelector;
|
||||
|
||||
pub const FIRST_OPEN: &str = "first_open";
|
||||
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
cx.add_action(|workspace: &mut Workspace, _: &Welcome, cx| {
|
||||
let welcome_page = cx.add_view(WelcomePage::new);
|
||||
workspace.add_item(Box::new(welcome_page), cx)
|
||||
@@ -27,7 +27,7 @@ pub fn init(cx: &mut MutableAppContext) {
|
||||
base_keymap_picker::init(cx);
|
||||
}
|
||||
|
||||
pub fn show_welcome_experience(app_state: &Arc<AppState>, cx: &mut MutableAppContext) {
|
||||
pub fn show_welcome_experience(app_state: &Arc<AppState>, cx: &mut AppContext) {
|
||||
open_new(&app_state, cx, |workspace, cx| {
|
||||
workspace.toggle_sidebar(SidebarSide::Left, cx);
|
||||
let welcome_page = cx.add_view(|cx| WelcomePage::new(cx));
|
||||
|
||||
Reference in New Issue
Block a user