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

View File

@@ -1,7 +1,7 @@
#include "macro-condition-folder.hpp"
#include "help-icon.hpp"
#include "macro-helpers.hpp"
#include "layout-helpers.hpp"
#include "ui-helpers.hpp"
#include <QDir>
#include <QFileInfo>
@@ -282,16 +282,6 @@ MacroConditionFolderEdit::MacroConditionFolderEdit(
_regex(new RegexConfigWidget(this, false)),
_filter(new VariableLineEdit(this))
{
QString path = GetThemeTypeName() == "Light"
? ":/res/images/help.svg"
: ":/res/images/help_light.svg";
QIcon icon(path);
QPixmap pixmap = icon.pixmap(QSize(16, 16));
auto tooltipLabel = new QLabel(this);
tooltipLabel->setPixmap(pixmap);
tooltipLabel->setToolTip(
obs_module_text("AdvSceneSwitcher.condition.folder.tooltip"));
populateConditions(_conditions);
QWidget::connect(_conditions, SIGNAL(currentIndexChanged(int)), this,
@@ -306,6 +296,9 @@ MacroConditionFolderEdit::MacroConditionFolderEdit(
QWidget::connect(_filter, SIGNAL(editingFinished()), this,
SLOT(FilterChanged()));
auto tooltipLabel = new HelpIcon(
obs_module_text("AdvSceneSwitcher.condition.folder.tooltip"));
const std::unordered_map<std::string, QWidget *> widgetPlaceholders = {
{"{{conditions}}", _conditions}, {"{{folder}}", _folder},
{"{{tooltip}}", tooltipLabel}, {"{{regex}}", _regex},