Skip to content

Commit

Permalink
migrating to iced 0.13 (radius)
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Sep 21, 2024
1 parent 5b96882 commit f2ae7dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 3 additions & 6 deletions src/gui/styles/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#![allow(clippy::module_name_repetitions)]

use iced::border::Radius;
use iced::widget::button;
use iced::widget::button::{Catalog, Status, Style};
use iced::{Background, Border, Color, Shadow, Vector};
Expand Down Expand Up @@ -62,9 +63,7 @@ impl ButtonType {
border: Border {
radius: match self {
ButtonType::Neutral => 0.0.into(),
ButtonType::TabActive | ButtonType::TabInactive => {
[0.0, 0.0, 30.0, 30.0].into()
}
ButtonType::TabActive | ButtonType::TabInactive => Radius::new(0).bottom(30),
ButtonType::BorderedRound | ButtonType::BorderedRoundSelected => 12.0.into(),
ButtonType::Starred | ButtonType::NotStarred => 100.0.into(),
_ => BORDER_BUTTON_RADIUS.into(),
Expand Down Expand Up @@ -153,9 +152,7 @@ impl ButtonType {
border: Border {
radius: match self {
ButtonType::Neutral => 0.0.into(),
ButtonType::TabActive | ButtonType::TabInactive => {
[0.0, 0.0, 30.0, 30.0].into()
}
ButtonType::TabActive | ButtonType::TabInactive => Radius::new(0).bottom(30),
ButtonType::BorderedRound | ButtonType::BorderedRoundSelected => 12.0.into(),
ButtonType::Starred | ButtonType::NotStarred => 100.0.into(),
_ => BORDER_BUTTON_RADIUS.into(),
Expand Down
5 changes: 2 additions & 3 deletions src/gui/styles/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#![allow(clippy::module_name_repetitions)]

use iced::border::Radius;
use iced::widget::container::{Catalog, Style};
use iced::{Background, Border, Color, Shadow};

Expand Down Expand Up @@ -58,9 +59,7 @@ impl ContainerType {
border: Border {
radius: match self {
ContainerType::BorderedRound => BORDER_ROUNDED_RADIUS.into(),
ContainerType::Modal => {
[0.0, 0.0, BORDER_ROUNDED_RADIUS, BORDER_ROUNDED_RADIUS].into()
}
ContainerType::Modal => Radius::new(0).bottom(BORDER_ROUNDED_RADIUS),
ContainerType::Tooltip => 7.0.into(),
ContainerType::Badge
| ContainerType::Highlighted
Expand Down

0 comments on commit f2ae7dd

Please sign in to comment.