Commit 9ba97875 authored by Niklas Freund's avatar Niklas Freund
Browse files

Fixed numeral mode having large empty space when bitset is hidden

parent 152aee8e
......@@ -2180,7 +2180,6 @@ void KCalculator::showScienceButtons(bool toggled)
void KCalculator::showLogicButtons(bool toggled)
{
if (toggled) {
firstVerticalLayout->setStretch(1, 1);
mBitset->setEnabled(true);
connect(mBitset, &KCalcBitset::valueChanged, this, &KCalculator::slotBitsetChanged);
connect(calc_display, &KCalcDisplay::changedAmount, this, &KCalculator::slotUpdateBitset);
......@@ -2206,7 +2205,6 @@ void KCalculator::showLogicButtons(bool toggled)
(num_button_group_->button(i))->show();
}
} else {
firstVerticalLayout->setStretch(1, 0);
mBitset->setEnabled(false);
disconnect(mBitset, &KCalcBitset::valueChanged, this, &KCalculator::slotBitsetChanged);
disconnect(calc_display, &KCalcDisplay::changedAmount, this, &KCalculator::slotUpdateBitset);
......@@ -2295,6 +2293,7 @@ void KCalculator::slotBitsetshow(bool toggled)
bool wasMinimumSize = isMinimumSize();
mBitset->setVisible(toggled);
setBitsetLayoutActive(toggled);
if (KCalcSettings::calculatorMode() == KCalcSettings::EnumCalculatorMode::numeral) {
KCalcSettings::setShowBitset(toggled);
}
......@@ -2631,6 +2630,15 @@ void KCalculator::setLeftPadLayoutActive(bool active)
leftPad->setSizePolicy(policy);
}
//------------------------------------------------------------------------------
// Name: setBitsetLayoutActive
// Desc: Enable/disable whether mBitset affects the layout
//------------------------------------------------------------------------------
void KCalculator::setBitsetLayoutActive(bool active)
{
firstVerticalLayout->setStretch(1, (int)active); // 0 or 1
}
//------------------------------------------------------------------------------
// Name: event
// Desc: catch application's palette and font change events
......
......@@ -134,6 +134,7 @@ private:
bool isMinimumSize();
void forceResizeEvent();
void setLeftPadLayoutActive(bool active);
void setBitsetLayoutActive(bool active);
void updateDisplay(UpdateFlags flags);
void updateHistoryWithFunction(CalcEngine::Operation);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment