diff --git a/src/widgets/settingspages/aboutpage.cpp b/src/widgets/settingspages/aboutpage.cpp index 84bd879ac..6c4ec6ba5 100644 --- a/src/widgets/settingspages/aboutpage.cpp +++ b/src/widgets/settingspages/aboutpage.cpp @@ -1,5 +1,12 @@ #include "aboutpage.hpp" +#include + +#include +#include + +#define PIXMAP_WIDTH 500 + namespace chatterino { namespace widgets { namespace settingspages { @@ -7,6 +14,44 @@ namespace settingspages { AboutPage::AboutPage() : SettingsPage("About", ":/images/about.svg") { + util::LayoutCreator layoutCreator(this); + + auto layout = layoutCreator.emplace(); + { + QPixmap pixmap; + pixmap.load(":/images/aboutlogo.png"); + + auto logo = layout.emplace().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(); + created->setText( + "Twitch Chat Client created by fourtf"); + created->setTextFormat(Qt::RichText); + created->setTextInteractionFlags(Qt::TextBrowserInteraction | + Qt::LinksAccessibleByKeyboard | + Qt::LinksAccessibleByKeyboard); + created->setOpenExternalLinks(true); + // created->setPalette(palette); + + auto github = layout.emplace(); + github->setText( + "Chatterino on Github"); + github->setTextFormat(Qt::RichText); + github->setTextInteractionFlags(Qt::TextBrowserInteraction | Qt::LinksAccessibleByKeyboard | + Qt::LinksAccessibleByKeyboard); + github->setOpenExternalLinks(true); + // github->setPalette(palette); + } + layout->addStretch(1); } } // namespace settingspages } // namespace widgets diff --git a/src/widgets/settingspages/aboutpage.hpp b/src/widgets/settingspages/aboutpage.hpp index e838bb6c8..3f27f552a 100644 --- a/src/widgets/settingspages/aboutpage.hpp +++ b/src/widgets/settingspages/aboutpage.hpp @@ -2,6 +2,8 @@ #include "widgets/settingspages/settingspage.hpp" +class QLabel; + namespace chatterino { namespace widgets { namespace settingspages { @@ -10,6 +12,9 @@ class AboutPage : public SettingsPage { public: AboutPage(); + +private: + QLabel *logo; }; } // namespace settingspages } // namespace widgets diff --git a/src/widgets/settingspages/commandpage.cpp b/src/widgets/settingspages/commandpage.cpp index 63a3c13fe..27e8cb0c0 100644 --- a/src/widgets/settingspages/commandpage.cpp +++ b/src/widgets/settingspages/commandpage.cpp @@ -22,7 +22,7 @@ CommandPage::CommandPage() : SettingsPage("Commands", ":/images/commands.svg") { util::LayoutCreator layoutCreator(this); - auto layout = layoutCreator.emplace(); + auto layout = layoutCreator.emplace().withoutMargin(); layout.emplace(TEXT)->setWordWrap(true);