Add gamma control and night light (#38)
Add configurable night light, smooth gamma transitions, and shell controls. Update documentation and panel tests, and fix portal test startup synchronization.
This commit is contained in:
1 parent
9163374cdb
commit
2a400b26d0
34 files changed
+940
-20
No files matched your search
@@ -149,6 +149,7 @@ impl FereseShell {
|
||||
}
|
||||
|
||||
pub fn destroy_menu(&mut self) -> Task<Message> {
|
||||
self.night_light_temperature = None;
|
||||
let tooltip = self.dismiss_workspace_tooltip();
|
||||
crate::EFFECT_FRAME_PENDING.store(false, std::sync::atomic::Ordering::Relaxed);
|
||||
let Some(menu) = self.menu.take() else {
|
||||
@@ -167,6 +168,7 @@ impl FereseShell {
|
||||
}
|
||||
|
||||
pub fn close_menu(&mut self) -> Task<Message> {
|
||||
self.night_light_temperature = None;
|
||||
self.refresh_media_art(false);
|
||||
let Some(menu) = &mut self.menu else {
|
||||
return Task::none();
|
||||
@@ -210,6 +212,16 @@ impl FereseShell {
|
||||
}
|
||||
}
|
||||
Action::Brightness(v) => self.status.brightness = Some(*v),
|
||||
Action::NightLight(enabled) => {
|
||||
if let Some(status) = &mut self.status.night_light {
|
||||
status.enabled = *enabled;
|
||||
}
|
||||
}
|
||||
Action::NightLightTemperature(temperature) => {
|
||||
if let Some(status) = &mut self.status.night_light {
|
||||
status.temperature = *temperature;
|
||||
}
|
||||
}
|
||||
Action::Wifi(v) => {
|
||||
if let Some(n) = &mut self.status.network {
|
||||
n.enabled = *v;
|
||||
@@ -409,9 +421,11 @@ mod tests {
|
||||
},
|
||||
};
|
||||
assert!(anchor.belongs_to(&panel));
|
||||
panel.end.groups[0].items[2].visible = false;
|
||||
let items = &mut panel.end.groups[0].items;
|
||||
let network = items.iter().position(|item| item.id.0 == "network").unwrap();
|
||||
items[network].visible = false;
|
||||
assert!(!anchor.belongs_to(&panel));
|
||||
panel.end.groups[0].items.remove(2);
|
||||
panel.end.groups[0].items.remove(network);
|
||||
assert!(!anchor.belongs_to(&panel));
|
||||
panel.id = crate::panel::PanelId("other".into());
|
||||
let fallback = PopoverAnchor {
|
||||
|
||||
Reference in new issue
Block a user