Add island bar layout and Settings controls
Group workspaces with Overview and status controls with the clock. Keep themed backgrounds and borders around each island, with click-through gaps and configurable side padding defaulting to 4 px. Capture blur within each panel region and update material and input regions when island bounds change. Cover layout reloads and padding changes with widget and native shell tests.
This commit is contained in:
1 parent
90e5c3543d
commit
004a5cdefe
12 files changed
+816
-45
No files matched your search
@@ -80,6 +80,12 @@ pub(crate) struct DaemonConfig {
|
||||
#[derive(Debug, Default, Deserialize)]
|
||||
#[allow(dead_code)]
|
||||
struct ShellStatusConfig {
|
||||
bar_layout: Option<ferese_config::BarLayout>,
|
||||
#[serde(
|
||||
default = "ferese_config::default_bar_island_padding",
|
||||
deserialize_with = "ferese_config::deserialize_bar_island_padding"
|
||||
)]
|
||||
bar_island_padding: f32,
|
||||
battery_percentage: Option<bool>,
|
||||
low_battery_threshold: Option<u8>,
|
||||
settings_command: Option<Vec<String>>,
|
||||
@@ -359,6 +365,29 @@ pub(crate) fn config_path() -> Option<PathBuf> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn bar_layout_is_validated_before_live_publication() {
|
||||
for layout in ["continuous", "islands"] {
|
||||
let source = format!("status {{ bar-layout \"{layout}\"; }}");
|
||||
Config::parse_source(&source).unwrap().runtime_config().unwrap();
|
||||
}
|
||||
|
||||
assert!(Config::parse_source("status { bar-layout \"invalid\"; }").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn island_padding_is_validated_before_live_publication() {
|
||||
for padding in ["0", "4.5", "12", "32"] {
|
||||
let source = format!("status {{ bar-island-padding {padding}; }}");
|
||||
Config::parse_source(&source).unwrap().runtime_config().unwrap();
|
||||
}
|
||||
|
||||
for padding in ["-1", "32.5", "\"small\""] {
|
||||
let source = format!("status {{ bar-island-padding {padding}; }}");
|
||||
assert!(Config::parse_source(&source).is_err());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rejects_removed_physics_keys_before_publication() {
|
||||
for property in ["spring", "viewport-spring"] {
|
||||
|
||||
@@ -49,7 +49,13 @@ pub(super) fn append_material_surface(
|
||||
geometry: *rect,
|
||||
corners: *corners,
|
||||
index,
|
||||
capture_geometry: geometry,
|
||||
capture_geometry: if crate::effects::surface_role(surface)
|
||||
.is_some_and(|(role, _)| role == crate::effects::SemanticRole::Panel)
|
||||
{
|
||||
*rect
|
||||
} else {
|
||||
geometry
|
||||
},
|
||||
alpha: *alpha,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user