Skip to content

Commit 20bb8d0

Browse files
git-f0xwash2
authored andcommitted
improv(applets_inner): always show placeholder on empty segments
This makes it clearer that applets can be placed in those segments before a drag is started, and prevents things moving around when the drag is started.
1 parent b3be053 commit 20bb8d0

36 files changed

+202
-269
lines changed

cosmic-settings/src/pages/desktop/panel/applets_inner.rs

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use cosmic::app::ContextDrawer;
22
use cosmic::cosmic_theme::palette::WithAlpha;
3-
use cosmic::iced::Vector;
43
use cosmic::iced::clipboard::dnd::{
54
DndAction, DndDestinationRectangle, DndEvent, OfferEvent, SourceEvent,
65
};
@@ -15,8 +14,8 @@ use cosmic::{
1514
Apply, Element,
1615
cosmic_config::{Config, CosmicConfigEntry},
1716
iced::{
18-
Alignment, Color, Length, Point, Rectangle, Size, core::window, event, mouse, overlay,
19-
touch,
17+
Alignment, Border, Color, Length, Point, Rectangle, Size, Vector, core::window, event,
18+
mouse, overlay, touch,
2019
},
2120
iced_runtime::{Task, core::id::Id},
2221
iced_widget::core::{
@@ -651,7 +650,7 @@ impl<'a, Message: 'static + Clone> AppletReorderList<'a, Message> {
651650
let is_dragged = active_dnd.as_ref().is_some_and(|dnd| dnd.id == info.id);
652651

653652
let content = if is_dragged {
654-
row::with_capacity(0).height(Length::Fixed(32.0))
653+
row().height(Length::Fixed(32.0))
655654
} else {
656655
row::with_children(vec![
657656
icon::from_name("grip-lines-symbolic")
@@ -709,24 +708,32 @@ impl<'a, Message: 'static + Clone> AppletReorderList<'a, Message> {
709708
on_reorder: Box::new(on_reorder),
710709
on_finish: Some(on_apply_reorder),
711710
on_cancel: Some(on_cancel),
712-
inner: if active_dnd.is_some() && applet_buttons.is_empty() {
711+
inner: if applet_buttons.is_empty() {
713712
container(
714-
text::body(fl!("drop-here"))
713+
text::body(fl!("place-here"))
714+
.class(theme::Text::Color(
715+
theme::active()
716+
.cosmic()
717+
.on_bg_component_color()
718+
.with_alpha(0.75)
719+
.into(),
720+
))
715721
.width(Length::Fill)
716722
.height(Length::Fill)
717-
.align_y(Alignment::Center)
718-
.align_x(Alignment::Center),
723+
.center(),
719724
)
720725
.width(Length::Fill)
721726
.height(Length::Fixed(48.0))
722727
.padding(8)
723-
.class(theme::Container::Custom(Box::new(move |theme| {
724-
let mut style = container::Catalog::style(theme, &theme::Container::Primary);
725-
style.border.radius = theme.cosmic().radius_s().into();
726-
style.border.color = theme.cosmic().bg_divider().into();
727-
style.border.width = 2.0;
728-
style.background = Some(Color::TRANSPARENT.into());
729-
style
728+
.class(theme::Container::Custom(Box::new(|theme| {
729+
container::Style {
730+
border: Border {
731+
radius: theme.cosmic().radius_s().into(),
732+
color: theme.cosmic().bg_divider().with_alpha(0.5).into(),
733+
width: 2.0,
734+
},
735+
..Default::default()
736+
}
730737
})))
731738
.into()
732739
} else {

i18n/af/cosmic-settings.ftl

Lines changed: 0 additions & 180 deletions
This file was deleted.

0 commit comments

Comments
 (0)