fix: spin button styling & spacing

This commit is contained in:
Ashley Wulber 2023-05-09 15:47:09 -04:00
parent f3206b1620
commit 2a628b8431
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
3 changed files with 21 additions and 23 deletions

View file

@ -38,37 +38,37 @@ freedesktop-icons = "0.2.2"
git = "https://github.com/pop-os/cosmic-theme.git" git = "https://github.com/pop-os/cosmic-theme.git"
[dependencies.iced] [dependencies.iced]
path = "iced" path = "../fork/iced/"
default-features = false default-features = false
features = ["image", "svg"] features = ["image", "svg"]
[dependencies.iced_core] [dependencies.iced_core]
path = "iced/core" path = "../fork/iced/core"
[dependencies.iced_widget] [dependencies.iced_widget]
path = "iced/widget" path = "../fork/iced/widget"
[dependencies.iced_accessibility] [dependencies.iced_accessibility]
path = "iced/accessibility" path = "../fork/iced/accessibility"
optional = true optional = true
[dependencies.iced_tiny_skia] [dependencies.iced_tiny_skia]
path = "iced/tiny_skia" path = "../fork/iced/tiny_skia"
optional = true optional = true
[dependencies.iced_style] [dependencies.iced_style]
path = "iced/style" path = "../fork/iced/style"
[dependencies.iced_sctk] [dependencies.iced_sctk]
path = "iced/sctk" path = "../fork/iced/sctk"
optional = true optional = true
[dependencies.iced_winit] [dependencies.iced_winit]
path = "iced/winit" path = "../fork/iced/winit"
optional = true optional = true
[dependencies.iced_wgpu] [dependencies.iced_wgpu]
path = "iced/wgpu" path = "../fork/iced/wgpu"
optional = true optional = true
[workspace] [workspace]

2
iced

@ -1 +1 @@
Subproject commit 7bb11b71ea4614bd0d177a1f7f59394ff6c83ca0 Subproject commit 422d1f1e09dbceee3fbdf08e62e96779e5d60cf1

View file

@ -46,42 +46,40 @@ impl<'a, Message: 'static> SpinButton<'a, Message> {
icon("list-remove-symbolic", 24) icon("list-remove-symbolic", 24)
.style(theme::Svg::Symbolic) .style(theme::Svg::Symbolic)
.apply(container) .apply(container)
.width(Length::Fill) .width(Length::Fixed(32.0))
.height(Length::Fill) .height(Length::Fixed(32.0))
.align_x(Horizontal::Center) .align_x(Horizontal::Center)
.align_y(Vertical::Center) .align_y(Vertical::Center)
.apply(button) .apply(button)
.width(Length::Fill) .width(Length::Fixed(32.0))
.height(Length::Fill) .height(Length::Fixed(32.0))
.style(theme::Button::Text) .style(theme::Button::Text)
.on_press(model::Message::Decrement), .on_press(model::Message::Decrement),
text(label) text(label)
.vertical_alignment(Vertical::Center) .vertical_alignment(Vertical::Center)
.apply(container) .apply(container)
.width(Length::Fill)
.height(Length::Fill)
.align_x(Horizontal::Center) .align_x(Horizontal::Center)
.align_y(Vertical::Center), .align_y(Vertical::Center),
icon("list-add-symbolic", 24) icon("list-add-symbolic", 24)
.style(theme::Svg::Symbolic) .style(theme::Svg::Symbolic)
.apply(container) .apply(container)
.width(Length::Fill) .width(Length::Fixed(32.0))
.height(Length::Fill) .height(Length::Fixed(32.0))
.align_x(Horizontal::Center) .align_x(Horizontal::Center)
.align_y(Vertical::Center) .align_y(Vertical::Center)
.apply(button) .apply(button)
.width(Length::Fill) .width(Length::Fixed(32.0))
.height(Length::Fill) .height(Length::Fixed(32.0))
.style(theme::Button::Text) .style(theme::Button::Text)
.on_press(model::Message::Increment), .on_press(model::Message::Increment),
] ]
.width(Length::Fill) .width(Length::Shrink)
.height(Length::Fixed(32.0)) .height(Length::Fixed(32.0))
.spacing(4.0)
.align_items(Alignment::Center), .align_items(Alignment::Center),
) )
.padding([4, 4])
.align_y(Vertical::Center) .align_y(Vertical::Center)
.width(Length::Fixed(95.0)) .width(Length::Shrink)
.height(Length::Fixed(32.0)) .height(Length::Fixed(32.0))
.style(theme::Container::custom(container_style)) .style(theme::Container::custom(container_style))
.apply(Element::from) .apply(Element::from)