fix: prevent checkmark clipping in font and region selection drawers
This commit is contained in:
parent
8e7ed01fe6
commit
d853267ef1
5 changed files with 14 additions and 18 deletions
|
|
@ -71,9 +71,8 @@ pub fn selection_context<'a>(
|
||||||
) -> Element<'a, super::Message> {
|
) -> Element<'a, super::Message> {
|
||||||
let space_l = theme::active().cosmic().spacing.space_l;
|
let space_l = theme::active().cosmic().spacing.space_l;
|
||||||
|
|
||||||
let svg_accent = Rc::new(|theme: &cosmic::Theme| {
|
let svg_accent = Rc::new(|theme: &cosmic::Theme| svg::Style {
|
||||||
let color = theme.cosmic().accent_color().into();
|
color: Some(theme.cosmic().accent_color().into()),
|
||||||
svg::Style { color: Some(color) }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let search_input = widget::search_input(fl!("type-to-search"), search)
|
let search_input = widget::search_input(fl!("type-to-search"), search)
|
||||||
|
|
@ -86,8 +85,8 @@ pub fn selection_context<'a>(
|
||||||
settings::item_row(vec![
|
settings::item_row(vec![
|
||||||
widget::text::body(&**family)
|
widget::text::body(&**family)
|
||||||
.wrapping(Wrapping::Word)
|
.wrapping(Wrapping::Word)
|
||||||
|
.width(cosmic::iced::Length::Fill)
|
||||||
.into(),
|
.into(),
|
||||||
widget::horizontal_space().into(),
|
|
||||||
if selected {
|
if selected {
|
||||||
widget::icon::from_name("object-select-symbolic")
|
widget::icon::from_name("object-select-symbolic")
|
||||||
.size(16)
|
.size(16)
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ pub fn button(
|
||||||
)
|
)
|
||||||
.on_press(Message::IconTheme(id))
|
.on_press(Message::IconTheme(id))
|
||||||
.selected(selected)
|
.selected(selected)
|
||||||
.padding([theme.space_xs(), theme.space_xs() + 1])
|
.padding(theme.space_xs())
|
||||||
// Image button's style mostly works, but it needs a background to fit the design
|
// Image button's style mostly works, but it needs a background to fit the design
|
||||||
.class(button::ButtonClass::Custom {
|
.class(button::ButtonClass::Custom {
|
||||||
active: Box::new(move |focused, theme| {
|
active: Box::new(move |focused, theme| {
|
||||||
|
|
|
||||||
|
|
@ -408,6 +408,8 @@ impl Page {
|
||||||
)
|
)
|
||||||
.row_spacing(theme.space_xs())
|
.row_spacing(theme.space_xs())
|
||||||
.column_spacing(theme.space_xs())
|
.column_spacing(theme.space_xs())
|
||||||
|
.apply(container)
|
||||||
|
.center_x(Length::Fill)
|
||||||
.into()
|
.into()
|
||||||
])
|
])
|
||||||
.spacing(theme.space_xxs())
|
.spacing(theme.space_xxs())
|
||||||
|
|
|
||||||
|
|
@ -343,8 +343,8 @@ impl Page {
|
||||||
cosmic::theme::Text::Default
|
cosmic::theme::Text::Default
|
||||||
})
|
})
|
||||||
.wrapping(Wrapping::Word)
|
.wrapping(Wrapping::Word)
|
||||||
|
.width(Length::Fill)
|
||||||
.into(),
|
.into(),
|
||||||
widget::horizontal_space().into(),
|
|
||||||
if is_installed {
|
if is_installed {
|
||||||
widget::icon::from_name("object-select-symbolic")
|
widget::icon::from_name("object-select-symbolic")
|
||||||
.size(16)
|
.size(16)
|
||||||
|
|
@ -549,6 +549,7 @@ impl Page {
|
||||||
cosmic::theme::Text::Default
|
cosmic::theme::Text::Default
|
||||||
})
|
})
|
||||||
.wrapping(Wrapping::Word)
|
.wrapping(Wrapping::Word)
|
||||||
|
.width(Length::Fill)
|
||||||
.into(),
|
.into(),
|
||||||
if is_selected {
|
if is_selected {
|
||||||
widget::icon::from_name("object-select-symbolic")
|
widget::icon::from_name("object-select-symbolic")
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ pub fn color_picker_context_view<'a, Message: Clone + 'static>(
|
||||||
let theme = theme::active();
|
let theme = theme::active();
|
||||||
let spacing = &theme.cosmic().spacing;
|
let spacing = &theme.cosmic().spacing;
|
||||||
|
|
||||||
let description = description.map(|description| text(description).width(Length::Fill));
|
let description = description.map(|description| text::caption(description));
|
||||||
|
|
||||||
let color_picker = model
|
let color_picker = model
|
||||||
.builder(on_update)
|
.builder(on_update)
|
||||||
|
|
@ -35,15 +35,13 @@ pub fn color_picker_context_view<'a, Message: Clone + 'static>(
|
||||||
fl!("copied-to-clipboard"),
|
fl!("copied-to-clipboard"),
|
||||||
)
|
)
|
||||||
.apply(container)
|
.apply(container)
|
||||||
.width(Length::Fixed(248.0))
|
.center_x(Length::Fixed(248.0))
|
||||||
.align_x(Alignment::Center)
|
|
||||||
.apply(container)
|
.apply(container)
|
||||||
.center_x(Length::Fill);
|
.center_x(Length::Fill);
|
||||||
|
|
||||||
cosmic::widget::column()
|
cosmic::widget::column()
|
||||||
.push_maybe(description)
|
.push_maybe(description)
|
||||||
.push(color_picker)
|
.push(color_picker)
|
||||||
.padding(spacing.space_l)
|
|
||||||
.align_x(Alignment::Center)
|
.align_x(Alignment::Center)
|
||||||
.spacing(spacing.space_m)
|
.spacing(spacing.space_m)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
|
|
@ -103,17 +101,13 @@ pub fn unimplemented_page<Message: 'static>() -> Element<'static, Message> {
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn display_container<'a, Message: 'a>(widget: Element<'a, Message>) -> Element<'a, Message> {
|
pub fn display_container<'a, Message: 'a>(widget: Element<'a, Message>) -> Element<'a, Message> {
|
||||||
let display = container(widget)
|
container(widget)
|
||||||
.class(crate::theme::display_container_screen())
|
.class(crate::theme::display_container_screen())
|
||||||
.apply(container)
|
.apply(container)
|
||||||
.padding(4)
|
.padding(4)
|
||||||
.class(crate::theme::display_container_frame());
|
.class(crate::theme::display_container_frame())
|
||||||
|
.apply(container)
|
||||||
row::with_capacity(3)
|
.center_x(Length::Fill)
|
||||||
.push(horizontal_space())
|
|
||||||
.push(display)
|
|
||||||
.push(horizontal_space())
|
|
||||||
.padding([0, 0, 8, 0])
|
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue