diff --git a/Cargo.toml b/Cargo.toml index 59a40427..e5814dce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,13 +75,13 @@ opt-level = 1 [workspace.metadata.cargo-machete] ignored = ["libcosmic"] [patch."https://github.com/pop-os/libcosmic"] -# cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "drop-menu-tree-changes" } -# libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "drop-menu-tree-changes" } -# iced_futures = { git = "https://github.com/pop-os/libcosmic//", branch = "drop-menu-tree-changes" } +cosmic-config = { git = "https://github.com/pop-os/libcosmic//", branch = "drop-menu-tree-changes" } +libcosmic = { git = "https://github.com/pop-os/libcosmic//", branch = "drop-menu-tree-changes" } +iced_futures = { git = "https://github.com/pop-os/libcosmic//", branch = "drop-menu-tree-changes" } -cosmic-config = { path = "../libcosmic/cosmic-config" } -libcosmic = { path = "../libcosmic" } -iced_futures = { path = "../libcosmic/iced/futures" } +# cosmic-config = { path = "../libcosmic/cosmic-config" } +# libcosmic = { path = "../libcosmic" } +# iced_futures = { path = "../libcosmic/iced/futures" } # [patch."https://github.com/pop-os/winit.git"] # winit = { git = "https://github.com/rust-windowing/winit.git", rev = "241b7a80bba96c91fa3901729cd5dec66abb9be4" } diff --git a/cosmic-applet-status-area/src/components/app.rs b/cosmic-applet-status-area/src/components/app.rs index 76a58cca..0be56952 100644 --- a/cosmic-applet-status-area/src/components/app.rs +++ b/cosmic-applet-status-area/src/components/app.rs @@ -7,10 +7,10 @@ use cosmic::{ iced::{ self, platform_specific::shell::commands::popup::{destroy_popup, get_popup}, - window, Limits, Subscription, + window, Limits, Padding, Subscription, }, surface_message::{MessageWrapper, SurfaceMessage}, - widget::mouse_area, + widget::{container, mouse_area}, Element, Task, }; use std::collections::BTreeMap; @@ -290,12 +290,19 @@ impl cosmic::Application for App { } fn view_window(&self, _surface: window::Id) -> cosmic::Element<'_, Msg> { + let theme = self.core.system_theme(); + let cosmic = theme.cosmic(); + let corners = cosmic.corner_radii.clone(); + let pad = corners.radius_m[0]; match self.open_menu { Some(id) => match self.menus.get(&id) { Some(menu) => self .core .applet - .popup_container(menu.popup_view().map(move |msg| Msg::StatusMenu((id, msg)))) + .popup_container( + container(menu.popup_view().map(move |msg| Msg::StatusMenu((id, msg)))) + .padding([pad, 0.]), + ) .limits(Limits::NONE.min_width(1.).min_height(1.).max_width(300.)) .into(), None => unreachable!(), diff --git a/cosmic-applet-status-area/src/components/status_menu.rs b/cosmic-applet-status-area/src/components/status_menu.rs index ffb5bf73..9f582126 100644 --- a/cosmic-applet-status-area/src/components/status_menu.rs +++ b/cosmic-applet-status-area/src/components/status_menu.rs @@ -1,7 +1,11 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use cosmic::{applet::menu_button, iced, widget::icon}; +use cosmic::{ + applet::menu_button, + iced::{self, Padding}, + widget::icon, +}; use crate::subscriptions::status_notifier_item::{Layout, StatusNotifierItem};