fix(status arrea): padding

This commit is contained in:
Ashley Wulber 2025-03-04 13:24:44 -05:00 committed by Ashley Wulber
parent 5af413b834
commit 9b09c97665
3 changed files with 21 additions and 10 deletions

View file

@ -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" }

View file

@ -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!(),

View file

@ -1,7 +1,11 @@
// Copyright 2023 System76 <info@system76.com>
// 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};