Files
yacreader/YACReaderLibrary/comic_vine/scraper_scroll_label.cpp
luisangelsm 3709b6e737
Some checks failed
Build / Initialization (push) Has been cancelled
Build / Code Format Validation (push) Has been cancelled
Build / Linux (Qt6) (push) Has been cancelled
Build / Linux (Qt6 + 7zip) (push) Has been cancelled
Build / macOS (Qt6 Universal) (push) Has been cancelled
Build / Windows x64 (Qt6) (push) Has been cancelled
Build / Windows ARM64 (Qt6) (push) Has been cancelled
Build / Docker amd64 Image (push) Has been cancelled
Build / Docker arm64 Image (push) Has been cancelled
Build / Publish Dev Builds (push) Has been cancelled
Build / Publish Release (push) Has been cancelled
Build / Publish YACReader10 Pre-release Builds (push) Has been cancelled
Format includes using clang-format
2026-03-13 18:21:38 +01:00

49 lines
1.2 KiB
C++

#include "scraper_scroll_label.h"
#include <QDesktopServices>
#include <QLabel>
#include <QUrl>
ScraperScrollLabel::ScraperScrollLabel(QWidget *parent)
: QScrollArea(parent)
{
textLabel = new QLabel(this);
textLabel->setWordWrap(true);
textLabel->setMinimumSize(168, 12);
setWidget(textLabel);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
connect(textLabel, &QLabel::linkActivated, this, &ScraperScrollLabel::openLink);
initTheme(this);
}
void ScraperScrollLabel::setAltText(const QString &text)
{
textLabel->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
textLabel->setText(text);
textLabel->adjustSize();
}
void ScraperScrollLabel::setText(const QString &text)
{
textLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
textLabel->setText(text);
textLabel->adjustSize();
}
void ScraperScrollLabel::openLink(const QString &link)
{
QDesktopServices::openUrl(QUrl("http://www.comicvine.com" + link));
}
void ScraperScrollLabel::applyTheme(const Theme &theme)
{
auto metadataScraperDialogTheme = theme.metadataScraperDialog;
textLabel->setStyleSheet(metadataScraperDialogTheme.scraperScrollLabelTextQSS);
setStyleSheet(metadataScraperDialogTheme.scraperScrollLabelScrollAreaQSS);
}