feat: Border radius support for buttons
This commit is contained in:
parent
a39a2518d0
commit
d732f64fb8
3 changed files with 6 additions and 4 deletions
2
iced
2
iced
|
|
@ -1 +1 @@
|
||||||
Subproject commit 499367339dbc7036ac1ceaf6378a0cd7e2972158
|
Subproject commit fec3193836d9fbe57fb93d54f56ce5d73b23ee38
|
||||||
|
|
@ -10,6 +10,7 @@ use std::hash::Hasher;
|
||||||
pub use self::palette::Palette;
|
pub use self::palette::Palette;
|
||||||
|
|
||||||
use cosmic_theme::Component;
|
use cosmic_theme::Component;
|
||||||
|
use iced_core::BorderRadius;
|
||||||
use iced_style::application;
|
use iced_style::application;
|
||||||
use iced_style::button;
|
use iced_style::button;
|
||||||
use iced_style::checkbox;
|
use iced_style::checkbox;
|
||||||
|
|
@ -175,8 +176,8 @@ impl button::StyleSheet for Theme {
|
||||||
|
|
||||||
button::Appearance {
|
button::Appearance {
|
||||||
border_radius: match style {
|
border_radius: match style {
|
||||||
Button::Link => 0.0,
|
Button::Link => BorderRadius::from(0.0),
|
||||||
_ => 24.0,
|
_ => BorderRadius::from(24.0),
|
||||||
},
|
},
|
||||||
background: match style {
|
background: match style {
|
||||||
Button::Link | Button::Text => None,
|
Button::Link | Button::Text => None,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ use crate::widget::{icon, scrollable};
|
||||||
use crate::{theme, Renderer, Theme};
|
use crate::{theme, Renderer, Theme};
|
||||||
use derive_setters::Setters;
|
use derive_setters::Setters;
|
||||||
use iced::{Background, Length};
|
use iced::{Background, Length};
|
||||||
|
use iced_core::BorderRadius;
|
||||||
use iced_lazy::Component;
|
use iced_lazy::Component;
|
||||||
use iced_native::widget::{button, column, container, text};
|
use iced_native::widget::{button, column, container, text};
|
||||||
use iced_native::{row, Alignment, Element};
|
use iced_native::{row, Alignment, Element};
|
||||||
|
|
@ -230,7 +231,7 @@ pub fn section_button_style(theme: &Theme) -> Appearance {
|
||||||
Appearance {
|
Appearance {
|
||||||
shadow_offset: iced::Vector::default(),
|
shadow_offset: iced::Vector::default(),
|
||||||
background: Some(Background::Color(primary.base.into())),
|
background: Some(Background::Color(primary.base.into())),
|
||||||
border_radius: 5.0,
|
border_radius: BorderRadius::from(5.0),
|
||||||
border_width: 0.0,
|
border_width: 0.0,
|
||||||
border_color: iced::Color::default(),
|
border_color: iced::Color::default(),
|
||||||
text_color: iced::Color::default(),
|
text_color: iced::Color::default(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue