-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
121 additions
and
63 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
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
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
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
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
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
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
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,36 +1,46 @@ | ||
//============================================================================= | ||
/// Copyright (c) 2019-2020 Advanced Micro Devices, Inc. All rights reserved. | ||
/// \author AMD Developer Tools Team | ||
/// \file | ||
/// \brief Scaling wrapper for QPushButton object. | ||
/// Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved. | ||
/// @author AMD Developer Tools Team | ||
/// @file | ||
/// @brief Scaling wrapper for QPushButton object. | ||
//============================================================================= | ||
|
||
#ifndef QTCOMMON_CUSTOM_WIDGETS_SCALED_PUSHBUTTON_H_ | ||
#define QTCOMMON_CUSTOM_WIDGETS_SCALED_PUSHBUTTON_H_ | ||
|
||
#include <QPushButton> | ||
|
||
/// Wraps the QPushButton and fixes DPI scaling. | ||
/// @brief Wraps the QPushButton and fixes DPI scaling. | ||
class ScaledPushButton : public QPushButton | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
/// Constructor. | ||
/// \param parent The parent object. | ||
/// @brief Constructor. | ||
/// | ||
/// @param parent The parent object. | ||
ScaledPushButton(QWidget* parent = nullptr); | ||
|
||
/// Constructor. | ||
/// \param text The button text. | ||
/// \param parent The parent object. | ||
/// @brief Constructor. | ||
/// | ||
/// @param text The button text. | ||
/// @param parent The parent object. | ||
ScaledPushButton(const QString& text, QWidget* parent = nullptr); | ||
|
||
/// Destructor. | ||
/// @brief Destructor. | ||
virtual ~ScaledPushButton(); | ||
|
||
/// @brief Overridden setIconSize for the QAbstractButton. | ||
/// | ||
/// @param size Maximum size for the icon. Smaller icons will not be scaled up. | ||
void setIconSize(const QSize& size); | ||
|
||
private slots: | ||
/// Callback for when the DPI scale factor changes. | ||
/// @brief Callback for when the DPI scale factor changes. | ||
void OnScaleFactorChanged(); | ||
|
||
private: | ||
QSize base_icon_size_; ///< Base icon size DPI scaling will be calculated from. | ||
}; | ||
|
||
#endif // QTCOMMON_CUSTOM_WIDGETS_SCALED_PUSHBUTTON_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
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
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
Oops, something went wrong.