feat: refactor the settings page architecture

This commit is contained in:
Michael Aaron Murphy 2023-04-25 00:30:50 +02:00
parent efdd934e62
commit c015ad9948
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
55 changed files with 2212 additions and 1635 deletions

View file

@ -0,0 +1,26 @@
// Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only
use cosmic_settings_page::Section;
use cosmic_settings_page::{self as page, section};
use slotmap::SlotMap;
#[derive(Default)]
pub struct Page;
impl page::Page<crate::pages::Message> for Page {
fn content(
&self,
sections: &mut SlotMap<section::Entity, Section<crate::pages::Message>>,
) -> Option<page::Content> {
Some(vec![sections.insert(Section::default())])
}
fn info(&self) -> page::Info {
page::Info::new("firmware", "firmware-manager-symbolic")
.title(fl!("firmware"))
.description(fl!("firmware", "desc"))
}
}
impl page::AutoBind<crate::pages::Message> for Page {}