chore: move displays page to the top level

This commit is contained in:
Michael Aaron Murphy 2024-02-13 23:09:32 +01:00 committed by Michael Murphy
parent 87371069f7
commit b66e048ecf
8 changed files with 10 additions and 10 deletions

View file

@ -13,7 +13,7 @@ use crate::pages::desktop::{
},
};
use crate::pages::input::{self, keyboard};
use crate::pages::{sound, system, time};
use crate::pages::{display, sound, system, time};
use crate::subscription::desktop_files;
use crate::widget::{page_title, search_header};
use crate::PageCommands;
@ -111,10 +111,11 @@ impl cosmic::Application for SettingsApp {
};
let desktop_id = app.insert_page::<desktop::Page>().id();
app.insert_page::<input::Page>();
app.insert_page::<display::Page>();
app.insert_page::<sound::Page>();
app.insert_page::<system::Page>();
app.insert_page::<time::Page>();
app.insert_page::<input::Page>();
let active_id = match flags.subcommand {
Some(p) => app.subcommand_to_page(&p),
@ -283,7 +284,7 @@ impl cosmic::Application for SettingsApp {
}
crate::pages::Message::Displays(message) => {
if let Some(page) = self.pages.page_mut::<desktop::display::Page>() {
if let Some(page) = self.pages.page_mut::<display::Page>() {
return page.update(message).map(cosmic::app::Message::App);
}
}

View file

@ -2,7 +2,6 @@
// SPDX-License-Identifier: GPL-3.0-only
pub mod appearance;
pub mod display;
pub mod dock;
pub mod notifications;
pub mod options;
@ -27,8 +26,7 @@ impl page::Page<crate::pages::Message> for Page {
impl page::AutoBind<crate::pages::Message> for Page {
fn sub_pages(page: page::Insert<crate::pages::Message>) -> page::Insert<crate::pages::Message> {
page.sub_page::<display::Page>()
.sub_page::<options::Page>()
page.sub_page::<options::Page>()
.sub_page::<wallpaper::Page>()
.sub_page::<appearance::Page>()
.sub_page::<workspaces::Page>()

View file

@ -207,9 +207,9 @@ impl Page {
impl page::Page<crate::pages::Message> for Page {
fn info(&self) -> page::Info {
// XXX icon?
page::Info::new("input", "input-keyboard-symbolic")
.title(fl!("input"))
.description(fl!("input", "desc"))
page::Info::new("input-devices", "input-keyboard-symbolic")
.title(fl!("input-devices"))
.description(fl!("input-devices", "desc"))
}
}

View file

@ -4,6 +4,7 @@
use cosmic_settings_page::Entity;
pub mod desktop;
pub mod display;
pub mod input;
pub mod networking;
pub mod sound;
@ -18,7 +19,7 @@ pub enum Message {
Desktop(desktop::Message),
DesktopWallpaper(desktop::wallpaper::Message),
DesktopWorkspaces(desktop::workspaces::Message),
Displays(desktop::display::Message),
Displays(display::Message),
Dock(desktop::dock::Message),
DockApplet(desktop::dock::applets::Message),
External { id: String, message: Vec<u8> },