Add abouts page, improve settings list padding
This commit is contained in:
parent
343a855816
commit
e21f1ec7b8
3 changed files with 36 additions and 4 deletions
|
|
@ -329,7 +329,7 @@ impl Page {
|
||||||
impl Default for Page {
|
impl Default for Page {
|
||||||
fn default() -> Page {
|
fn default() -> Page {
|
||||||
//TODO: what should the default page be?
|
//TODO: what should the default page be?
|
||||||
Page::Desktop(None)
|
Page::SystemAndAccounts(Some(SystemAndAccountsPage::About))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -561,6 +561,37 @@ impl Window {
|
||||||
.into(),
|
.into(),
|
||||||
]).into()
|
]).into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn view_system_and_accounts_about(&self) -> Element<Message> {
|
||||||
|
settings::view_column(vec![
|
||||||
|
self.parent_page_button(SystemAndAccountsPage::About),
|
||||||
|
|
||||||
|
row!(
|
||||||
|
horizontal_space(Length::Fill),
|
||||||
|
icon("distributor-logo", 78),
|
||||||
|
horizontal_space(Length::Fill),
|
||||||
|
).into(),
|
||||||
|
|
||||||
|
settings::view_section("Hardware")
|
||||||
|
.add(settings::item("Hardware model", text("TODO")))
|
||||||
|
.add(settings::item("Memory", text("TODO")))
|
||||||
|
.add(settings::item("Processor", text("TODO")))
|
||||||
|
.add(settings::item("Graphics", text("TODO")))
|
||||||
|
.add(settings::item("Disk Capacity", text("TODO")))
|
||||||
|
.into(),
|
||||||
|
|
||||||
|
settings::view_section("Operating System")
|
||||||
|
.add(settings::item("Operating system", text("TODO")))
|
||||||
|
.add(settings::item("Operating system architecture", text("TODO")))
|
||||||
|
.add(settings::item("Desktop environment", text("TODO")))
|
||||||
|
.add(settings::item("Windowing system", text("TODO")))
|
||||||
|
.into(),
|
||||||
|
|
||||||
|
settings::view_section("Related settings")
|
||||||
|
.add(settings::item("Get support", text("TODO")))
|
||||||
|
.into(),
|
||||||
|
]).into()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Application for Window {
|
impl Application for Window {
|
||||||
|
|
@ -739,6 +770,7 @@ impl Application for Window {
|
||||||
self.sub_page_button(SystemAndAccountsPage::Firmware),
|
self.sub_page_button(SystemAndAccountsPage::Firmware),
|
||||||
).spacing(16).into()
|
).spacing(16).into()
|
||||||
]).into(),
|
]).into(),
|
||||||
|
Page::SystemAndAccounts(Some(SystemAndAccountsPage::About)) => self.view_system_and_accounts_about(),
|
||||||
Page::SystemAndAccounts(Some(sub_page)) => self.view_unimplemented_sub_page(sub_page),
|
Page::SystemAndAccounts(Some(sub_page)) => self.view_unimplemented_sub_page(sub_page),
|
||||||
Page::TimeAndLanguage(None) => settings::view_column(vec![
|
Page::TimeAndLanguage(None) => settings::view_column(vec![
|
||||||
self.page_title(self.page),
|
self.page_title(self.page),
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ impl<'a, Message: 'static> ListColumn<'a, Message> {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn add(mut self, item: impl Into<Element<'a, Message>>) -> Self {
|
pub fn add(mut self, item: impl Into<Element<'a, Message>>) -> Self {
|
||||||
if !self.children.is_empty() {
|
if !self.children.is_empty() {
|
||||||
self.children.push(horizontal_rule(12).into());
|
self.children.push(horizontal_rule(10).into());
|
||||||
}
|
}
|
||||||
|
|
||||||
self.children.push(item.into());
|
self.children.push(item.into());
|
||||||
|
|
@ -41,7 +41,7 @@ impl<'a, Message: 'static> ListColumn<'a, Message> {
|
||||||
iced::widget::column(self.children)
|
iced::widget::column(self.children)
|
||||||
.spacing(12)
|
.spacing(12)
|
||||||
.apply(iced::widget::container)
|
.apply(iced::widget::container)
|
||||||
.padding([12, 16])
|
.padding([16, 6])
|
||||||
.style(theme::Container::Custom(style))
|
.style(theme::Container::Custom(style))
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,6 @@ pub fn item<'a, Message: 'static>(
|
||||||
pub fn item_row<Message>(children: Vec<Element<Message>>) -> iced::widget::Row<Message, Renderer> {
|
pub fn item_row<Message>(children: Vec<Element<Message>>) -> iced::widget::Row<Message, Renderer> {
|
||||||
iced::widget::row(children)
|
iced::widget::row(children)
|
||||||
.align_items(iced::Alignment::Center)
|
.align_items(iced::Alignment::Center)
|
||||||
.padding([0, 8])
|
.padding([0, 18])
|
||||||
.spacing(12)
|
.spacing(12)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue