Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cosmic-panel-bin/src/space_container/toplevel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl SpaceContainer {

let opacity = if maximized {
config.maximize();
1.0
config.opacity
} else {
if let Some(c) = c {
config = c.clone();
Expand Down
2 changes: 2 additions & 0 deletions cosmic-panel-config/src/container_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ impl Default for CosmicPanelContainerConfig {
opacity: 1.0,
autohover_delay_ms: Some(500),
padding_overlap: 0.5,
keep_style_on_maximize: false,
},
CosmicPanelConfig {
name: "Dock".to_string(),
Expand Down Expand Up @@ -209,6 +210,7 @@ impl Default for CosmicPanelContainerConfig {
opacity: 1.0,
autohover_delay_ms: Some(500),
padding_overlap: 0.5,
keep_style_on_maximize: false,
},
],
}
Expand Down
8 changes: 8 additions & 0 deletions cosmic-panel-config/src/panel_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ pub struct CosmicPanelConfig {
pub autohover_delay_ms: Option<u32>,
/// padding overlap ratio
pub padding_overlap: f32,
/// keep panel styling when windows are maximized
#[serde(default)]
pub keep_style_on_maximize: bool,
}

impl PartialEq for CosmicPanelConfig {
Expand All @@ -442,6 +445,7 @@ impl PartialEq for CosmicPanelConfig {
&& self.size_center == other.size_center
&& self.size_wings == other.size_wings
&& (self.opacity - other.opacity).abs() < 0.01
&& self.keep_style_on_maximize == other.keep_style_on_maximize
}
}

Expand Down Expand Up @@ -471,6 +475,7 @@ impl Default for CosmicPanelConfig {
opacity: 0.8,
autohover_delay_ms: Some(500),
padding_overlap: 0.5,
keep_style_on_maximize: false,
}
}
}
Expand Down Expand Up @@ -689,6 +694,9 @@ impl CosmicPanelConfig {
}

pub fn maximize(&mut self) {
if self.keep_style_on_maximize {
return;
}
self.opacity = 1.0;
if self.autohide().is_some() {
return;
Expand Down