diff --git a/Cargo.lock b/Cargo.lock index 0ca87a70..23731a23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -904,43 +904,20 @@ dependencies = [ "wayland-client 0.30.2", ] -[[package]] -name = "cosmic-config" -version = "0.1.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" -dependencies = [ - "atomicwrites", - "cosmic-config-derive 0.1.0 (git+https://github.com/edfloreshz/libcosmic)", - "dirs 5.0.1", - "iced_futures 0.7.0 (git+https://github.com/edfloreshz/libcosmic)", - "notify", - "ron", - "serde", -] - [[package]] name = "cosmic-config" version = "0.1.0" source = "git+https://github.com/pop-os/libcosmic#b404497e7636d44ba0fffa9b88e26f5b76d2b789" dependencies = [ "atomicwrites", - "cosmic-config-derive 0.1.0 (git+https://github.com/pop-os/libcosmic)", + "cosmic-config-derive", "dirs 5.0.1", - "iced_futures 0.7.0 (git+https://github.com/pop-os/libcosmic)", + "iced_futures", "notify", "ron", "serde", ] -[[package]] -name = "cosmic-config-derive" -version = "0.1.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "cosmic-config-derive" version = "0.1.0" @@ -966,16 +943,16 @@ dependencies = [ [[package]] name = "cosmic-notifications-config" version = "0.1.0" -source = "git+https://github.com/edfloreshz/cosmic-notifications#58e948e6260d2088a7da9128173c76b9cb6db7f3" +source = "git+https://github.com/pop-os/cosmic-notifications#e42d4a0e3ef00dbe2d1478d7563cbe326f6b8311" dependencies = [ - "cosmic-config 0.1.0 (git+https://github.com/edfloreshz/libcosmic)", + "cosmic-config", "serde", ] [[package]] name = "cosmic-notifications-util" version = "0.1.0" -source = "git+https://github.com/edfloreshz/cosmic-notifications#58e948e6260d2088a7da9128173c76b9cb6db7f3" +source = "git+https://github.com/pop-os/cosmic-notifications#e42d4a0e3ef00dbe2d1478d7563cbe326f6b8311" dependencies = [ "bytemuck", "fast_image_resize", @@ -999,7 +976,7 @@ version = "0.1.0" source = "git+https://github.com/pop-os/cosmic-panel#7b56316ddcdd3e921b61cf3fe3f69b4bcae437d3" dependencies = [ "anyhow", - "cosmic-config 0.1.0 (git+https://github.com/pop-os/libcosmic)", + "cosmic-config", "ron", "serde", "tracing", @@ -1043,10 +1020,10 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "almost", - "cosmic-config 0.1.0 (git+https://github.com/edfloreshz/libcosmic)", + "cosmic-config", "csscolorparser", "lazy_static", "palette", @@ -1057,7 +1034,7 @@ dependencies = [ [[package]] name = "cosmic-time" version = "0.3.0" -source = "git+https://github.com/edfloreshz/cosmic-time#dfe7211c5c402685cc361b17a148574f37d86df2" +source = "git+https://github.com/pop-os/cosmic-time#71116b2eefb536bedbd3438e70cba49d54c3a5d5" dependencies = [ "float-cmp", "libcosmic", @@ -2383,11 +2360,11 @@ dependencies = [ [[package]] name = "iced" version = "0.10.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "iced_accessibility", - "iced_core 0.10.0 (git+https://github.com/edfloreshz/libcosmic)", - "iced_futures 0.7.0 (git+https://github.com/edfloreshz/libcosmic)", + "iced_core", + "iced_futures", "iced_renderer", "iced_sctk", "iced_widget", @@ -2398,7 +2375,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "accesskit", "accesskit_unix", @@ -2407,7 +2384,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.10.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#b404497e7636d44ba0fffa9b88e26f5b76d2b789" dependencies = [ "bitflags 1.3.2", "iced_accessibility", @@ -2419,53 +2396,29 @@ dependencies = [ "twox-hash", ] -[[package]] -name = "iced_core" -version = "0.10.0" -source = "git+https://github.com/pop-os/libcosmic#b404497e7636d44ba0fffa9b88e26f5b76d2b789" -dependencies = [ - "bitflags 1.3.2", - "instant", - "log", - "thiserror", - "twox-hash", -] - [[package]] name = "iced_futures" version = "0.7.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#b404497e7636d44ba0fffa9b88e26f5b76d2b789" dependencies = [ "futures", - "iced_core 0.10.0 (git+https://github.com/edfloreshz/libcosmic)", + "iced_core", "log", "tokio", "wasm-bindgen-futures", "wasm-timer", ] -[[package]] -name = "iced_futures" -version = "0.7.0" -source = "git+https://github.com/pop-os/libcosmic#b404497e7636d44ba0fffa9b88e26f5b76d2b789" -dependencies = [ - "futures", - "iced_core 0.10.0 (git+https://github.com/pop-os/libcosmic)", - "log", - "wasm-bindgen-futures", - "wasm-timer", -] - [[package]] name = "iced_graphics" version = "0.9.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "bitflags 1.3.2", "bytemuck", "glam", "half", - "iced_core 0.10.0 (git+https://github.com/edfloreshz/libcosmic)", + "iced_core", "image", "kamadak-exif", "log", @@ -2476,7 +2429,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.1.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2489,11 +2442,11 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.1.1" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "iced_accessibility", - "iced_core 0.10.0 (git+https://github.com/edfloreshz/libcosmic)", - "iced_futures 0.7.0 (git+https://github.com/edfloreshz/libcosmic)", + "iced_core", + "iced_futures", "smithay-client-toolkit 0.17.0", "thiserror", ] @@ -2501,12 +2454,12 @@ dependencies = [ [[package]] name = "iced_sctk" version = "0.1.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "enum-repr", "float-cmp", "futures", - "iced_futures 0.7.0 (git+https://github.com/edfloreshz/libcosmic)", + "iced_futures", "iced_graphics", "iced_runtime", "iced_style", @@ -2523,9 +2476,9 @@ dependencies = [ [[package]] name = "iced_style" version = "0.9.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ - "iced_core 0.10.0 (git+https://github.com/edfloreshz/libcosmic)", + "iced_core", "once_cell", "palette", ] @@ -2533,7 +2486,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.1.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "bytemuck", "cosmic-text", @@ -2551,7 +2504,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.11.1" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "bitflags 1.3.2", "bytemuck", @@ -2572,7 +2525,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.1.3" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "iced_renderer", "iced_runtime", @@ -2838,19 +2791,19 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/edfloreshz/libcosmic#5167c6ba4b155d8110415e1bb53247f1445a95ae" +source = "git+https://github.com/pop-os/libcosmic#453cc6588e6d849318e704e4626913dc8894e243" dependencies = [ "apply", "ashpd", - "cosmic-config 0.1.0 (git+https://github.com/edfloreshz/libcosmic)", + "cosmic-config", "cosmic-panel-config", "cosmic-theme", "derive_setters", "fraction", "freedesktop-icons", "iced", - "iced_core 0.10.0 (git+https://github.com/edfloreshz/libcosmic)", - "iced_futures 0.7.0 (git+https://github.com/edfloreshz/libcosmic)", + "iced_core", + "iced_futures", "iced_renderer", "iced_runtime", "iced_sctk", diff --git a/Cargo.toml b/Cargo.toml index a12cbe57..a6c28ebd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,11 +23,11 @@ cctk = { git = "https://github.com/pop-os/cosmic-protocols", package = "cosmic-c cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false, features = [ "client", ], rev = "e39748e" } -cosmic-time = { git = "https://github.com/edfloreshz/cosmic-time", default-features = false, features = [ +cosmic-time = { git = "https://github.com/pop-os/cosmic-time", default-features = false, features = [ "libcosmic", "once_cell", ] } -libcosmic = { git = "https://github.com/edfloreshz/libcosmic", default-features = false, features = [ +libcosmic = { git = "https://github.com/pop-os/libcosmic", default-features = false, features = [ "applet", "tokio", "wayland", diff --git a/cosmic-app-list/src/app.rs b/cosmic-app-list/src/app.rs index 4bee290e..3b308b29 100755 --- a/cosmic-app-list/src/app.rs +++ b/cosmic-app-list/src/app.rs @@ -9,10 +9,6 @@ use cctk::sctk::reexports::calloop::channel::Sender; use cctk::toplevel_info::ToplevelInfo; use cctk::wayland_client::protocol::wl_data_device_manager::DndAction; use cctk::wayland_client::protocol::wl_seat::WlSeat; -use cosmic::app::{ - applet::{cosmic_panel_config::PanelAnchor, CosmicAppletHelper}, - Command, -}; use cosmic::cosmic_config; use cosmic::cosmic_config::Config; use cosmic::iced; @@ -40,6 +36,10 @@ use cosmic::widget::divider; use cosmic::widget::rectangle_tracker::rectangle_tracker_subscription; use cosmic::widget::rectangle_tracker::RectangleTracker; use cosmic::widget::rectangle_tracker::RectangleUpdate; +use cosmic::{ + applet::{cosmic_panel_config::PanelAnchor, Context}, + Command, +}; use cosmic::{Element, Theme}; use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1; use freedesktop_desktop_entry::DesktopEntry; @@ -61,7 +61,7 @@ use url::Url; static MIME_TYPE: &str = "text/uri-list"; pub fn run() -> cosmic::iced::Result { - cosmic::app::applet::run::(true, ()) + cosmic::applet::run::(true, ()) } #[derive(Debug, Clone, Default)] @@ -102,7 +102,7 @@ impl DockItem { fn as_icon( &self, - applet_helper: &CosmicAppletHelper, + applet: &Context, rectangle_tracker: Option<&RectangleTracker>, interaction_enabled: bool, ) -> Element<'_, Message> { @@ -115,7 +115,7 @@ impl DockItem { let cosmic_icon = cosmic::widget::icon::from_path(PathBuf::from(&desktop_info.icon)) .icon() - .size(applet_helper.suggested_size().0); + .size(applet.suggested_size().0); let dot_radius = 2; let dots = (0..toplevels.len()) @@ -138,7 +138,7 @@ impl DockItem { .into() }) .collect_vec(); - let icon_wrapper: Element<_> = match applet_helper.anchor { + let icon_wrapper: Element<_> = match applet.anchor { PanelAnchor::Left => row(vec![column(dots).spacing(4).into(), cosmic_icon.into()]) .align_items(iced::Alignment::Center) .spacing(4) @@ -373,7 +373,10 @@ impl cosmic::Application for CosmicAppList { type Flags = (); const APP_ID: &'static str = config::APP_ID; - fn init(core: cosmic::app::Core, _flags: ()) -> (Self, Command) { + fn init( + core: cosmic::app::Core, + _flags: Self::Flags, + ) -> (Self, iced::Command>) { let config = config::AppListConfig::load().unwrap_or_default(); let mut self_ = CosmicAppList { core, @@ -402,7 +405,10 @@ impl cosmic::Application for CosmicAppList { &mut self.core } - fn update(&mut self, message: Message) -> Command { + fn update( + &mut self, + message: Self::Message, + ) -> iced::Command> { match message { Message::Popup(id) => { if let Some((popup_id, _toplevel)) = self.popup.take() { @@ -423,7 +429,7 @@ impl cosmic::Application for CosmicAppList { let new_id = window::Id(self.surface_id_ctr); self.popup = Some((new_id, toplevel_group.clone())); - let mut popup_settings = self.core.applet_helper.get_popup_settings( + let mut popup_settings = self.core.applet.get_popup_settings( window::Id(0), new_id, None, @@ -564,8 +570,8 @@ impl cosmic::Application for CosmicAppList { } } Message::DndEnter(x, y) => { - let item_size = self.core.applet_helper.suggested_size().0; - let pos_in_list = match self.core.applet_helper.anchor { + let item_size = self.core.applet.suggested_size().0; + let pos_in_list = match self.core.applet.anchor { PanelAnchor::Top | PanelAnchor::Bottom => x, PanelAnchor::Left | PanelAnchor::Right => y, }; @@ -595,8 +601,8 @@ impl cosmic::Application for CosmicAppList { } Message::DndMotion(x, y) => { if let Some(DndOffer { preview_index, .. }) = self.dnd_offer.as_mut() { - let item_size = self.core.applet_helper.suggested_size().0; - let pos_in_list = match self.core.applet_helper.anchor { + let item_size = self.core.applet.suggested_size().0; + let pos_in_list = match self.core.applet.anchor { PanelAnchor::Top | PanelAnchor::Bottom => x, PanelAnchor::Left | PanelAnchor::Right => y, }; @@ -853,7 +859,7 @@ impl cosmic::Application for CosmicAppList { } fn view(&self) -> Element { - let is_horizontal = match self.core.applet_helper.anchor { + let is_horizontal = match self.core.applet.anchor { PanelAnchor::Top | PanelAnchor::Bottom => true, PanelAnchor::Left | PanelAnchor::Right => false, }; @@ -862,7 +868,7 @@ impl cosmic::Application for CosmicAppList { .iter() .map(|dock_item| { dock_item.as_icon( - &self.core.applet_helper, + &self.core.applet, self.rectangle_tracker.as_ref(), self.popup.is_none(), ) @@ -874,13 +880,13 @@ impl cosmic::Application for CosmicAppList { .as_ref() .and_then(|o| o.dock_item.as_ref().map(|item| (item, o.preview_index))) { - favorites.insert(index, item.as_icon(&self.core.applet_helper, None, false)); + favorites.insert(index, item.as_icon(&self.core.applet, None, false)); } else if self.is_listening_for_dnd && self.favorite_list.is_empty() { // show star indicating favorite_list is drag target favorites.push( container( cosmic::widget::icon::from_name("starred-symbolic.symbolic") - .size(self.core.applet_helper.suggested_size().0), + .size(self.core.applet.suggested_size().0), ) .padding(8) .into(), @@ -892,7 +898,7 @@ impl cosmic::Application for CosmicAppList { .iter() .map(|dock_item| { dock_item.as_icon( - &self.core.applet_helper, + &self.core.applet, self.rectangle_tracker.as_ref(), self.popup.is_none(), ) @@ -906,7 +912,7 @@ impl cosmic::Application for CosmicAppList { dnd_listener(row(favorites)), row(active).into(), container(vertical_rule(1)) - .height(self.core.applet_helper.suggested_size().1) + .height(self.core.applet.suggested_size().1) .into(), ) } else { @@ -916,7 +922,7 @@ impl cosmic::Application for CosmicAppList { dnd_listener(column(favorites)), column(active).into(), container(divider::horizontal::light()) - .width(self.core.applet_helper.suggested_size().1) + .width(self.core.applet.suggested_size().1) .into(), ) }; @@ -963,12 +969,12 @@ impl cosmic::Application for CosmicAppList { } else { vec![ cosmic::widget::icon::from_name("com.system76.CosmicAppList") - .size(self.core.applet_helper.suggested_size().0) + .size(self.core.applet.suggested_size().0) .into(), ] }; - let content = match &self.core.applet_helper.anchor { + let content = match &self.core.applet.anchor { PanelAnchor::Left | PanelAnchor::Right => container( Column::with_children(content_list) .spacing(4) @@ -998,7 +1004,7 @@ impl cosmic::Application for CosmicAppList { if let Some((_, item, _)) = self.dnd_source.as_ref().filter(|s| s.0 == id) { cosmic::widget::icon::from_path(PathBuf::from(&item.desktop_info.icon)) .icon() - .size(self.core.applet_helper.suggested_size().0) + .size(self.core.applet.suggested_size().0) .into() } else if let Some(( _popup_id, @@ -1065,7 +1071,7 @@ impl cosmic::Application for CosmicAppList { .on_press(Message::Quit(desktop_info.id.clone())), ), }; - self.core.applet_helper.popup_container(content).into() + self.core.applet.popup_container(content).into() } else { iced::widget::text("").into() } @@ -1124,7 +1130,7 @@ impl cosmic::Application for CosmicAppList { } fn style(&self) -> Option<::Style> { - Some(cosmic::app::applet::style()) + Some(cosmic::applet::style()) } fn on_close_requested(&self, id: window::Id) -> Option { diff --git a/cosmic-applet-audio/src/main.rs b/cosmic-applet-audio/src/main.rs index 91f40d16..4aae0d66 100644 --- a/cosmic-applet-audio/src/main.rs +++ b/cosmic-applet-audio/src/main.rs @@ -5,7 +5,7 @@ use cosmic::iced::widget; use cosmic::iced::Limits; use cosmic::iced_runtime::core::alignment::Horizontal; -use cosmic::app::applet::applet_button_theme; +use cosmic::applet::button_theme; use cosmic::widget::{button, divider, icon}; use cosmic::Renderer; @@ -32,7 +32,7 @@ pub fn main() -> cosmic::iced::Result { // Prepare i18n localize(); - cosmic::app::applet::run::