History

Document free functions

Nate Butler committed 2 years ago

Commit c19551d1 parent cb240623 files · +4 −6Browse files

Unified · Split

3 files
  1. crates/ui/src/components/popover_menu.rs +1 −0
  2. crates/ui/src/components/right_click_menu.rs +1 −0
  3. crates/ui/src/components/stack.rs +2 −6
crates/ui/src/components/popover_menu.rs+1−0
@@ -108,6 +108,7 @@ impl<M: ManagedView> PopoverMenu<M> { · 107 unmodified lines
108 }108 }
109}109}
110 110
111/// Creates a [PopoverMenu]
111pub fn popover_menu<M: ManagedView>(id: impl Into<ElementId>) -> PopoverMenu<M> {112pub fn popover_menu<M: ManagedView>(id: impl Into<ElementId>) -> PopoverMenu<M> {
112 PopoverMenu {113 PopoverMenu {
113 id: id.into(),114 id: id.into(),
crates/ui/src/components/right_click_menu.rs+1−0
@@ -39,6 +39,7 @@ impl<M: ManagedView> RightClickMenu<M> { · 38 unmodified lines
39 }39 }
40}40}
41 41
42/// Creates a [RightClickMenu]
42pub fn right_click_menu<M: ManagedView>(id: impl Into<ElementId>) -> RightClickMenu<M> {43pub fn right_click_menu<M: ManagedView>(id: impl Into<ElementId>) -> RightClickMenu<M> {
43 RightClickMenu {44 RightClickMenu {
44 id: id.into(),45 id: id.into(),
crates/ui/src/components/stack.rs+2−6
@@ -2,17 +2,13 @@ use gpui::{div, Div}; · 1 unmodified line
2 2
3use crate::StyledExt;3use crate::StyledExt;
4 4
5/// Horizontally stacks elements.5/// Horizontally stacks elements. Sets `flex()`, `flex_row()`, `items_center()`
6///
7/// Sets `flex()`, `flex_row()`, `items_center()`
8#[track_caller]6#[track_caller]
9pub fn h_stack() -> Div {7pub fn h_stack() -> Div {
10 div().h_flex()8 div().h_flex()
11}9}
12 10
13/// Vertically stacks elements.11/// Vertically stacks elements. Sets `flex()`, `flex_col()`
14///
15/// Sets `flex()`, `flex_col()`
16#[track_caller]12#[track_caller]
17pub fn v_stack() -> Div {13pub fn v_stack() -> Div {
18 div().v_flex()14 div().v_flex()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t