2022-12-06 16:12:59 +01:00
|
|
|
// Copyright 2022 System76 <info@system76.com>
|
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
|
2024-05-20 20:01:47 +02:00
|
|
|
//! The COSMIC widget library
|
|
|
|
|
//!
|
|
|
|
|
//! This module contains a wide variety of widgets used throughout the COSMIC app ecosystem.
|
|
|
|
|
//!
|
|
|
|
|
//! # Overview
|
|
|
|
|
//!
|
|
|
|
|
//! Add widgets to your application view by calling the modules and functions below.
|
|
|
|
|
//! Widgets are constructed by chaining their property methods using a functional paradigm.
|
|
|
|
|
//! Modules may contain additional functions for constructing different variations of a widget.
|
|
|
|
|
//! Each module will typically have one widget with the same name as the module, which will be re-exported here.
|
|
|
|
|
//!
|
2024-05-21 04:36:32 +02:00
|
|
|
//! ```no_run,ignore
|
2024-05-20 20:01:47 +02:00
|
|
|
//! use cosmic::prelude::*;
|
|
|
|
|
//! use cosmic::{cosmic_theme, theme, widget};
|
|
|
|
|
//!
|
|
|
|
|
//! const REPOSITORY: &str = "https://github.com/pop-os/libcosmic";
|
|
|
|
|
//!
|
|
|
|
|
//! let cosmic_theme::Spacing { space_xxs, .. } = theme::active().cosmic().spacing;
|
|
|
|
|
//!
|
|
|
|
|
//! let link = widget::button::link(REPOSITORY)
|
|
|
|
|
//! .on_press(Message::LaunchUrl(REPOSITORY))
|
|
|
|
|
//! .padding(0);
|
|
|
|
|
//!
|
|
|
|
|
//! let content = widget::column()
|
|
|
|
|
//! .push(widget::icon::from_name("my-app-icon"))
|
|
|
|
|
//! .push(widget::text::title3("My App Name"))
|
|
|
|
|
//! .push(link)
|
|
|
|
|
//! .align_items(Alignment::Center)
|
|
|
|
|
//! .spacing(space_xxs);
|
|
|
|
|
//! ```
|
|
|
|
|
//!
|
|
|
|
|
//! Widgets may borrow data from your application struct, and should do so to avoid allocating.
|
|
|
|
|
//!
|
2024-05-21 04:36:32 +02:00
|
|
|
//! ```no_run,ignore
|
2024-05-20 20:01:47 +02:00
|
|
|
//! let text = widget::text::body(&self.cached_text);
|
|
|
|
|
//! ```
|
|
|
|
|
//!
|
|
|
|
|
//! Use the [`cosmic::Apply`](crate::Apply) trait to embed widgets into other widgets which accept them.
|
|
|
|
|
//!
|
2024-05-21 04:36:32 +02:00
|
|
|
//! ```no_run,ignore
|
2024-05-20 20:01:47 +02:00
|
|
|
//! let button = widget::icon::from_name("printer-symbolic")
|
|
|
|
|
//! .apply(widget::button::icon)
|
|
|
|
|
//! .on_press(Message::Print);
|
|
|
|
|
//! ```
|
2023-01-17 18:49:40 +01:00
|
|
|
|
2023-08-21 22:58:10 +02:00
|
|
|
// Re-exports from Iced
|
2024-05-29 23:57:26 +02:00
|
|
|
#[doc(inline)]
|
|
|
|
|
pub use iced::widget::{canvas, Canvas};
|
|
|
|
|
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-08-21 22:58:10 +02:00
|
|
|
pub use iced::widget::{checkbox, Checkbox};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-13 15:46:15 +02:00
|
|
|
pub use iced::widget::{combo_box, ComboBox};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-01 07:22:06 +02:00
|
|
|
pub use iced::widget::{container, Container};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-01 07:22:06 +02:00
|
|
|
pub use iced::widget::{horizontal_space, space, vertical_space, Space};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-08-21 22:58:10 +02:00
|
|
|
pub use iced::widget::{image, Image};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-13 15:46:15 +02:00
|
|
|
pub use iced::widget::{lazy, Lazy};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-01 07:22:06 +02:00
|
|
|
pub use iced::widget::{mouse_area, MouseArea};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-13 15:46:15 +02:00
|
|
|
pub use iced::widget::{pane_grid, PaneGrid};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-13 15:46:15 +02:00
|
|
|
pub use iced::widget::{progress_bar, ProgressBar};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-08-21 22:58:10 +02:00
|
|
|
pub use iced::widget::{radio, Radio};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-13 15:46:15 +02:00
|
|
|
pub use iced::widget::{responsive, Responsive};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-13 15:46:15 +02:00
|
|
|
pub use iced::widget::{slider, vertical_slider, Slider, VerticalSlider};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-01 07:22:06 +02:00
|
|
|
pub use iced::widget::{svg, Svg};
|
2024-05-20 17:19:42 +02:00
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2024-05-29 23:59:27 +02:00
|
|
|
pub use iced::widget::{text_editor, TextEditor};
|
|
|
|
|
|
|
|
|
|
#[doc(inline)]
|
2023-09-13 15:46:15 +02:00
|
|
|
pub use iced_core::widget::{Id, Operation, Widget};
|
2023-08-21 22:58:10 +02:00
|
|
|
|
2023-01-26 22:16:13 +01:00
|
|
|
pub mod aspect_ratio;
|
|
|
|
|
|
2023-09-01 07:29:19 +02:00
|
|
|
pub mod button;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-09-01 07:29:19 +02:00
|
|
|
pub use button::{button, Button, IconButton, LinkButton, TextButton};
|
2022-09-30 09:35:55 -06:00
|
|
|
|
2024-02-22 21:05:21 +01:00
|
|
|
pub(crate) mod common;
|
|
|
|
|
|
2024-03-14 16:16:51 +01:00
|
|
|
pub mod calendar;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2024-03-14 16:16:51 +01:00
|
|
|
pub use calendar::{calendar, Calendar};
|
|
|
|
|
|
2023-07-17 11:44:57 -04:00
|
|
|
pub mod card;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-07-17 11:44:57 -04:00
|
|
|
pub use card::*;
|
|
|
|
|
|
2023-09-29 16:14:03 -04:00
|
|
|
pub mod color_picker;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-10-12 13:21:38 +02:00
|
|
|
pub use color_picker::{ColorPicker, ColorPickerModel};
|
2023-09-29 16:14:03 -04:00
|
|
|
|
2023-10-12 13:23:21 +02:00
|
|
|
pub mod context_drawer;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-10-12 13:23:21 +02:00
|
|
|
pub use context_drawer::{context_drawer, ContextDrawer};
|
|
|
|
|
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-09-01 07:23:24 +02:00
|
|
|
pub use column::{column, Column};
|
|
|
|
|
pub mod column {
|
2024-05-20 20:01:47 +02:00
|
|
|
//! A container which aligns its children in a column.
|
|
|
|
|
|
2024-01-30 22:14:00 -05:00
|
|
|
pub type Column<'a, Message> = iced::widget::Column<'a, Message, crate::Theme, crate::Renderer>;
|
2023-09-01 07:23:24 +02:00
|
|
|
|
|
|
|
|
#[must_use]
|
2024-05-20 20:01:47 +02:00
|
|
|
/// A container which aligns its children in a column.
|
2023-09-13 15:32:38 +02:00
|
|
|
pub fn column<'a, Message>() -> Column<'a, Message> {
|
2023-09-01 07:23:24 +02:00
|
|
|
Column::new()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[must_use]
|
2024-05-20 20:01:47 +02:00
|
|
|
/// A pre-allocated [`column`].
|
2023-09-13 15:32:38 +02:00
|
|
|
pub fn with_capacity<'a, Message>(capacity: usize) -> Column<'a, Message> {
|
2023-09-01 07:23:24 +02:00
|
|
|
Column::with_children(Vec::with_capacity(capacity))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[must_use]
|
2024-05-20 20:01:47 +02:00
|
|
|
/// A [`column`] that will be assigned a [`Vec`] of children.
|
2023-09-13 15:32:38 +02:00
|
|
|
pub fn with_children<Message>(children: Vec<crate::Element<Message>>) -> Column<Message> {
|
2023-09-01 07:23:24 +02:00
|
|
|
Column::with_children(children)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-12 16:19:35 +01:00
|
|
|
pub mod layer_container;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2024-03-12 16:19:35 +01:00
|
|
|
pub use layer_container::{layer_container, LayerContainer};
|
2023-09-01 07:21:15 +02:00
|
|
|
|
2024-04-19 17:12:54 +02:00
|
|
|
pub mod context_menu;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2024-04-19 17:12:54 +02:00
|
|
|
pub use context_menu::{context_menu, ContextMenu};
|
|
|
|
|
|
2024-02-27 09:34:39 -07:00
|
|
|
pub mod dialog;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2024-02-27 09:34:39 -07:00
|
|
|
pub use dialog::{dialog, Dialog};
|
|
|
|
|
|
2023-09-01 07:23:24 +02:00
|
|
|
/// An element to distinguish a boundary between two elements.
|
|
|
|
|
pub mod divider {
|
|
|
|
|
/// Horizontal variant of a divider.
|
|
|
|
|
pub mod horizontal {
|
|
|
|
|
use iced::widget::{horizontal_rule, Rule};
|
|
|
|
|
|
2023-09-13 15:33:38 +02:00
|
|
|
/// Horizontal divider with default thickness
|
|
|
|
|
#[must_use]
|
2024-01-30 22:14:00 -05:00
|
|
|
pub fn default() -> Rule<crate::Theme> {
|
2023-09-13 15:33:38 +02:00
|
|
|
horizontal_rule(1).style(crate::theme::Rule::Default)
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-01 07:23:24 +02:00
|
|
|
/// Horizontal divider with light thickness
|
|
|
|
|
#[must_use]
|
2024-01-30 22:14:00 -05:00
|
|
|
pub fn light() -> Rule<crate::Theme> {
|
2023-09-01 07:23:24 +02:00
|
|
|
horizontal_rule(4).style(crate::theme::Rule::LightDivider)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Horizontal divider with heavy thickness.
|
|
|
|
|
#[must_use]
|
2024-01-30 22:14:00 -05:00
|
|
|
pub fn heavy() -> Rule<crate::Theme> {
|
2023-09-01 07:23:24 +02:00
|
|
|
horizontal_rule(10).style(crate::theme::Rule::HeavyDivider)
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-13 15:33:57 +02:00
|
|
|
|
|
|
|
|
/// Vertical variant of a divider.
|
|
|
|
|
pub mod vertical {
|
|
|
|
|
use iced::widget::{vertical_rule, Rule};
|
|
|
|
|
|
|
|
|
|
/// Vertical divider with default thickness
|
|
|
|
|
#[must_use]
|
2024-01-30 22:14:00 -05:00
|
|
|
pub fn default() -> Rule<crate::Theme> {
|
2023-09-13 15:33:57 +02:00
|
|
|
vertical_rule(1).style(crate::theme::Rule::Default)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Vertical divider with light thickness
|
|
|
|
|
#[must_use]
|
2024-01-30 22:14:00 -05:00
|
|
|
pub fn light() -> Rule<crate::Theme> {
|
2023-09-13 15:33:57 +02:00
|
|
|
vertical_rule(4).style(crate::theme::Rule::LightDivider)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Vertical divider with heavy thickness.
|
|
|
|
|
#[must_use]
|
2024-01-30 22:14:00 -05:00
|
|
|
pub fn heavy() -> Rule<crate::Theme> {
|
2023-09-13 15:33:57 +02:00
|
|
|
vertical_rule(10).style(crate::theme::Rule::HeavyDivider)
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-09-01 07:23:24 +02:00
|
|
|
}
|
|
|
|
|
|
2024-04-09 14:28:06 -04:00
|
|
|
pub mod dnd_destination;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2024-04-09 14:28:06 -04:00
|
|
|
pub use dnd_destination::{dnd_destination, DndDestination};
|
|
|
|
|
|
|
|
|
|
pub mod dnd_source;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2024-04-09 14:28:06 -04:00
|
|
|
pub use dnd_source::{dnd_source, DndSource};
|
|
|
|
|
|
2023-10-23 16:57:37 +02:00
|
|
|
pub mod dropdown;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-10-23 16:57:37 +02:00
|
|
|
pub use dropdown::{dropdown, Dropdown};
|
|
|
|
|
|
2023-06-23 23:39:48 +02:00
|
|
|
pub mod flex_row;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-06-23 23:39:48 +02:00
|
|
|
pub use flex_row::{flex_row, FlexRow};
|
|
|
|
|
|
2023-10-02 16:46:16 +02:00
|
|
|
pub mod grid;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-10-02 16:46:16 +02:00
|
|
|
pub use grid::{grid, Grid};
|
|
|
|
|
|
2022-10-09 02:35:03 -07:00
|
|
|
mod header_bar;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-01-03 21:35:35 +01:00
|
|
|
pub use header_bar::{header_bar, HeaderBar};
|
2022-10-07 05:23:26 +02:00
|
|
|
|
2023-01-17 18:49:40 +01:00
|
|
|
pub mod icon;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-09-01 07:23:24 +02:00
|
|
|
pub use icon::{icon, Icon};
|
2022-12-06 16:12:59 +01:00
|
|
|
|
2024-05-30 15:48:42 -04:00
|
|
|
pub mod id_container;
|
|
|
|
|
#[doc(inline)]
|
|
|
|
|
pub use id_container::{id_container, IdContainer};
|
|
|
|
|
|
2023-07-26 16:32:23 -04:00
|
|
|
#[cfg(feature = "animated-image")]
|
|
|
|
|
pub mod frames;
|
|
|
|
|
|
2024-05-29 23:55:50 +02:00
|
|
|
pub use taffy::JustifyContent;
|
|
|
|
|
|
2022-12-06 16:12:59 +01:00
|
|
|
pub mod list;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
|
|
|
|
pub use list::{list_column, ListColumn};
|
2022-12-06 16:12:59 +01:00
|
|
|
|
2023-11-16 08:00:11 -07:00
|
|
|
pub mod menu;
|
|
|
|
|
|
2023-01-06 01:40:21 +01:00
|
|
|
pub mod nav_bar;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2024-04-09 14:28:06 -04:00
|
|
|
pub use nav_bar::{nav_bar, nav_bar_dnd};
|
2023-01-06 01:40:21 +01:00
|
|
|
|
2023-01-09 22:59:39 +01:00
|
|
|
pub mod nav_bar_toggle;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-01-17 18:49:40 +01:00
|
|
|
pub use nav_bar_toggle::{nav_bar_toggle, NavBarToggle};
|
2022-09-30 09:35:55 -06:00
|
|
|
|
2023-05-11 13:29:05 -07:00
|
|
|
pub mod popover;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-05-11 13:29:05 -07:00
|
|
|
pub use popover::{popover, Popover};
|
|
|
|
|
|
2023-01-26 22:16:13 +01:00
|
|
|
pub mod rectangle_tracker;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-10-12 13:16:12 +02:00
|
|
|
pub use rectangle_tracker::{rectangle_tracker, RectangleTracker};
|
2023-01-26 22:16:13 +01:00
|
|
|
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-09-01 07:23:24 +02:00
|
|
|
pub use row::{row, Row};
|
2024-05-20 20:01:47 +02:00
|
|
|
|
2023-09-01 07:23:24 +02:00
|
|
|
pub mod row {
|
2024-05-20 20:01:47 +02:00
|
|
|
//! A container which aligns its children in a row.
|
|
|
|
|
|
2024-01-30 22:14:00 -05:00
|
|
|
pub type Row<'a, Message> = iced::widget::Row<'a, Message, crate::Theme, crate::Renderer>;
|
2023-09-01 07:23:24 +02:00
|
|
|
|
|
|
|
|
#[must_use]
|
2024-05-20 20:01:47 +02:00
|
|
|
/// A container which aligns its children in a row.
|
2023-09-13 15:33:01 +02:00
|
|
|
pub fn row<'a, Message>() -> Row<'a, Message> {
|
2023-09-01 07:23:24 +02:00
|
|
|
Row::new()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[must_use]
|
2024-05-20 20:01:47 +02:00
|
|
|
/// A pre-allocated [`row`].
|
2023-09-13 15:33:01 +02:00
|
|
|
pub fn with_capacity<'a, Message>(capacity: usize) -> Row<'a, Message> {
|
2023-09-01 07:23:24 +02:00
|
|
|
Row::with_children(Vec::with_capacity(capacity))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[must_use]
|
2024-05-20 20:01:47 +02:00
|
|
|
/// A [`row`] that will be assigned a [`Vec`] of children.
|
2023-09-13 15:33:01 +02:00
|
|
|
pub fn with_children<Message>(children: Vec<crate::Element<Message>>) -> Row<Message> {
|
2023-09-01 07:23:24 +02:00
|
|
|
Row::with_children(children)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-08-21 22:58:10 +02:00
|
|
|
mod scrollable;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-08-21 22:58:10 +02:00
|
|
|
pub use scrollable::*;
|
|
|
|
|
|
2022-12-28 12:42:28 +01:00
|
|
|
pub mod segmented_button;
|
2024-02-26 16:20:24 +01:00
|
|
|
pub mod segmented_control;
|
2022-12-28 12:42:28 +01:00
|
|
|
|
2022-12-06 16:12:59 +01:00
|
|
|
pub mod settings;
|
2022-09-30 18:43:32 -07:00
|
|
|
|
2022-12-06 16:17:34 -07:00
|
|
|
pub mod spin_button;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-01-03 21:35:35 +01:00
|
|
|
pub use spin_button::{spin_button, SpinButton};
|
2022-12-14 16:51:22 -05:00
|
|
|
|
2024-02-26 16:26:33 +01:00
|
|
|
pub mod tab_bar;
|
|
|
|
|
|
2023-09-01 07:19:32 +02:00
|
|
|
pub mod text;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-01-26 22:16:13 +01:00
|
|
|
pub use text::{text, Text};
|
2022-12-17 18:17:13 -05:00
|
|
|
|
2023-09-01 07:21:15 +02:00
|
|
|
pub mod text_input;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
|
|
|
|
pub use text_input::{
|
|
|
|
|
editable_input, inline_input, search_input, secure_input, text_input, TextInput,
|
|
|
|
|
};
|
2023-09-01 07:21:15 +02:00
|
|
|
|
2024-07-22 15:34:26 +02:00
|
|
|
pub mod toaster;
|
|
|
|
|
#[doc(inline)]
|
2024-08-22 16:41:43 +03:00
|
|
|
pub use toaster::{toaster, Toast, ToastId, Toasts};
|
2024-07-22 15:34:26 +02:00
|
|
|
|
2023-01-26 22:16:13 +01:00
|
|
|
mod toggler;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-01-26 22:16:13 +01:00
|
|
|
pub use toggler::toggler;
|
2023-01-16 12:04:39 -07:00
|
|
|
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-09-13 15:34:47 +02:00
|
|
|
pub use tooltip::{tooltip, Tooltip};
|
|
|
|
|
pub mod tooltip {
|
|
|
|
|
use crate::Element;
|
|
|
|
|
use std::borrow::Cow;
|
|
|
|
|
|
|
|
|
|
pub use iced::widget::tooltip::Position;
|
|
|
|
|
|
2024-01-30 22:14:00 -05:00
|
|
|
pub type Tooltip<'a, Message> =
|
|
|
|
|
iced::widget::Tooltip<'a, Message, crate::Theme, crate::Renderer>;
|
2023-09-13 15:34:47 +02:00
|
|
|
|
|
|
|
|
pub fn tooltip<'a, Message>(
|
|
|
|
|
content: impl Into<Element<'a, Message>>,
|
|
|
|
|
tooltip: impl Into<Cow<'a, str>>,
|
|
|
|
|
position: Position,
|
|
|
|
|
) -> Tooltip<'a, Message> {
|
|
|
|
|
let xxs = crate::theme::active().cosmic().space_xxs();
|
|
|
|
|
|
|
|
|
|
Tooltip::new(content, tooltip, position)
|
|
|
|
|
.style(crate::theme::Container::Tooltip)
|
|
|
|
|
.padding(xxs)
|
|
|
|
|
.gap(1)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-16 12:04:39 -07:00
|
|
|
pub mod warning;
|
2024-05-20 17:19:42 +02:00
|
|
|
#[doc(inline)]
|
2023-01-16 12:04:39 -07:00
|
|
|
pub use warning::*;
|