From 29ac3191daa23ab1cdee24d5b4dea877084cc6c6 Mon Sep 17 00:00:00 2001 From: Uwe Date: Fri, 10 Mar 2023 05:07:16 +0100 Subject: [PATCH] [Gui] fix bug on restoring PrefColorButton - onRestore did not read in transparencies because App::Color::fromPackedRGB was used instead of App::Color::fromPackedRGBA --- src/Gui/PrefWidgets.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Gui/PrefWidgets.cpp b/src/Gui/PrefWidgets.cpp index 35e6fda65b..0b573116c7 100644 --- a/src/Gui/PrefWidgets.cpp +++ b/src/Gui/PrefWidgets.cpp @@ -547,8 +547,7 @@ PrefColorButton::~PrefColorButton() void PrefColorButton::restorePreferences() { - if (getWindowParameter().isNull()) - { + if (getWindowParameter().isNull()) { failedToRestore(objectName()); return; } @@ -559,11 +558,11 @@ void PrefColorButton::restorePreferences() unsigned int icol = App::Color::asPackedRGBA(m_Default); unsigned long lcol = static_cast(icol); - lcol = getWindowParameter()->GetUnsigned( entryName(), lcol ); + lcol = getWindowParameter()->GetUnsigned(entryName(), lcol); icol = static_cast(lcol); - QColor value = App::Color::fromPackedRGB(icol); + QColor value = App::Color::fromPackedRGBA(icol); if (!this->allowTransparency()) - value.setAlpha(0xff); + value.setAlpha(0xff); setColor(value); }