Add theme and theme_changes functions to system
This commit is contained in:
parent
9518573fce
commit
09c604c92d
24 changed files with 186 additions and 102 deletions
|
|
@ -37,7 +37,7 @@ impl Events {
|
|||
}
|
||||
Message::EventOccurred(event) => {
|
||||
if let Event::Window(window::Event::CloseRequested) = event {
|
||||
window::get_latest().and_then(window::close)
|
||||
window::latest().and_then(window::close)
|
||||
} else {
|
||||
Task::none()
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ impl Events {
|
|||
|
||||
Task::none()
|
||||
}
|
||||
Message::Exit => window::get_latest().and_then(window::close),
|
||||
Message::Exit => window::latest().and_then(window::close),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ enum Message {
|
|||
impl Exit {
|
||||
fn update(&mut self, message: Message) -> Task<Message> {
|
||||
match message {
|
||||
Message::Confirm => window::get_latest().and_then(window::close),
|
||||
Message::Confirm => window::latest().and_then(window::close),
|
||||
Message::Exit => {
|
||||
self.show_confirm = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ impl Example {
|
|||
return Task::none();
|
||||
};
|
||||
|
||||
window::get_position(*last_window)
|
||||
window::position(*last_window)
|
||||
.then(|last_position| {
|
||||
let position = last_position.map_or(
|
||||
window::Position::Default,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ impl Example {
|
|||
fn update(&mut self, message: Message) -> Task<Message> {
|
||||
match message {
|
||||
Message::Screenshot => {
|
||||
return window::get_latest()
|
||||
return window::latest()
|
||||
.and_then(window::screenshot)
|
||||
.map(Message::Screenshotted);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
iced.workspace = true
|
||||
iced.features = ["system"]
|
||||
iced.features = ["sysinfo"]
|
||||
|
||||
bytesize = "1.1"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use iced::system;
|
||||
use iced::widget::{button, center, column, text};
|
||||
use iced::{Element, Task, system};
|
||||
use iced::{Element, Task};
|
||||
|
||||
pub fn main() -> iced::Result {
|
||||
iced::application(Example::new, Example::update, Example::view).run()
|
||||
|
|
@ -26,7 +27,7 @@ impl Example {
|
|||
fn new() -> (Self, Task<Message>) {
|
||||
(
|
||||
Self::Loading,
|
||||
system::fetch_information().map(Message::InformationReceived),
|
||||
system::information().map(Message::InformationReceived),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ impl Todos {
|
|||
widget::focus_next()
|
||||
}
|
||||
}
|
||||
Message::ToggleFullscreen(mode) => window::get_latest()
|
||||
Message::ToggleFullscreen(mode) => window::latest()
|
||||
.and_then(move |window| window::set_mode(window, mode)),
|
||||
Message::Loaded(_) => Command::none(),
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue