Skip to content

Commit d853267

Browse files
authored
fix: prevent checkmark clipping in font and region selection drawers
1 parent 8e7ed01 commit d853267

File tree

5 files changed

+14
-18
lines changed

5 files changed

+14
-18
lines changed

cosmic-settings/src/pages/desktop/appearance/font_config.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ pub fn selection_context<'a>(
7171
) -> Element<'a, super::Message> {
7272
let space_l = theme::active().cosmic().spacing.space_l;
7373

74-
let svg_accent = Rc::new(|theme: &cosmic::Theme| {
75-
let color = theme.cosmic().accent_color().into();
76-
svg::Style { color: Some(color) }
74+
let svg_accent = Rc::new(|theme: &cosmic::Theme| svg::Style {
75+
color: Some(theme.cosmic().accent_color().into()),
7776
});
7877

7978
let search_input = widget::search_input(fl!("type-to-search"), search)
@@ -86,8 +85,8 @@ pub fn selection_context<'a>(
8685
settings::item_row(vec![
8786
widget::text::body(&**family)
8887
.wrapping(Wrapping::Word)
88+
.width(cosmic::iced::Length::Fill)
8989
.into(),
90-
widget::horizontal_space().into(),
9190
if selected {
9291
widget::icon::from_name("object-select-symbolic")
9392
.size(16)

cosmic-settings/src/pages/desktop/appearance/icon_themes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub fn button(
6363
)
6464
.on_press(Message::IconTheme(id))
6565
.selected(selected)
66-
.padding([theme.space_xs(), theme.space_xs() + 1])
66+
.padding(theme.space_xs())
6767
// Image button's style mostly works, but it needs a background to fit the design
6868
.class(button::ButtonClass::Custom {
6969
active: Box::new(move |focused, theme| {

cosmic-settings/src/pages/desktop/appearance/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ impl Page {
408408
)
409409
.row_spacing(theme.space_xs())
410410
.column_spacing(theme.space_xs())
411+
.apply(container)
412+
.center_x(Length::Fill)
411413
.into()
412414
])
413415
.spacing(theme.space_xxs())

cosmic-settings/src/pages/time/region.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ impl Page {
343343
cosmic::theme::Text::Default
344344
})
345345
.wrapping(Wrapping::Word)
346+
.width(Length::Fill)
346347
.into(),
347-
widget::horizontal_space().into(),
348348
if is_installed {
349349
widget::icon::from_name("object-select-symbolic")
350350
.size(16)
@@ -549,6 +549,7 @@ impl Page {
549549
cosmic::theme::Text::Default
550550
})
551551
.wrapping(Wrapping::Word)
552+
.width(Length::Fill)
552553
.into(),
553554
if is_selected {
554555
widget::icon::from_name("object-select-symbolic")

cosmic-settings/src/widget/mod.rs

+6-12
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn color_picker_context_view<'a, Message: Clone + 'static>(
2323
let theme = theme::active();
2424
let spacing = &theme.cosmic().spacing;
2525

26-
let description = description.map(|description| text(description).width(Length::Fill));
26+
let description = description.map(|description| text::caption(description));
2727

2828
let color_picker = model
2929
.builder(on_update)
@@ -35,15 +35,13 @@ pub fn color_picker_context_view<'a, Message: Clone + 'static>(
3535
fl!("copied-to-clipboard"),
3636
)
3737
.apply(container)
38-
.width(Length::Fixed(248.0))
39-
.align_x(Alignment::Center)
38+
.center_x(Length::Fixed(248.0))
4039
.apply(container)
4140
.center_x(Length::Fill);
4241

4342
cosmic::widget::column()
4443
.push_maybe(description)
4544
.push(color_picker)
46-
.padding(spacing.space_l)
4745
.align_x(Alignment::Center)
4846
.spacing(spacing.space_m)
4947
.width(Length::Fill)
@@ -103,17 +101,13 @@ pub fn unimplemented_page<Message: 'static>() -> Element<'static, Message> {
103101

104102
#[must_use]
105103
pub fn display_container<'a, Message: 'a>(widget: Element<'a, Message>) -> Element<'a, Message> {
106-
let display = container(widget)
104+
container(widget)
107105
.class(crate::theme::display_container_screen())
108106
.apply(container)
109107
.padding(4)
110-
.class(crate::theme::display_container_frame());
111-
112-
row::with_capacity(3)
113-
.push(horizontal_space())
114-
.push(display)
115-
.push(horizontal_space())
116-
.padding([0, 0, 8, 0])
108+
.class(crate::theme::display_container_frame())
109+
.apply(container)
110+
.center_x(Length::Fill)
117111
.into()
118112
}
119113

0 commit comments

Comments
 (0)