feat: add custom border radius property for windows
This commit is contained in:
parent
3e78eb2381
commit
d3aa7197d1
4 changed files with 22 additions and 6 deletions
|
|
@ -657,7 +657,7 @@ impl<T: Application> Cosmic<T> {
|
|||
|
||||
let theme = THEME.lock().unwrap();
|
||||
let t = theme.cosmic();
|
||||
let radii = t.radius_s().map(|x| if x < 4.0 { x } else { x + 4.0 });
|
||||
let radii = t.radius_window();
|
||||
let cur_rad = CornerRadius {
|
||||
top_left: radii[0].round() as u32,
|
||||
top_right: radii[1].round() as u32,
|
||||
|
|
@ -797,7 +797,7 @@ impl<T: Application> Cosmic<T> {
|
|||
|
||||
let t = cosmic_theme.cosmic();
|
||||
|
||||
let radii = t.radius_s().map(|x| if x < 4.0 { x } else { x + 4.0 });
|
||||
let radii = t.radius_window();
|
||||
let cur_rad = CornerRadius {
|
||||
top_left: radii[0].round() as u32,
|
||||
top_right: radii[1].round() as u32,
|
||||
|
|
@ -943,7 +943,7 @@ impl<T: Application> Cosmic<T> {
|
|||
|
||||
let t = cosmic_theme.cosmic();
|
||||
|
||||
let radii = t.radius_s().map(|x| if x < 4.0 { x } else { x + 4.0 });
|
||||
let radii = t.radius_window();
|
||||
let cur_rad = CornerRadius {
|
||||
top_left: radii[0].round() as u32,
|
||||
top_right: radii[1].round() as u32,
|
||||
|
|
@ -1219,7 +1219,7 @@ impl<T: Application> Cosmic<T> {
|
|||
|
||||
let theme = THEME.lock().unwrap();
|
||||
let t = theme.cosmic();
|
||||
let radii = t.radius_s().map(|x| if x < 4.0 { x } else { x + 4.0 });
|
||||
let radii = t.radius_window();
|
||||
let cur_rad = CornerRadius {
|
||||
top_left: radii[0].round() as u32,
|
||||
top_right: radii[1].round() as u32,
|
||||
|
|
|
|||
|
|
@ -470,8 +470,8 @@ impl iced_container::Catalog for Theme {
|
|||
fn style(&self, class: &Self::Class<'_>) -> iced_container::Style {
|
||||
let cosmic = self.cosmic();
|
||||
|
||||
// Ensures visually aligned radii for content and window corners
|
||||
let window_corner_radius = cosmic.radius_s().map(|x| if x < 4.0 { x } else { x + 4.0 });
|
||||
// Use dedicated window radius from theme
|
||||
let window_corner_radius = cosmic.radius_window();
|
||||
|
||||
match class {
|
||||
Container::Transparent => iced_container::Style::default(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue