From f455d0b984c5131517c5b2e3c698aa84d9b3960f Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 10 Jul 2020 00:06:55 +0200 Subject: [PATCH] ButtonSwitch: invoke setChecked on toggle handling so that the button face is changed appropriately --- sdrgui/gui/buttonswitch.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sdrgui/gui/buttonswitch.cpp b/sdrgui/gui/buttonswitch.cpp index ac7cc2bf8..d25db74da 100644 --- a/sdrgui/gui/buttonswitch.cpp +++ b/sdrgui/gui/buttonswitch.cpp @@ -11,11 +11,18 @@ ButtonSwitch::ButtonSwitch(QWidget* parent) : void ButtonSwitch::onToggled(bool checked) { - if(checked) { + blockSignals(true); + setChecked(checked); + blockSignals(false); + + if (checked) + { QPalette p = m_originalPalette; p.setColor(QPalette::Button, QColor(0x80, 0x46, 0x00)); setPalette(p); - } else { + } + else + { setPalette(m_originalPalette); } }