-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[[PR Description]] - Add pane empty state - Ensure tab bar doesn't resize when a tab is added - Make ButtonLike respect the style of a disabled button - Add additional cursors to gpui2 Release Notes: - N/A
- Loading branch information
Showing
9 changed files
with
317 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
use gpui::{Div, Render, Stateful}; | ||
use story::Story; | ||
use ui::prelude::*; | ||
|
||
pub struct CursorStory; | ||
|
||
impl Render for CursorStory { | ||
type Element = Div; | ||
|
||
fn render(&mut self, _cx: &mut ViewContext<Self>) -> Self::Element { | ||
let all_cursors: [(&str, Box<dyn Fn(Stateful<Div>) -> Stateful<Div>>); 19] = [ | ||
( | ||
"cursor_default", | ||
Box::new(|el: Stateful<Div>| el.cursor_default()), | ||
), | ||
( | ||
"cursor_pointer", | ||
Box::new(|el: Stateful<Div>| el.cursor_pointer()), | ||
), | ||
( | ||
"cursor_text", | ||
Box::new(|el: Stateful<Div>| el.cursor_text()), | ||
), | ||
( | ||
"cursor_move", | ||
Box::new(|el: Stateful<Div>| el.cursor_move()), | ||
), | ||
( | ||
"cursor_not_allowed", | ||
Box::new(|el: Stateful<Div>| el.cursor_not_allowed()), | ||
), | ||
( | ||
"cursor_context_menu", | ||
Box::new(|el: Stateful<Div>| el.cursor_context_menu()), | ||
), | ||
( | ||
"cursor_crosshair", | ||
Box::new(|el: Stateful<Div>| el.cursor_crosshair()), | ||
), | ||
( | ||
"cursor_vertical_text", | ||
Box::new(|el: Stateful<Div>| el.cursor_vertical_text()), | ||
), | ||
( | ||
"cursor_alias", | ||
Box::new(|el: Stateful<Div>| el.cursor_alias()), | ||
), | ||
( | ||
"cursor_copy", | ||
Box::new(|el: Stateful<Div>| el.cursor_copy()), | ||
), | ||
( | ||
"cursor_no_drop", | ||
Box::new(|el: Stateful<Div>| el.cursor_no_drop()), | ||
), | ||
( | ||
"cursor_grab", | ||
Box::new(|el: Stateful<Div>| el.cursor_grab()), | ||
), | ||
( | ||
"cursor_grabbing", | ||
Box::new(|el: Stateful<Div>| el.cursor_grabbing()), | ||
), | ||
( | ||
"cursor_col_resize", | ||
Box::new(|el: Stateful<Div>| el.cursor_col_resize()), | ||
), | ||
( | ||
"cursor_row_resize", | ||
Box::new(|el: Stateful<Div>| el.cursor_row_resize()), | ||
), | ||
( | ||
"cursor_n_resize", | ||
Box::new(|el: Stateful<Div>| el.cursor_n_resize()), | ||
), | ||
( | ||
"cursor_e_resize", | ||
Box::new(|el: Stateful<Div>| el.cursor_e_resize()), | ||
), | ||
( | ||
"cursor_s_resize", | ||
Box::new(|el: Stateful<Div>| el.cursor_s_resize()), | ||
), | ||
( | ||
"cursor_w_resize", | ||
Box::new(|el: Stateful<Div>| el.cursor_w_resize()), | ||
), | ||
]; | ||
|
||
Story::container() | ||
.flex() | ||
.gap_1() | ||
.child(Story::title("cursor")) | ||
.children(all_cursors.map(|(name, apply_cursor)| { | ||
div().gap_1().flex().text_color(gpui::white()).child( | ||
div() | ||
.flex() | ||
.items_center() | ||
.justify_center() | ||
.id(name) | ||
.map(apply_cursor) | ||
.w_64() | ||
.h_8() | ||
.bg(gpui::red()) | ||
.hover(|style| style.bg(gpui::blue())) | ||
.active(|style| style.bg(gpui::green())) | ||
.text_sm() | ||
.child(Story::label(name)), | ||
) | ||
})) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.