qt: ignore right click to clear input config button if the button is disabled

This commit is contained in:
Megamouse 2024-05-22 00:38:27 +02:00
parent 49712f8f4e
commit 5cc05d082d
3 changed files with 3 additions and 3 deletions

View file

@ -220,7 +220,7 @@ bool basic_mouse_settings_dialog::eventFilter(QObject* object, QEvent* event)
if (m_button_id < 0)
{
QMouseEvent* mouse_event = static_cast<QMouseEvent*>(event);
if (const auto button = qobject_cast<QPushButton*>(object); button && mouse_event->button() == Qt::RightButton)
if (const auto button = qobject_cast<QPushButton*>(object); button && button->isEnabled() && mouse_event->button() == Qt::RightButton)
{
if (const int button_id = m_buttons->id(button))
{