wip: update libcosmic (#93)

* wip: update libcosmic

* fix: damge issue resolved by updating iced

* fix: high cpu usage by time applet and app-list

* refactor subscriptions to produce fewer events

* refactor network applet to use less cpu

* fix: text size

* refactor: i18n for audio applet

* refactor: power applet i18n setup

* fix (battery): always send profile update

* fix (battery): set toggler width to layout correctly

* fix (app-list): backoff for restarts of toplevel subscription

* fix (network): alignment

* feat: ask for comfirmation before applying power applet actions

* wip: integrate cosmic-config

* update zbus

* feat: update to use latest libcosmic

* update iced

* udpate deps

* update deps

* refactor: move applet helpers to this repo, outside of libcosmic.

this should help alleviate some dependency hell

* chore update deps

* update deps

* cleanup
This commit is contained in:
Ashley Wulber 2023-06-01 12:23:12 -04:00 committed by GitHub
parent 8b46cc209f
commit 9ebd9b511a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
48 changed files with 2841 additions and 1681 deletions

View file

@ -6,4 +6,5 @@ license = "GPL-3.0-or-later"
[dependencies]
freedesktop-desktop-entry = "0.5.0"
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["tokio", "wayland", "applet"] }
libcosmic = { git = "https://github.com/pop-os/libcosmic/", rev = "31f7e97", default-features = false, features = ["tokio", "wayland"] }
cosmic-applet = { path = "../applet" }

View file

@ -1,14 +1,10 @@
use cosmic::{
applet::CosmicAppletHelper,
iced::{
self,
wayland::InitialSurface,
Application,
},
iced_sctk::layout::Limits,
iced::Limits,
iced::{self, wayland::InitialSurface, Application},
iced_runtime::core::window,
iced_style::application,
iced_native::window,
};
use cosmic_applet::CosmicAppletHelper;
use freedesktop_desktop_entry::DesktopEntry;
use std::{env, fs, process::Command};
@ -47,10 +43,12 @@ impl iced::Application for Button {
}
fn style(&self) -> <Self::Theme as application::StyleSheet>::Style {
<Self::Theme as application::StyleSheet>::Style::Custom(|theme| application::Appearance {
background_color: iced::Color::from_rgba(0.0, 0.0, 0.0, 0.0),
text_color: theme.cosmic().on_bg_color().into(),
})
<Self::Theme as application::StyleSheet>::Style::Custom(Box::new(|theme| {
application::Appearance {
background_color: iced::Color::from_rgba(0.0, 0.0, 0.0, 0.0),
text_color: theme.cosmic().on_bg_color().into(),
}
}))
}
fn subscription(&self) -> iced::Subscription<Msg> {
@ -112,10 +110,8 @@ pub fn main() -> iced::Result {
};
match &mut settings.initial_surface {
InitialSurface::XdgWindow(s) => {
s.iced_settings.min_size = Some((1, 1));
s.iced_settings.max_size = None;
s.autosize = true;
s.size_limits = Limits::NONE.min_height(1).min_width(1);
s.size_limits = Limits::NONE.min_height(1.0).min_width(1.0);
}
_ => unreachable!(),
};