mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-14 13:18:36 -05:00
Add HelpIcon
A QLabel consisting of a question mark icon and tooltip
This commit is contained in:
19
lib/utils/help-icon.cpp
Normal file
19
lib/utils/help-icon.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "help-icon.hpp"
|
||||
#include "ui-helpers.hpp"
|
||||
|
||||
namespace advss {
|
||||
|
||||
HelpIcon::HelpIcon(const QString &tooltip, QWidget *parent) : QLabel(parent)
|
||||
{
|
||||
auto path = GetThemeTypeName() == "Light"
|
||||
? ":/res/images/help.svg"
|
||||
: ":/res/images/help_light.svg";
|
||||
QIcon icon(path);
|
||||
QPixmap pixmap = icon.pixmap(QSize(16, 16));
|
||||
setPixmap(pixmap);
|
||||
if (!tooltip.isEmpty()) {
|
||||
setToolTip(tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace advss
|
||||
Reference in New Issue
Block a user