feat!: implement Application API

This commit is contained in:
Michael Murphy 2023-08-02 11:54:07 +02:00 committed by GitHub
parent e24465ba37
commit a223b60a0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1420 additions and 138 deletions

View file

@ -1,7 +1,7 @@
// Copyright 2022 System76 <info@system76.com>
// SPDX-License-Identifier: MPL-2.0
use cosmic::{iced::Application, settings};
use cosmic::iced::{Application, Settings};
mod window;
use env_logger::Env;
@ -13,8 +13,8 @@ pub fn main() -> cosmic::iced::Result {
.write_style_or("MY_LOG_STYLE", "always");
env_logger::init_from_env(env);
settings::set_default_icon_theme("Pop");
let mut settings = settings();
cosmic::icon_theme::set_default("Pop");
let mut settings = Settings::default();
settings.window.min_size = Some((600, 300));
Window::run(settings)
}

View file

@ -483,9 +483,8 @@ impl Application for Window {
.on_drag(Message::Drag)
.start(
nav_bar_toggle()
.on_nav_bar_toggled(nav_bar_message)
.nav_bar_active(nav_bar_toggled)
.into(),
.on_toggle(nav_bar_message)
.active(nav_bar_toggled),
);
if self.show_maximize {

View file

@ -184,7 +184,7 @@ impl State {
Message::IconTheme(key) => {
self.icon_themes.activate(key);
if let Some(theme) = self.icon_themes.text(key) {
cosmic::settings::set_default_icon_theme(theme);
cosmic::icon_theme::set_default(theme);
}
}
Message::InputChanged(s) => {