From e0ed76745ee8d03790804b696dc764cc8f83df29 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 16 Jan 2023 12:46:55 +1000 Subject: [PATCH] Qt: Fix cancel in LED colour selection --- src/duckstation-qt/colorpickerbutton.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/duckstation-qt/colorpickerbutton.cpp b/src/duckstation-qt/colorpickerbutton.cpp index 52ed76fee..5bb59030c 100644 --- a/src/duckstation-qt/colorpickerbutton.cpp +++ b/src/duckstation-qt/colorpickerbutton.cpp @@ -39,7 +39,9 @@ void ColorPickerButton::onClicked() const QColor initial(QColor::fromRgb(red, green, blue)); const QColor selected(QColorDialog::getColor(initial, QtUtils::GetRootWidget(this), tr("Select LED Color"))); - if (initial == selected) + + // QColorDialog returns Invalid on cancel, and apparently initial == Invalid is true... + if (!selected.isValid() || initial == selected) return; const u32 new_rgb = (static_cast(selected.red()) << 16) | (static_cast(selected.green()) << 8) |