fix(status arrea): padding
This commit is contained in:
parent
5af413b834
commit
9b09c97665
3 changed files with 21 additions and 10 deletions
12
Cargo.toml
12
Cargo.toml
|
|
@ -75,13 +75,13 @@ opt-level = 1
|
||||||
[workspace.metadata.cargo-machete]
|
[workspace.metadata.cargo-machete]
|
||||||
ignored = ["libcosmic"]
|
ignored = ["libcosmic"]
|
||||||
[patch."https://github.com/pop-os/libcosmic"]
|
[patch."https://github.com/pop-os/libcosmic"]
|
||||||
# cosmic-config = { 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" }
|
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" }
|
iced_futures = { git = "https://github.com/pop-os/libcosmic//", branch = "drop-menu-tree-changes" }
|
||||||
|
|
||||||
cosmic-config = { path = "../libcosmic/cosmic-config" }
|
# cosmic-config = { path = "../libcosmic/cosmic-config" }
|
||||||
libcosmic = { path = "../libcosmic" }
|
# libcosmic = { path = "../libcosmic" }
|
||||||
iced_futures = { path = "../libcosmic/iced/futures" }
|
# iced_futures = { path = "../libcosmic/iced/futures" }
|
||||||
|
|
||||||
# [patch."https://github.com/pop-os/winit.git"]
|
# [patch."https://github.com/pop-os/winit.git"]
|
||||||
# winit = { git = "https://github.com/rust-windowing/winit.git", rev = "241b7a80bba96c91fa3901729cd5dec66abb9be4" }
|
# winit = { git = "https://github.com/rust-windowing/winit.git", rev = "241b7a80bba96c91fa3901729cd5dec66abb9be4" }
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ use cosmic::{
|
||||||
iced::{
|
iced::{
|
||||||
self,
|
self,
|
||||||
platform_specific::shell::commands::popup::{destroy_popup, get_popup},
|
platform_specific::shell::commands::popup::{destroy_popup, get_popup},
|
||||||
window, Limits, Subscription,
|
window, Limits, Padding, Subscription,
|
||||||
},
|
},
|
||||||
surface_message::{MessageWrapper, SurfaceMessage},
|
surface_message::{MessageWrapper, SurfaceMessage},
|
||||||
widget::mouse_area,
|
widget::{container, mouse_area},
|
||||||
Element, Task,
|
Element, Task,
|
||||||
};
|
};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
@ -290,12 +290,19 @@ impl cosmic::Application for App {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn view_window(&self, _surface: window::Id) -> cosmic::Element<'_, Msg> {
|
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 {
|
match self.open_menu {
|
||||||
Some(id) => match self.menus.get(&id) {
|
Some(id) => match self.menus.get(&id) {
|
||||||
Some(menu) => self
|
Some(menu) => self
|
||||||
.core
|
.core
|
||||||
.applet
|
.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.))
|
.limits(Limits::NONE.min_width(1.).min_height(1.).max_width(300.))
|
||||||
.into(),
|
.into(),
|
||||||
None => unreachable!(),
|
None => unreachable!(),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
// Copyright 2023 System76 <info@system76.com>
|
// Copyright 2023 System76 <info@system76.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// 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};
|
use crate::subscriptions::status_notifier_item::{Layout, StatusNotifierItem};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue