Refactor pages into separate files
This commit is contained in:
parent
e4af157406
commit
3f113016c5
8 changed files with 464 additions and 406 deletions
43
examples/cosmic/src/window/networking.rs
Normal file
43
examples/cosmic/src/window/networking.rs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
use super::{Page, SubPage};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum NetworkingPage {
|
||||
Wired,
|
||||
OnlineAccounts,
|
||||
}
|
||||
|
||||
impl SubPage for NetworkingPage {
|
||||
//TODO: translate
|
||||
fn title(&self) -> &'static str {
|
||||
use NetworkingPage::*;
|
||||
match self {
|
||||
Wired => "Wired",
|
||||
OnlineAccounts => "Online Accounts",
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: translate
|
||||
fn description(&self) -> &'static str {
|
||||
use NetworkingPage::*;
|
||||
match self {
|
||||
Wired => "Wired connection, connection profiles",
|
||||
OnlineAccounts => "Add accounts, IMAP and SMTP, enterprise logins",
|
||||
}
|
||||
}
|
||||
|
||||
fn icon_name(&self) -> &'static str {
|
||||
use NetworkingPage::*;
|
||||
match self {
|
||||
Wired => "network-workgroup-symbolic",
|
||||
OnlineAccounts => "goa-panel-symbolic", //TODO: new icon
|
||||
}
|
||||
}
|
||||
|
||||
fn parent_page(&self) -> Page {
|
||||
Page::Networking(None)
|
||||
}
|
||||
|
||||
fn into_page(self) -> Page {
|
||||
Page::Networking(Some(self))
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue