2018-01-12 23:09:05 +01:00
|
|
|
#include "aboutpage.hpp"
|
|
|
|
|
2018-01-16 00:26:04 +01:00
|
|
|
#include "util/layoutcreator.hpp"
|
2018-01-13 00:04:47 +01:00
|
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
|
|
#define PIXMAP_WIDTH 500
|
|
|
|
|
2018-01-12 23:09:05 +01:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
|
|
|
namespace settingspages {
|
|
|
|
|
|
|
|
AboutPage::AboutPage()
|
|
|
|
: SettingsPage("About", ":/images/about.svg")
|
|
|
|
{
|
2018-01-13 00:04:47 +01:00
|
|
|
util::LayoutCreator<AboutPage> layoutCreator(this);
|
|
|
|
|
2018-01-13 02:00:02 +01:00
|
|
|
auto layout = layoutCreator.emplace<QVBoxLayout>().withoutMargin();
|
2018-01-13 00:04:47 +01:00
|
|
|
{
|
|
|
|
QPixmap pixmap;
|
|
|
|
pixmap.load(":/images/aboutlogo.png");
|
|
|
|
|
|
|
|
auto logo = layout.emplace<QLabel>().assign(&this->logo);
|
|
|
|
logo->setPixmap(pixmap);
|
|
|
|
logo->setFixedSize(PIXMAP_WIDTH, PIXMAP_WIDTH * pixmap.height() / pixmap.width());
|
|
|
|
logo->setScaledContents(true);
|
|
|
|
|
|
|
|
// this does nothing
|
|
|
|
// QPalette palette;
|
|
|
|
// palette.setColor(QPalette::Text, Qt::white);
|
|
|
|
// palette.setColor(QPalette::Link, "#a5cdff");
|
|
|
|
// palette.setColor(QPalette::LinkVisited, "#a5cdff");
|
|
|
|
|
|
|
|
auto created = layout.emplace<QLabel>();
|
|
|
|
created->setText(
|
|
|
|
"Twitch Chat Client created by <a href=\"https://github.com/fourtf\">fourtf</a>");
|
|
|
|
created->setTextFormat(Qt::RichText);
|
|
|
|
created->setTextInteractionFlags(Qt::TextBrowserInteraction |
|
|
|
|
Qt::LinksAccessibleByKeyboard |
|
|
|
|
Qt::LinksAccessibleByKeyboard);
|
|
|
|
created->setOpenExternalLinks(true);
|
|
|
|
// created->setPalette(palette);
|
|
|
|
|
|
|
|
auto github = layout.emplace<QLabel>();
|
|
|
|
github->setText(
|
|
|
|
"<a href=\"https://github.com/fourtf/chatterino2\">Chatterino on Github</a>");
|
|
|
|
github->setTextFormat(Qt::RichText);
|
|
|
|
github->setTextInteractionFlags(Qt::TextBrowserInteraction | Qt::LinksAccessibleByKeyboard |
|
|
|
|
Qt::LinksAccessibleByKeyboard);
|
|
|
|
github->setOpenExternalLinks(true);
|
|
|
|
// github->setPalette(palette);
|
|
|
|
}
|
|
|
|
layout->addStretch(1);
|
2018-01-12 23:09:05 +01:00
|
|
|
}
|
|
|
|
} // namespace settingspages
|
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|