cargo fmt

This commit is contained in:
Ashley Wulber 2024-05-16 11:48:24 -04:00 committed by Ashley Wulber
parent 9f8505b5a7
commit aae3e80515

View file

@ -41,13 +41,13 @@ pub enum Mirroring {
/// Night light preferences
// #[derive(Clone, Copy, Debug)]
// pub enum NightLight {
/// Toggles night light's automatic scheduling.
/// Toggles night light's automatic scheduling.
// AutoSchedule(bool),
/// Sets the night light schedule.
/// Sets the night light schedule.
// ManualSchedule,
/// Changes the preferred night light temperature.
/// Changes the preferred night light temperature.
// Temperature(f32),
/// Toggles night light mode
/// Toggles night light mode
// Toggle(bool),
// }
@ -66,9 +66,9 @@ pub enum Message {
/// Configures mirroring status of a display.
Mirroring(Mirroring),
/// Handle night light preferences.
// NightLight(NightLight),
// NightLight(NightLight),
/// Show the night light mode context drawer.
// NightLightContext,
// NightLightContext,
/// Set the orientation of a display.
Orientation(Transform),
/// Status of an applied display change.
@ -113,7 +113,7 @@ pub struct Page {
background_service: Option<tokio::task::JoinHandle<()>>,
config: Config,
cache: ViewCache,
// context: Option<ContextDrawer>,
// context: Option<ContextDrawer>,
display_arrangement_scrollable: cosmic::widget::Id,
}
@ -126,7 +126,7 @@ impl Default for Page {
background_service: None,
config: Config::default(),
cache: ViewCache::default(),
// context: None,
// context: None,
display_arrangement_scrollable: cosmic::widget::Id::unique(),
}
}
@ -135,7 +135,7 @@ impl Default for Page {
#[derive(Default)]
struct Config {
/// Whether night light is enabled.
// night_light_enabled: bool,
// night_light_enabled: bool,
refresh_rate: Option<u32>,
resolution: Option<(u32, u32)>,
scale: u32,
@ -163,15 +163,15 @@ impl page::Page<crate::pages::Message> for Page {
) -> Option<page::Content> {
Some(vec![
// Night light
// sections.insert(
// Section::default()
// .descriptions(vec![
// text::NIGHT_LIGHT.as_str().into(),
// text::NIGHT_LIGHT_AUTO.as_str().into(),
// text::NIGHT_LIGHT_DESCRIPTION.as_str().into(),
// ])
// .view::<Page>(|_binder, page, _section| page.night_light_view()),
// ),
// sections.insert(
// Section::default()
// .descriptions(vec![
// text::NIGHT_LIGHT.as_str().into(),
// text::NIGHT_LIGHT_AUTO.as_str().into(),
// text::NIGHT_LIGHT_DESCRIPTION.as_str().into(),
// ])
// .view::<Page>(|_binder, page, _section| page.night_light_view()),
// ),
// Display arrangement
sections.insert(
Section::default()
@ -297,15 +297,15 @@ impl page::Page<crate::pages::Message> for Page {
})
})
}
// fn context_drawer(&self) -> Option<Element<pages::Message>> {
// Some(match self.context {
// Some(ContextDrawer::NightLight) => self.night_light_context_view(),
// fn context_drawer(&self) -> Option<Element<pages::Message>> {
// Some(match self.context {
// None => return None,
// })
// }
// Some(ContextDrawer::NightLight) => self.night_light_context_view(),
// None => return None,
// })
// }
}
impl Page {
@ -331,16 +331,15 @@ impl Page {
Mirroring::Project(target_display) => (),
Mirroring::ProjectToAll => (),
},
// Message::NightLight(night_light) => {}
//
// Message::NightLightContext => {
// self.context = Some(ContextDrawer::NightLight);
// return cosmic::command::message(app::Message::OpenContextDrawer(
// text::NIGHT_LIGHT.clone().into(),
// ));
// }
// Message::NightLight(night_light) => {}
//
// Message::NightLightContext => {
// self.context = Some(ContextDrawer::NightLight);
// return cosmic::command::message(app::Message::OpenContextDrawer(
// text::NIGHT_LIGHT.clone().into(),
// ));
// }
Message::Orientation(orientation) => return self.set_orientation(orientation),
Message::Position(display, x, y) => return self.set_position(display, x, y),
@ -484,11 +483,11 @@ impl Page {
.apply(Element::from)
.map(pages::Message::Displays)
}
/// Displays the night light context drawer.
// pub fn night_light_context_view(&self) -> Element<pages::Message> {
// column().into()
// }
// pub fn night_light_context_view(&self) -> Element<pages::Message> {
// column().into()
// }
/// Reloads the display list, and all information relevant to the active display.
pub fn update_displays(&mut self, list: List) {