Mercurial > minori
comparison src/gui/dialog/about.cc @ 367:8d45d892be88
*: instead of pugixml, use Qt XML features
this means we have one extra Qt dependency though...
| author | Paper <paper@tflc.us> |
|---|---|
| date | Sun, 17 Nov 2024 22:55:47 -0500 |
| parents | eac06513db86 |
| children | 6d37a998cf91 |
comparison
equal
deleted
inserted
replaced
| 366:886f66775f31 | 367:8d45d892be88 |
|---|---|
| 3 #include "core/json.h" | 3 #include "core/json.h" |
| 4 #include "core/session.h" | 4 #include "core/session.h" |
| 5 #include "core/strings.h" | 5 #include "core/strings.h" |
| 6 #include "gui/widgets/text.h" | 6 #include "gui/widgets/text.h" |
| 7 | 7 |
| 8 #include "pugixml.hpp" | |
| 9 | |
| 10 #include "utf8proc.h" | 8 #include "utf8proc.h" |
| 11 | 9 #include <toml11/toml.hpp> |
| 12 #include <fmt/core.h> | 10 #include <fmt/core.h> |
| 13 | 11 |
| 14 #include <QCoreApplication> | 12 #include <QCoreApplication> |
| 15 #include <QFont> | 13 #include <QFont> |
| 16 #include <QHBoxLayout> | 14 #include <QHBoxLayout> |
| 28 constexpr size_t array_size(T (&)[N]) { | 26 constexpr size_t array_size(T (&)[N]) { |
| 29 return N; | 27 return N; |
| 30 } | 28 } |
| 31 | 29 |
| 32 static constexpr semver::version fmt_version{FMT_VERSION / 10000, FMT_VERSION / 100 % 100, FMT_VERSION % 100}; | 30 static constexpr semver::version fmt_version{FMT_VERSION / 10000, FMT_VERSION / 100 % 100, FMT_VERSION % 100}; |
| 33 static constexpr semver::version pugixml_version{PUGIXML_VERSION / 1000 % 10, PUGIXML_VERSION / 10 % 100, | |
| 34 PUGIXML_VERSION % 10}; | |
| 35 static constexpr semver::version json_version{NLOHMANN_JSON_VERSION_MAJOR, NLOHMANN_JSON_VERSION_MINOR, | 31 static constexpr semver::version json_version{NLOHMANN_JSON_VERSION_MAJOR, NLOHMANN_JSON_VERSION_MINOR, |
| 36 NLOHMANN_JSON_VERSION_PATCH}; | 32 NLOHMANN_JSON_VERSION_PATCH}; |
| 37 static constexpr semver::version semver_version{SEMVER_VERSION_MAJOR, SEMVER_VERSION_MINOR, SEMVER_VERSION_PATCH}; | 33 static constexpr semver::version semver_version{SEMVER_VERSION_MAJOR, SEMVER_VERSION_MINOR, SEMVER_VERSION_PATCH}; |
| 34 static constexpr semver::version toml11_version{TOML11_VERSION_MAJOR, TOML11_VERSION_MINOR, TOML11_VERSION_PATCH}; | |
| 38 static constexpr semver::version fugue_icons_version{3, 5, 6}; | 35 static constexpr semver::version fugue_icons_version{3, 5, 6}; |
| 39 | 36 |
| 40 const char* get_curl_version() { | 37 const char* get_curl_version() { |
| 41 const curl_version_info_data* data = curl_version_info(CURLVERSION_NOW); | 38 const curl_version_info_data* data = curl_version_info(CURLVERSION_NOW); |
| 42 return data->version; | 39 return data->version; |
| 49 "<p><strong>Third party components:</strong><br>" | 46 "<p><strong>Third party components:</strong><br>" |
| 50 "<a href=\"https://curl.se/\">libcurl v{}</a>, " | 47 "<a href=\"https://curl.se/\">libcurl v{}</a>, " |
| 51 "<a href=\"https://p.yusukekamiyamane.com/\">Fugue Icons v{}</a>, " | 48 "<a href=\"https://p.yusukekamiyamane.com/\">Fugue Icons v{}</a>, " |
| 52 "<a href=\"https://github.com/erengy/anitomy\">Anitomy</a>, " | 49 "<a href=\"https://github.com/erengy/anitomy\">Anitomy</a>, " |
| 53 "<a href=\"https://github.com/nlohmann/json\">JSON for Modern C++ v{}</a>, " | 50 "<a href=\"https://github.com/nlohmann/json\">JSON for Modern C++ v{}</a>, " |
| 54 "<a href=\"https://pugixml.org/\">pugixml v{}</a>, " | |
| 55 "<a href=\"https://github.com/Neargye/semver\">semver v{}</a>, " | 51 "<a href=\"https://github.com/Neargye/semver\">semver v{}</a>, " |
| 56 "<a href=\"http://juliastrings.github.io/utf8proc/\">utf8proc v{}</a>, " | 52 "<a href=\"http://juliastrings.github.io/utf8proc/\">utf8proc v{}</a>, " |
| 57 "<a href=\"https://github.com/fmtlib/fmt\">fmt v{}</a>, " | 53 "<a href=\"https://github.com/fmtlib/fmt\">fmt v{}</a>, " |
| 58 "parts of <a href=\"https://github.com/erengy/anisthesia\">Anisthesia</a>" | 54 "<a href=\"https://github.com/ToruNiina/toml11\">toml11 v{}</a>, " |
| 55 "and parts of <a href=\"https://github.com/erengy/anisthesia\">Anisthesia</a>" | |
| 59 "</p>" | 56 "</p>" |
| 60 "<span><strong>Special thanks:</strong></span>" | 57 "<span><strong>Special thanks:</strong></span>" |
| 61 "<ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 15px; margin-right: 0px; -qt-list-indent:0;\">" | 58 "<ul style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 15px; margin-right: 0px; -qt-list-indent:0;\">" |
| 62 "<li><strong>Eren Okka</strong> for creating <a href=\"https://taiga.moe/\">Taiga</a></li>" | 59 "<li><strong>Eren Okka</strong> for creating <a href=\"https://taiga.moe/\">Taiga</a></li>" |
| 63 "<li><strong>Alex Huszagh</strong> and <strong>Colin Duquesnoy</strong> for creating BreezeStyleSheets, on which the dark theme in this program is based off of</li>" | 60 "<li><strong>Alex Huszagh</strong> and <strong>Colin Duquesnoy</strong> for creating BreezeStyleSheets, on which the dark theme in this program is based off of</li>" |
| 72 setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); | 69 setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); |
| 73 setAutoFillBackground(true); | 70 setAutoFillBackground(true); |
| 74 | 71 |
| 75 QVBoxLayout* layout = new QVBoxLayout(this); | 72 QVBoxLayout* layout = new QVBoxLayout(this); |
| 76 | 73 |
| 77 std::string html = fmt::format(about_template, session.version.to_string(), get_curl_version(), fugue_icons_version.to_string(), json_version.to_string(), pugixml_version.to_string(), semver_version.to_string(), utf8proc_version(), fmt_version.to_string()); | 74 std::string html = fmt::format(about_template, session.version.to_string(), get_curl_version(), fugue_icons_version.to_string(), json_version.to_string(), semver_version.to_string(), utf8proc_version(), fmt_version.to_string(), toml11_version.to_string()); |
| 78 | 75 |
| 79 setBackgroundRole(QPalette::Base); | 76 setBackgroundRole(QPalette::Base); |
| 80 | 77 |
| 81 { | 78 { |
| 82 QTextBrowser* paragraph = new QTextBrowser(this); | 79 QTextBrowser* paragraph = new QTextBrowser(this); |
