libcosmic/src/widget/mod.rs

81 lines
1.9 KiB
Rust
Raw Normal View History

// Copyright 2022 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
//! Cosmic-themed widget implementations.
2023-01-26 22:16:13 +01:00
pub mod aspect_ratio;
mod button;
pub use button::*;
2022-10-09 02:35:03 -07:00
mod header_bar;
2023-01-03 21:35:35 +01:00
pub use header_bar::{header_bar, HeaderBar};
2022-10-07 05:23:26 +02:00
pub mod icon;
pub use icon::{icon, Icon, IconSource};
pub mod list;
pub use list::*;
pub mod nav_bar;
pub use nav_bar::nav_bar;
pub mod nav_bar_toggle;
pub use nav_bar_toggle::{nav_bar_toggle, NavBarToggle};
2023-01-26 22:16:13 +01:00
pub mod rectangle_tracker;
pub mod search;
2022-12-28 12:42:28 +01:00
pub mod segmented_button;
pub use segmented_button::horizontal as horizontal_segmented_button;
pub use segmented_button::vertical as vertical_segmented_button;
pub mod segmented_selection;
pub use segmented_selection::horizontal as horizontal_segmented_selection;
pub use segmented_selection::vertical as vertical_segmented_selection;
2022-12-28 12:42:28 +01:00
pub mod settings;
mod scrollable;
pub use scrollable::*;
pub mod spin_button;
2023-01-03 21:35:35 +01:00
pub use spin_button::{spin_button, SpinButton};
2022-12-14 16:51:22 -05:00
2023-01-26 22:16:13 +01:00
mod text;
pub use text::{text, Text};
2022-12-17 18:17:13 -05:00
2023-01-26 22:16:13 +01:00
mod toggler;
pub use toggler::toggler;
2023-01-16 12:04:39 -07:00
pub mod view_switcher;
pub use view_switcher::horizontal as horiontal_view_switcher;
pub use view_switcher::vertical as vertical_view_switcher;
2023-01-16 12:04:39 -07:00
pub mod warning;
pub use warning::*;
2023-02-27 17:42:17 -05:00
pub mod cosmic_container;
pub use cosmic_container::*;
/// 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};
/// Horizontal divider with light thickness
#[must_use]
pub fn light() -> Rule<crate::Renderer> {
horizontal_rule(4).style(crate::theme::Rule::LightDivider)
}
/// Horizontal divider with heavy thickness.
#[must_use]
pub fn heavy() -> Rule<crate::Renderer> {
horizontal_rule(10).style(crate::theme::Rule::HeavyDivider)
}
}
}