Fix bonkers QButtonGroup signal.

work/plasma6
Lana Black 8 months ago
parent 960abe2aec
commit 3bb77b771c

@ -75,15 +75,10 @@ void DetailsHandler::init()
m_ui->patternClearBtn->setFixedHeight(m_ui->backgroundBtn->height()+2);
connect(m_backButtonsGroup, &QButtonGroup::buttonToggled,
[ this ](QAbstractButton *id, bool checked) {
connect(m_backButtonsGroup, &QButtonGroup::idToggled,
[ this ](int id, bool checked) {
if (checked) {
// FIXME:
// I've no idea wtf was going on here. This code was likely incorrect to begin with.
Latte::Layout::BackgroundStyle style = id
? Latte::Layout::PatternBackgroundStyle
: Latte::Layout::ColorBackgroundStyle;
setBackgroundStyle(static_cast<Latte::Layout::BackgroundStyle>(style));
this->setBackgroundStyle(static_cast<Latte::Layout::BackgroundStyle>(id));
}
});

@ -88,19 +88,19 @@ void TabLayouts::initUi()
connect(this, &Settings::Handler::TabLayouts::dataChanged, this, &TabLayouts::updatePerLayoutButtonsState);
connect(m_corona->activitiesConsumer(), &KActivities::Consumer::runningActivitiesChanged, this, &TabLayouts::updatePerLayoutButtonsState);
connect(m_inMemoryButtons, &QButtonGroup::buttonToggled,
connect(m_inMemoryButtons, &QButtonGroup::idToggled,
[ this ](int id, bool checked) {
if (checked) {
this->m_layoutsController->setInMultipleMode(id == MemoryUsage::MultipleLayouts);
if (id == MemoryUsage::MultipleLayouts) {
this->m_layoutsController->sortByColumn(Model::Layouts::ACTIVITYCOLUMN, Qt::AscendingOrder);
} else {
this->m_layoutsController->sortByColumn(Model::Layouts::NAMECOLUMN, Qt::AscendingOrder);
}
}
});
if (checked) {
this->m_layoutsController->setInMultipleMode(id == MemoryUsage::MultipleLayouts);
if (id == MemoryUsage::MultipleLayouts) {
this->m_layoutsController->sortByColumn(
Model::Layouts::ACTIVITYCOLUMN, Qt::AscendingOrder);
} else {
this->m_layoutsController->sortByColumn(Model::Layouts::NAMECOLUMN, Qt::AscendingOrder);
}
}
});
connect(m_ui->tabWidget, &QTabWidget::currentChanged, this, &TabLayouts::currentPageChanged);
connect(this, &TabLayouts::currentPageChanged, this, &TabLayouts::onCurrentPageChanged);

Loading…
Cancel
Save