2022-11-10 01:10:28 +01:00
|
|
|
//! Change the appearance of a pane grid.
|
2021-01-01 15:28:38 +01:00
|
|
|
use iced_core::Color;
|
|
|
|
|
|
|
|
|
|
/// A set of rules that dictate the style of a container.
|
|
|
|
|
pub trait StyleSheet {
|
2022-11-10 01:10:28 +01:00
|
|
|
/// The supported style of the [`StyleSheet`].
|
2022-11-09 04:05:31 +01:00
|
|
|
type Style: Default;
|
2022-06-01 01:44:59 +02:00
|
|
|
|
2021-01-01 15:28:38 +01:00
|
|
|
/// The [`Line`] to draw when a split is picked.
|
2022-11-09 04:05:31 +01:00
|
|
|
fn picked_split(&self, style: &Self::Style) -> Option<Line>;
|
2021-01-01 15:28:38 +01:00
|
|
|
|
|
|
|
|
/// The [`Line`] to draw when a split is hovered.
|
2022-11-09 04:05:31 +01:00
|
|
|
fn hovered_split(&self, style: &Self::Style) -> Option<Line>;
|
2021-01-01 15:28:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A line.
|
|
|
|
|
///
|
|
|
|
|
/// It is normally used to define the highlight of something, like a split.
|
|
|
|
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
|
|
|
|
pub struct Line {
|
|
|
|
|
/// The [`Color`] of the [`Line`].
|
|
|
|
|
pub color: Color,
|
|
|
|
|
|
|
|
|
|
/// The width of the [`Line`].
|
|
|
|
|
pub width: f32,
|
|
|
|
|
}
|