diff --git a/resources/avatars/fourtf.png b/resources/avatars/fourtf.png new file mode 100644 index 000000000..7749458d9 Binary files /dev/null and b/resources/avatars/fourtf.png differ diff --git a/resources/avatars/pajlada.png b/resources/avatars/pajlada.png new file mode 100644 index 000000000..dd3c88ce3 Binary files /dev/null and b/resources/avatars/pajlada.png differ diff --git a/resources/contributors.txt b/resources/contributors.txt new file mode 100644 index 000000000..027bdadcd --- /dev/null +++ b/resources/contributors.txt @@ -0,0 +1,34 @@ +# To add yourself to this list, or to update one of your fields, send a PR with this file updated +# This list is displayed in the About section of the preferences window +# TODO: Parse this into a CONTRIBUTORS.md too + +fourtf | https://fourtf.com | avatars/fourtf.png | Author, main developer +pajlada | https://pajlada.se | avatars/pajlada.png | Collaborator, co-developer + +Cranken | https://github.com/Cranken | | Contributor +hemirt | https://github.com/hemirt | | Contributor +LajamerrMittisdine | https://github.com/LajamerrMittisdine | | Contributor +coral | https://github.com/coral | | Contributor, design +apa420 | https://github.com/apa420 | | Contributor +DatGuy1 | https://github.com/DatGuy1 | | Contributor +Confuseh | https://github.com/Confuseh | | Contributor +ch-ems | https://github.com/ch-ems | | Contributor +Bur0k | https://github.com/Bur0k | | Contributor +nuuls | https://github.com/nuuls | | Contributor +Chronophylos | https://github.com/Chronophylos | | Contributor +Ckath | https://github.com/Ckath | | Contributor +matijakevic | https://github.com/matijakevic | | Contributor +nforro | https://github.com/nforro | | Contributor +vanolpfan | https://github.com/vanolpfan | | Contributor + +Defman21 | https://github.com/Defman21 | | Documentation +Jarel1337 | https://github.com/Jarel1337 | | Documentation +Ian321 | https://github.com/Ian321 | | Documentation +Yardanico | https://github.com/Yardanico | | Documentation +huti26 | https://github.com/huti26 | | Documentation +chrisduerr | https://github.com/chrisduerr | | Documentation +23rd | https://github.com/23rd | | Documentation +TranRed | https://github.com/TranRed | | Documentation + +# Template +# Name | Link | Avatar (Loaded as a resource) | Title (description of work done). Contributor is what we use for someone who has contributed in general (like sent a programming-related PR) diff --git a/resources/resources.qrc b/resources/resources.qrc index 5625439de..b930ed4b4 100644 --- a/resources/resources.qrc +++ b/resources/resources.qrc @@ -69,6 +69,9 @@ tlds.txt images/menu_black.png images/menu_white.png + contributors.txt + avatars/fourtf.png + avatars/pajlada.png qt.conf diff --git a/src/widgets/settingspages/AboutPage.cpp b/src/widgets/settingspages/AboutPage.cpp index 0ef83a068..f6ecd33c6 100644 --- a/src/widgets/settingspages/AboutPage.cpp +++ b/src/widgets/settingspages/AboutPage.cpp @@ -1,5 +1,6 @@ #include "AboutPage.hpp" +#include "debug/Log.hpp" #include "util/LayoutCreator.hpp" #include "util/RemoveScrollAreaBackground.hpp" #include "widgets/helper/SignalLabel.hpp" @@ -8,6 +9,7 @@ #include #include #include +#include #include #define PIXMAP_WIDTH 500 @@ -104,6 +106,67 @@ AboutPage::AboutPage() l.emplace("Emoji datasource provided by Cal Henderson"); // clang-format on } + + // Contributors + auto contributors = layout.emplace("Contributors"); + { + auto l = contributors.emplace(); + + QFile contributorsFile(":/contributors.txt"); + contributorsFile.open(QFile::ReadOnly); + + QTextStream stream(&contributorsFile); + stream.setCodec("UTF-8"); + + QString line; + + while (stream.readLineInto(&line)) { + if (line.isEmpty() || line.startsWith('#')) { + continue; + } + + QStringList contributorParts = line.split("|"); + + if (contributorParts.size() != 4) { + Log("Missing parts in line '{}'", line); + continue; + } + + QString username = contributorParts[0].trimmed(); + QString url = contributorParts[1].trimmed(); + QString avatarUrl = contributorParts[2].trimmed(); + QString role = contributorParts[3].trimmed(); + + auto *usernameLabel = new QLabel("" + username + ""); + usernameLabel->setOpenExternalLinks(true); + auto *roleLabel = new QLabel(role); + + auto contributorBox2 = l.emplace(); + + const auto addAvatar = [&avatarUrl, &contributorBox2] { + if (!avatarUrl.isEmpty()) { + QPixmap avatarPixmap; + avatarPixmap.load(avatarUrl); + + auto avatar = contributorBox2.emplace(); + avatar->setPixmap(avatarPixmap); + avatar->setFixedSize(64, 64); + avatar->setScaledContents(true); + } + }; + + const auto addLabels = [&contributorBox2, &usernameLabel, &roleLabel] { + auto labelBox = new QVBoxLayout(); + contributorBox2->addLayout(labelBox); + + labelBox->addWidget(usernameLabel); + labelBox->addWidget(roleLabel); + }; + + addLabels(); + addAvatar(); + } + } } layout->addStretch(1);