diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 2633b3d264..4079d3db94 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -181,6 +181,8 @@ add_executable(dolphin-emu Config/ToolTipControls/ToolTipCheckBox.h Config/ToolTipControls/ToolTipComboBox.cpp Config/ToolTipControls/ToolTipComboBox.h + Config/ToolTipControls/ToolTipPushButton.cpp + Config/ToolTipControls/ToolTipPushButton.h Config/ToolTipControls/ToolTipRadioButton.cpp Config/ToolTipControls/ToolTipRadioButton.h Config/ToolTipControls/ToolTipSlider.cpp diff --git a/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipPushButton.cpp b/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipPushButton.cpp new file mode 100644 index 0000000000..c15aefea9e --- /dev/null +++ b/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipPushButton.cpp @@ -0,0 +1,14 @@ +// Copyright 2023 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "DolphinQt/Config/ToolTipControls/ToolTipPushButton.h" + +ToolTipPushButton::ToolTipPushButton(const QString& text, QWidget* parent) + : ToolTipWidget(text, parent) +{ +} + +QPoint ToolTipPushButton::GetToolTipPosition() const +{ + return pos() + QPoint(width() / 2, height() / 2); +} diff --git a/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipPushButton.h b/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipPushButton.h new file mode 100644 index 0000000000..aba4e42785 --- /dev/null +++ b/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipPushButton.h @@ -0,0 +1,19 @@ +// Copyright 2023 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "DolphinQt/Config/ToolTipControls/ToolTipWidget.h" + +#include + +#include "DolphinQt/QtUtils/NonDefaultQPushButton.h" + +class ToolTipPushButton : public ToolTipWidget +{ +public: + explicit ToolTipPushButton(const QString& text = {}, QWidget* parent = nullptr); + +private: + QPoint GetToolTipPosition() const override; +}; diff --git a/Source/Core/DolphinQt/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index 9217cc3788..4ac411b410 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -127,6 +127,7 @@ + @@ -327,6 +328,7 @@ +