| 1 | use serde::{Deserialize, Serialize}; |
| 2 | |
| 3 | use super::{ColourStr, TextStyleConfig, borders::WidgetBorderType}; |
| 4 | |
| 5 | /// General styling for generic widgets. |
| 6 | #[derive(Clone, Debug, Default, Deserialize, Serialize)] |
| 7 | #[cfg_attr(feature = "generate_schema", derive(schemars::JsonSchema))] |
| 8 | #[cfg_attr(test, serde(deny_unknown_fields), derive(PartialEq, Eq))] |
| 9 | pub(crate) struct WidgetStyle { |
| 10 | /// The colour of the widgets' borders. |
| 11 | #[serde(alias = "border_color")] |
| 12 | pub(crate) border_colour: Option<ColourStr>, |
| 13 | |
| 14 | /// The colour of a widget's borders when the widget is selected. |
| 15 | #[serde(alias = "selected_border_color")] |
| 16 | pub(crate) selected_border_colour: Option<ColourStr>, |
| 17 | |
| 18 | /// Text styling for a widget's title. |
| 19 | pub(crate) widget_title: Option<TextStyleConfig>, |
| 20 | |
| 21 | /// Text styling for text in general. |
| 22 | pub(crate) text: Option<TextStyleConfig>, |
| 23 | |
| 24 | /// Text styling for text when representing something that is selected. |
| 25 | pub(crate) selected_text: Option<TextStyleConfig>, |
| 26 | |
| 27 | /// Text styling for text when representing something that is disabled. |
| 28 | pub(crate) disabled_text: Option<TextStyleConfig>, |
| 29 | |
| 30 | /// Text styling for text when representing process threads. Only usable |
| 31 | /// on Linux at the moment. |
| 32 | pub(crate) thread_text: Option<TextStyleConfig>, |
| 33 | |
| 34 | /// Widget borders type. |
| 35 | pub(crate) widget_border_type: Option<WidgetBorderType>, |
| 36 | |
| 37 | /// Background colour for widgets. |
| 38 | #[serde(alias = "bg_color")] |
| 39 | pub(crate) bg_colour: Option<ColourStr>, |
| 40 | } |