SceneSwitcher/lib/utils/help-icon.cpp
WarmUpTill 7e1d20031c Add HelpIcon
A QLabel consisting of a question mark icon and tooltip
2024-06-07 21:44:21 +02:00

20 lines
428 B
C++

#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