parent
39d45bcbc1
commit
5bd7eaa173
35 changed files with 99 additions and 89 deletions
|
@ -349,8 +349,8 @@ impl ButtonCommon for Button {
|
|||
/// Sets a tooltip for the button.
|
||||
///
|
||||
/// This method allows a tooltip to be set for the button. The tooltip is a function that
|
||||
/// takes a mutable reference to a [`WindowContext`] and returns an [`AnyView`]. The tooltip
|
||||
/// is displayed when the user hovers over the button.
|
||||
/// takes a mutable references to [`Window`] and [`App`], and returns an [`AnyView`]. The
|
||||
/// tooltip is displayed when the user hovers over the button.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
|
|
@ -31,7 +31,7 @@ pub struct ContentGroup {
|
|||
}
|
||||
|
||||
impl ContentGroup {
|
||||
/// Creates a new [ContentBox].
|
||||
/// Creates a new [`ContentGroup`].
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
base: div(),
|
||||
|
@ -41,13 +41,13 @@ impl ContentGroup {
|
|||
}
|
||||
}
|
||||
|
||||
/// Removes the border from the [ContentBox].
|
||||
/// Removes the border from the [`ContentGroup`].
|
||||
pub fn borderless(mut self) -> Self {
|
||||
self.border = false;
|
||||
self
|
||||
}
|
||||
|
||||
/// Removes the background fill from the [ContentBox].
|
||||
/// Removes the background fill from the [`ContentGroup`].
|
||||
pub fn unfilled(mut self) -> Self {
|
||||
self.fill = false;
|
||||
self
|
||||
|
|
|
@ -28,7 +28,7 @@ pub enum VectorName {
|
|||
|
||||
/// A vector image, such as an SVG.
|
||||
///
|
||||
/// A [`Vector`] is different from an [`Icon`] in that it is intended
|
||||
/// A [`Vector`] is different from an [`crate::Icon`] in that it is intended
|
||||
/// to be displayed at a specific size, or series of sizes, rather
|
||||
/// than conforming to the standard size of an icon.
|
||||
#[derive(IntoElement)]
|
||||
|
|
|
@ -42,8 +42,9 @@ impl Navigable {
|
|||
}
|
||||
|
||||
/// Add a new entry that can be navigated to via keyboard.
|
||||
/// The order of calls to [Navigable::entry] determines the order of traversal of elements via successive
|
||||
/// uses of [menu:::SelectNext]/[menu::SelectPrev]
|
||||
///
|
||||
/// The order of calls to [Navigable::entry] determines the order of traversal of
|
||||
/// elements via successive uses of `menu:::SelectNext/SelectPrev`
|
||||
pub fn entry(mut self, child: NavigableEntry) -> Self {
|
||||
self.selectable_children.push(child);
|
||||
self
|
||||
|
@ -59,6 +60,7 @@ impl Navigable {
|
|||
.position(|entry| entry.focus_handle.contains_focused(window, cx))
|
||||
}
|
||||
}
|
||||
|
||||
impl RenderOnce for Navigable {
|
||||
fn render(self, _window: &mut Window, _: &mut App) -> impl crate::IntoElement {
|
||||
div()
|
||||
|
|
|
@ -5,6 +5,8 @@ use std::sync::Arc;
|
|||
use crate::prelude::*;
|
||||
|
||||
/// A [`Checkbox`] that has a [`Label`].
|
||||
///
|
||||
/// [`Checkbox`]: crate::components::Checkbox
|
||||
#[derive(IntoElement)]
|
||||
pub struct RadioWithLabel {
|
||||
id: ElementId,
|
||||
|
|
|
@ -22,7 +22,7 @@ pub enum ElevationIndex {
|
|||
EditorSurface,
|
||||
/// A surface that is elevated above the primary surface. but below washes, models, and dragged elements.
|
||||
ElevatedSurface,
|
||||
/// A surface above the [ElevationIndex::Wash] that is used for dialogs, alerts, modals, etc.
|
||||
/// A surface above the [ElevationIndex::ElevatedSurface] that is used for dialogs, alerts, modals, etc.
|
||||
ModalSurface,
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ pub trait StyledTypography: Styled + Sized {
|
|||
self.font_family(ui_font_family)
|
||||
}
|
||||
|
||||
/// Sets the text size using a [`UiTextSize`].
|
||||
/// Sets the text size using a [`TextSize`].
|
||||
fn text_ui_size(self, size: TextSize, cx: &App) -> Self {
|
||||
self.text_size(size.rems(cx))
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ pub trait StyledExt: Styled + Sized {
|
|||
elevated(self, cx, ElevationIndex::Surface)
|
||||
}
|
||||
|
||||
/// See [`elevation_1`].
|
||||
/// See [`elevation_1`](Self::elevation_1).
|
||||
///
|
||||
/// Renders a borderless version [`elevation_1`].
|
||||
/// Renders a borderless version [`elevation_1`](Self::elevation_1).
|
||||
fn elevation_1_borderless(self, cx: &mut App) -> Self {
|
||||
elevated_borderless(self, cx, ElevationIndex::Surface)
|
||||
}
|
||||
|
@ -58,9 +58,9 @@ pub trait StyledExt: Styled + Sized {
|
|||
elevated(self, cx, ElevationIndex::ElevatedSurface)
|
||||
}
|
||||
|
||||
/// See [`elevation_2`].
|
||||
/// See [`elevation_2`](Self::elevation_2).
|
||||
///
|
||||
/// Renders a borderless version [`elevation_2`].
|
||||
/// Renders a borderless version [`elevation_2`](Self::elevation_2).
|
||||
fn elevation_2_borderless(self, cx: &mut App) -> Self {
|
||||
elevated_borderless(self, cx, ElevationIndex::ElevatedSurface)
|
||||
}
|
||||
|
@ -78,9 +78,9 @@ pub trait StyledExt: Styled + Sized {
|
|||
elevated(self, cx, ElevationIndex::ModalSurface)
|
||||
}
|
||||
|
||||
/// See [`elevation_3`].
|
||||
/// See [`elevation_3`](Self::elevation_3).
|
||||
///
|
||||
/// Renders a borderless version [`elevation_3`].
|
||||
/// Renders a borderless version [`elevation_3`](Self::elevation_3).
|
||||
fn elevation_3_borderless(self, cx: &mut App) -> Self {
|
||||
elevated_borderless(self, cx, ElevationIndex::ModalSurface)
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
//! ## Related Crates:
|
||||
//!
|
||||
//! - [`ui_macros`] - proc_macros support for this crate
|
||||
//! - [`ui_input`] - the single line input component
|
||||
//!
|
||||
//! - `ui_input` - the single line input component
|
||||
|
||||
mod components;
|
||||
pub mod prelude;
|
||||
|
|
|
@ -22,6 +22,8 @@ impl WithRemSize {
|
|||
|
||||
/// Block the mouse from interacting with this element or any of its children
|
||||
/// The fluent API equivalent to [`Interactivity::occlude_mouse`]
|
||||
///
|
||||
/// [`Interactivity::occlude_mouse`]: gpui::Interactivity::occlude_mouse
|
||||
pub fn occlude(mut self) -> Self {
|
||||
self.div = self.div.occlude();
|
||||
self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue