mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 11:37:56 -04:00
Check MultiZim Item When Clicking Anywhere
Previously only checks when clicking Radiobutton
This commit is contained in:
parent
f5bef3bf45
commit
85d2790b75
@ -19,6 +19,11 @@ MultiZimButton::MultiZimButton(QWidget *parent) :
|
|||||||
const auto popupAction = new QWidgetAction(menu());
|
const auto popupAction = new QWidgetAction(menu());
|
||||||
popupAction->setDefaultWidget(mp_buttonList);
|
popupAction->setDefaultWidget(mp_buttonList);
|
||||||
menu()->addAction(popupAction);
|
menu()->addAction(popupAction);
|
||||||
|
|
||||||
|
connect(mp_buttonList, &QListWidget::currentRowChanged, this, [=](int row){
|
||||||
|
if (const auto widget = getZimWidget(row))
|
||||||
|
widget->getRadioButton()->setChecked(true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiZimButton::updateDisplay()
|
void MultiZimButton::updateDisplay()
|
||||||
@ -72,8 +77,7 @@ void MultiZimButton::updateDisplay()
|
|||||||
setDisabled(mp_buttonList->model()->rowCount() == 0);
|
setDisabled(mp_buttonList->model()->rowCount() == 0);
|
||||||
|
|
||||||
mp_buttonList->scrollToTop();
|
mp_buttonList->scrollToTop();
|
||||||
if (const auto firstWidget = getZimWidget(0))
|
mp_buttonList->setCurrentRow(0);
|
||||||
firstWidget->getRadioButton()->setChecked(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList MultiZimButton::getZimIds() const
|
QStringList MultiZimButton::getZimIds() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user