DolphinQt: Add ToolTipPushButton.

This commit is contained in:
Admiral H. Curtiss 2023-08-12 21:33:43 +02:00
parent bc47a28653
commit e6c7f4e14b
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
4 changed files with 37 additions and 0 deletions

View File

@ -181,6 +181,8 @@ add_executable(dolphin-emu
Config/ToolTipControls/ToolTipCheckBox.h Config/ToolTipControls/ToolTipCheckBox.h
Config/ToolTipControls/ToolTipComboBox.cpp Config/ToolTipControls/ToolTipComboBox.cpp
Config/ToolTipControls/ToolTipComboBox.h Config/ToolTipControls/ToolTipComboBox.h
Config/ToolTipControls/ToolTipPushButton.cpp
Config/ToolTipControls/ToolTipPushButton.h
Config/ToolTipControls/ToolTipRadioButton.cpp Config/ToolTipControls/ToolTipRadioButton.cpp
Config/ToolTipControls/ToolTipRadioButton.h Config/ToolTipControls/ToolTipRadioButton.h
Config/ToolTipControls/ToolTipSlider.cpp Config/ToolTipControls/ToolTipSlider.cpp

View File

@ -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);
}

View File

@ -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 <QPushButton>
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
class ToolTipPushButton : public ToolTipWidget<NonDefaultQPushButton>
{
public:
explicit ToolTipPushButton(const QString& text = {}, QWidget* parent = nullptr);
private:
QPoint GetToolTipPosition() const override;
};

View File

@ -127,6 +127,7 @@
<ClCompile Include="Config\ToolTipControls\BalloonTip.cpp" /> <ClCompile Include="Config\ToolTipControls\BalloonTip.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipCheckBox.cpp" /> <ClCompile Include="Config\ToolTipControls\ToolTipCheckBox.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipComboBox.cpp" /> <ClCompile Include="Config\ToolTipControls\ToolTipComboBox.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipPushButton.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipRadioButton.cpp" /> <ClCompile Include="Config\ToolTipControls\ToolTipRadioButton.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipSlider.cpp" /> <ClCompile Include="Config\ToolTipControls\ToolTipSlider.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipSpinBox.cpp" /> <ClCompile Include="Config\ToolTipControls\ToolTipSpinBox.cpp" />
@ -327,6 +328,7 @@
<QtMoc Include="Config\ToolTipControls\BalloonTip.h" /> <QtMoc Include="Config\ToolTipControls\BalloonTip.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipCheckBox.h" /> <ClInclude Include="Config\ToolTipControls\ToolTipCheckBox.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipComboBox.h" /> <ClInclude Include="Config\ToolTipControls\ToolTipComboBox.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipPushButton.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipRadioButton.h" /> <ClInclude Include="Config\ToolTipControls\ToolTipRadioButton.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipSlider.h" /> <ClInclude Include="Config\ToolTipControls\ToolTipSlider.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipSpinBox.h" /> <ClInclude Include="Config\ToolTipControls\ToolTipSpinBox.h" />