Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #12100 from AdmiralCurtiss/tooltip-pushbutton
DolphinQt: Add ToolTipPushButton.
  • Loading branch information
AdmiralCurtiss committed Aug 13, 2023
2 parents 4549091 + e6c7f4e commit 2537f4d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Core/DolphinQt/CMakeLists.txt
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions 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);
}
19 changes: 19 additions & 0 deletions 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 <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;
};
2 changes: 2 additions & 0 deletions Source/Core/DolphinQt/DolphinQt.vcxproj
Expand Up @@ -127,6 +127,7 @@
<ClCompile Include="Config\ToolTipControls\BalloonTip.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipCheckBox.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipComboBox.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipPushButton.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipRadioButton.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipSlider.cpp" />
<ClCompile Include="Config\ToolTipControls\ToolTipSpinBox.cpp" />
Expand Down Expand Up @@ -327,6 +328,7 @@
<QtMoc Include="Config\ToolTipControls\BalloonTip.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipCheckBox.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipComboBox.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipPushButton.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipRadioButton.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipSlider.h" />
<ClInclude Include="Config\ToolTipControls\ToolTipSpinBox.h" />
Expand Down

0 comments on commit 2537f4d

Please sign in to comment.