Add HelpIcon

A QLabel consisting of a question mark icon and tooltip
This commit is contained in:
WarmUpTill
2024-06-06 19:41:19 +02:00
committed by WarmUpTill
parent 0e4b000fb1
commit 7e1d20031c
13 changed files with 57 additions and 63 deletions

19
lib/utils/help-icon.cpp Normal file
View 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