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