Actions‽ (#3349)
This PR re-implements our actions with macros instead of a blanket impl. Release Notes: - N/A
This commit is contained in:
commit
61bd6bab09
26 changed files with 420 additions and 263 deletions
|
@ -84,7 +84,8 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::story::Story;
|
||||
use gpui::{action, Div, Render};
|
||||
use gpui::{Div, Render};
|
||||
use serde::Deserialize;
|
||||
|
||||
pub struct ContextMenuStory;
|
||||
|
||||
|
@ -92,7 +93,7 @@ mod stories {
|
|||
type Element = Div<Self>;
|
||||
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
|
||||
#[action]
|
||||
#[derive(PartialEq, Clone, Deserialize, gpui::Action)]
|
||||
struct PrintCurrentDate {}
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -81,13 +81,12 @@ pub use stories::*;
|
|||
mod stories {
|
||||
use super::*;
|
||||
use crate::Story;
|
||||
use gpui::{action, Div, Render};
|
||||
use gpui::{actions, Div, Render};
|
||||
use itertools::Itertools;
|
||||
|
||||
pub struct KeybindingStory;
|
||||
|
||||
#[action]
|
||||
struct NoAction {}
|
||||
actions!(NoAction);
|
||||
|
||||
pub fn binding(key: &str) -> gpui::KeyBinding {
|
||||
gpui::KeyBinding::new(key, NoAction {}, None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue