From 884be3491d01a1c1963c4dd63d8d788e1245ce37 Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Tue, 25 Mar 2025 14:38:51 +0100 Subject: [PATCH] Fix color picker button (#5847) * related to #5832 (I want to keep that open and actually update the button to use the new popup, but this should be enough to fix it for now) * [X] I have followed the instructions in the PR template --- crates/egui/src/widgets/color_picker.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/widgets/color_picker.rs b/crates/egui/src/widgets/color_picker.rs index 500fb0b8..f8e18665 100644 --- a/crates/egui/src/widgets/color_picker.rs +++ b/crates/egui/src/widgets/color_picker.rs @@ -502,8 +502,9 @@ pub fn color_edit_button_hsva(ui: &mut Ui, hsva: &mut Hsva, alpha: Alpha) -> Res const COLOR_SLIDER_WIDTH: f32 = 275.0; - // TODO(emilk): make it easier to show a temporary popup that closes when you click outside it + // TODO(lucasmerlin): Update this to use new Popup struct if ui.memory(|mem| mem.is_popup_open(popup_id)) { + ui.memory_mut(|mem| mem.keep_popup_open(popup_id)); let area_response = Area::new(popup_id) .kind(UiKind::Picker) .order(Order::Foreground)