From 2c51c102e381ddb27418c6f09daeeb4814c9078e Mon Sep 17 00:00:00 2001 From: Juan Campa Date: Sat, 15 Jan 2022 22:51:41 -0500 Subject: [PATCH 1/2] Fix a couple of hard-coded corner radii --- egui/src/containers/collapsing_header.rs | 3 +-- egui/src/widgets/selected_label.rs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/egui/src/containers/collapsing_header.rs b/egui/src/containers/collapsing_header.rs index 66c6b213a9d..f52542ed2aa 100644 --- a/egui/src/containers/collapsing_header.rs +++ b/egui/src/containers/collapsing_header.rs @@ -331,9 +331,8 @@ impl CollapsingHeader { { let rect = rect.expand(visuals.expansion); - let corner_radius = 2.0; ui.painter() - .rect(rect, corner_radius, visuals.bg_fill, visuals.bg_stroke); + .rect(rect, visuals.corner_radius, visuals.bg_fill, visuals.bg_stroke); } { diff --git a/egui/src/widgets/selected_label.rs b/egui/src/widgets/selected_label.rs index bf08b41c2f3..558231252c7 100644 --- a/egui/src/widgets/selected_label.rs +++ b/egui/src/widgets/selected_label.rs @@ -64,9 +64,8 @@ impl Widget for SelectableLabel { if selected || response.hovered() || response.has_focus() { let rect = rect.expand(visuals.expansion); - let corner_radius = 2.0; ui.painter() - .rect(rect, corner_radius, visuals.bg_fill, visuals.bg_stroke); + .rect(rect, visuals.corner_radius, visuals.bg_fill, visuals.bg_stroke); } text.paint_with_visuals(ui.painter(), text_pos, &visuals); From 358481847e18aaf64d18e0a7b9178dceae947812 Mon Sep 17 00:00:00 2001 From: Juan Campa Date: Sun, 16 Jan 2022 12:50:58 -0500 Subject: [PATCH 2/2] Cargo fmt --- egui/src/containers/collapsing_header.rs | 8 ++++++-- egui/src/widgets/selected_label.rs | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/egui/src/containers/collapsing_header.rs b/egui/src/containers/collapsing_header.rs index f52542ed2aa..0a1a31ddc53 100644 --- a/egui/src/containers/collapsing_header.rs +++ b/egui/src/containers/collapsing_header.rs @@ -331,8 +331,12 @@ impl CollapsingHeader { { let rect = rect.expand(visuals.expansion); - ui.painter() - .rect(rect, visuals.corner_radius, visuals.bg_fill, visuals.bg_stroke); + ui.painter().rect( + rect, + visuals.corner_radius, + visuals.bg_fill, + visuals.bg_stroke, + ); } { diff --git a/egui/src/widgets/selected_label.rs b/egui/src/widgets/selected_label.rs index 558231252c7..8ddb5c2e286 100644 --- a/egui/src/widgets/selected_label.rs +++ b/egui/src/widgets/selected_label.rs @@ -64,8 +64,12 @@ impl Widget for SelectableLabel { if selected || response.hovered() || response.has_focus() { let rect = rect.expand(visuals.expansion); - ui.painter() - .rect(rect, visuals.corner_radius, visuals.bg_fill, visuals.bg_stroke); + ui.painter().rect( + rect, + visuals.corner_radius, + visuals.bg_fill, + visuals.bg_stroke, + ); } text.paint_with_visuals(ui.painter(), text_pos, &visuals);