improv(segmented_button): rework layout, drawing, and styling to fix visual flaws

This commit is contained in:
Michael Aaron Murphy 2024-02-23 16:05:55 +01:00 committed by Michael Murphy
parent bd353c6b54
commit 366a450977
9 changed files with 364 additions and 170 deletions

View file

@ -1,4 +1,4 @@
use cosmic_config::{Config, ConfigGet, ConfigSet, CosmicConfigEntry};
use cosmic_config::{Config, ConfigGet, CosmicConfigEntry};
/// ID for the ThemeMode config
pub const THEME_MODE_ID: &str = "com.system76.CosmicTheme.Mode";

View file

@ -157,19 +157,32 @@ impl Theme {
pub fn accent_color(&self) -> Srgba {
self.accent.base.clone()
}
/// get @success_color
pub fn success_color(&self) -> Srgba {
self.success.base.clone()
}
/// get @destructive_color
pub fn destructive_color(&self) -> Srgba {
self.destructive.base.clone()
}
/// get @warning_color
pub fn warning_color(&self) -> Srgba {
self.warning.base.clone()
}
/// get @small_container_widget
pub fn small_container_widget(&self) -> Srgba {
self.palette.gray_2.clone()
}
/// get @small_widget_divider
pub fn small_widget_divider(&self) -> Srgba {
self.palette.neutral_9.clone()
}
// Containers
/// get @bg_color
pub fn bg_color(&self) -> Srgba {