Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
Source/Core/DolphinQt/Config/ToolTipControls/ToolTipPushButton.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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
19
Source/Core/DolphinQt/Config/ToolTipControls/ToolTipPushButton.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
| }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters