mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Add NonDefaultQPushButton to set autoDefault of buttons to false
This commit is contained in:
11
Source/Core/DolphinQt/QtUtils/NonDefaultQPushButton.cpp
Normal file
11
Source/Core/DolphinQt/QtUtils/NonDefaultQPushButton.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright 2022 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
|
||||
NonDefaultQPushButton::NonDefaultQPushButton(const QString& text, QWidget* parent)
|
||||
: QPushButton(text, parent)
|
||||
{
|
||||
this->setAutoDefault(false);
|
||||
}
|
15
Source/Core/DolphinQt/QtUtils/NonDefaultQPushButton.h
Normal file
15
Source/Core/DolphinQt/QtUtils/NonDefaultQPushButton.h
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright 2022 Dolphin Emulator Project
|
||||
// Licensed under GPLv2+
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
// A custom QPushButton that sets the autoDefault option to false
|
||||
// This makes sure random buttons are not highlighted anymore by default
|
||||
class NonDefaultQPushButton : public QPushButton
|
||||
{
|
||||
public:
|
||||
explicit NonDefaultQPushButton(const QString& text = {}, QWidget* parent = nullptr);
|
||||
};
|
Reference in New Issue
Block a user