Mercurial > minori
changeset 255:fe702c8f161f
*: whatever
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 07 Feb 2024 17:04:06 -0500 |
parents | d14f8e0e40c3 |
children | 6f3d193cb4b7 |
files | Makefile.am include/gui/pages/seasons.h rc/icons/icons.qrc src/gui/dialog/about.cc src/gui/pages/seasons.cc src/gui/widgets/anime_button.cc src/gui/widgets/poster.cc src/gui/window.cc |
diffstat | 8 files changed, 99 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile.am Wed Feb 07 07:57:37 2024 -0500 +++ b/Makefile.am Wed Feb 07 17:04:06 2024 -0500 @@ -27,6 +27,9 @@ minori_icons_png = \ $(top_srcdir)/rc/icons/16x16/arrow-circle-315.png \ $(top_srcdir)/rc/icons/16x16/calendar.png \ + $(top_srcdir)/rc/icons/16x16/calendar-previous.png \ + $(top_srcdir)/rc/icons/16x16/calendar-next.png \ + $(top_srcdir)/rc/icons/16x16/category.png \ $(top_srcdir)/rc/icons/16x16/chart.png \ $(top_srcdir)/rc/icons/16x16/clock-history-frame.png \ $(top_srcdir)/rc/icons/16x16/cross-button.png \ @@ -37,6 +40,8 @@ $(top_srcdir)/rc/icons/16x16/magnifier.png \ $(top_srcdir)/rc/icons/16x16/navigation-270-button.png \ $(top_srcdir)/rc/icons/16x16/plus-button.png \ + $(top_srcdir)/rc/icons/16x16/sort-quantity-descending.png \ + $(top_srcdir)/rc/icons/16x16/ui-scroll-pane-detail.png \ $(top_srcdir)/rc/icons/24x24/application-export.png \ $(top_srcdir)/rc/icons/24x24/application-sidebar-list.png \ $(top_srcdir)/rc/icons/24x24/arrow-circle-double-135.png \
--- a/include/gui/pages/seasons.h Wed Feb 07 07:57:37 2024 -0500 +++ b/include/gui/pages/seasons.h Wed Feb 07 17:04:06 2024 -0500 @@ -7,13 +7,13 @@ class QResizeEvent; class SeasonsPage final : public QWidget { - Q_OBJECT + Q_OBJECT - public: - SeasonsPage(QWidget* parent = nullptr); +public: + SeasonsPage(QWidget* parent = nullptr); - protected: - QListWidget* buttons = nullptr; +protected: + QListWidget* buttons = nullptr; }; #endif // __gui__pages__seasons_h
--- a/rc/icons/icons.qrc Wed Feb 07 07:57:37 2024 -0500 +++ b/rc/icons/icons.qrc Wed Feb 07 17:04:06 2024 -0500 @@ -2,7 +2,10 @@ <qresource prefix="icons/"> <file>favicon.png</file> <file>16x16/arrow-circle-315.png</file> + <file>16x16/category.png</file> <file>16x16/calendar.png</file> + <file>16x16/calendar-next.png</file> + <file>16x16/calendar-previous.png</file> <file>16x16/chart.png</file> <file>16x16/clock-history-frame.png</file> <file>16x16/cross-button.png</file> @@ -13,6 +16,8 @@ <file>16x16/magnifier.png</file> <file>16x16/navigation-270-button.png</file> <file>16x16/plus-button.png</file> + <file>16x16/sort-quantity-descending.png</file> + <file>16x16/ui-scroll-pane-detail.png</file> <file>24x24/application-export.png</file> <file>24x24/application-sidebar-list.png</file> <file>24x24/arrow-circle-double-135.png</file>
--- a/src/gui/dialog/about.cc Wed Feb 07 07:57:37 2024 -0500 +++ b/src/gui/dialog/about.cc Wed Feb 07 17:04:06 2024 -0500 @@ -20,16 +20,9 @@ return N; } -/* Ahhh, my dumb little hack to get this to be constexpr :) */ -static constexpr const char pugixml_version[] = { - PUGIXML_VERSION / 1000 % 10 + '0', /* Major */ - '.', - PUGIXML_VERSION / 100 % 10 + '0', /* Minor */ - PUGIXML_VERSION / 10 % 10 + '0', - '.', - PUGIXML_VERSION % 10 + '0', /* Patch */ - '\0' -}; +static constexpr semver::version pugixml_version{PUGIXML_VERSION / 1000 % 10, PUGIXML_VERSION / 10 % 100, PUGIXML_VERSION % 10}; +static constexpr semver::version json_version{NLOHMANN_JSON_VERSION_MAJOR, NLOHMANN_JSON_VERSION_MINOR, NLOHMANN_JSON_VERSION_PATCH}; +static constexpr semver::version semver_version{SEMVER_VERSION_MAJOR, SEMVER_VERSION_MINOR, SEMVER_VERSION_PATCH}; const char* get_curl_version() { const curl_version_info_data* data = curl_version_info(CURLVERSION_NOW); @@ -60,13 +53,13 @@ ", " "<a href=\"https://github.com/erengy/anitomy\">Anitomy</a>" ", " - "<a href=\"https://github.com/nlohmann/json\">JSON for Modern C++ v" + QString::number(NLOHMANN_JSON_VERSION_MAJOR) + "." + - QString::number(NLOHMANN_JSON_VERSION_MINOR) + "." + - QString::number(NLOHMANN_JSON_VERSION_PATCH) + "</a>" + "<a href=\"https://github.com/nlohmann/json\">JSON for Modern C++ v" + Strings::ToQString(json_version.to_string()) + "</a>" ", " - "<a href=\"https://pugixml.org/\">pugixml v" + pugixml_version + "</a>" + "<a href=\"https://pugixml.org/\">pugixml v" + Strings::ToQString(pugixml_version.to_string()) + "</a>" ", " "<a href=\"https://github.com/pulzed/mINI\">mINI v0.9.14</a>" + ", " + "<a href=\"https://github.com/Neargye/semver\">semver v" + Strings::ToQString(semver_version.to_string()) + "</a>" " </p>" "<span>" "<strong>" + tr("Special thanks:") + "</strong>"
--- a/src/gui/pages/seasons.cc Wed Feb 07 07:57:37 2024 -0500 +++ b/src/gui/pages/seasons.cc Wed Feb 07 17:04:06 2024 -0500 @@ -9,6 +9,8 @@ #include <QFrame> #include <QListWidget> #include <QListWidgetItem> +#include <QMenu> +#include <QToolButton> SeasonsPage::SeasonsPage(QWidget* parent) : QWidget(parent) { QVBoxLayout* full_layout = new QVBoxLayout(this); @@ -21,25 +23,87 @@ toolbar->setMovable(false); { - /* this needs to be stored somewhere to replicate Taiga's - "timer" feature */ - toolbar->addAction("Aids"); + { + QAction* action = new QAction(toolbar); + action->setIcon(QIcon(":/icons/16x16/calendar-previous.png")); + action->setToolTip(tr("Previous season")); + toolbar->addAction(action); + } + + { + QAction* action = new QAction(toolbar); + action->setIcon(QIcon(":/icons/16x16/calendar-next.png")); + action->setToolTip(tr("Next season")); + toolbar->addAction(action); + } + + toolbar->addAction(QIcon(":/icons/16x16/calendar.png"), "Fall 2024"); // this must be named the name of the season + } + + toolbar->addSeparator(); + + { + toolbar->addAction(QIcon(":/icons/16x16/arrow-circle-315.png"), tr("Refresh data")); } toolbar->addSeparator(); { - toolbar->addAction(QIcon(":/icons/16x16/navigation-270-button.png"), tr("Download &marked torrents")); + QToolButton* button = new QToolButton(toolbar); + + { + /* links */ + QMenu* menu = new QMenu(button); + menu->addAction("Airing status"); + menu->addAction("List status"); + menu->addAction("Type"); + button->setMenu(menu); + } + + button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + button->setIcon(QIcon(":/icons/16x16/category.png")); + button->setText("Group by:"); + button->setPopupMode(QToolButton::InstantPopup); + toolbar->addWidget(button); } { - toolbar->addAction(QIcon(":/icons/16x16/cross-button.png"), tr("&Discard all")); + QToolButton* button = new QToolButton(toolbar); + + { + /* links */ + QMenu* menu = new QMenu(button); + menu->addAction("Airing date"); + menu->addAction("Episodes"); + menu->addAction("Popularity"); + menu->addAction("Score"); + menu->addAction("Title"); + button->setMenu(menu); + } + + button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + button->setIcon(QIcon(":/icons/16x16/sort-quantity-descending.png")); + button->setText("Sort by:"); + button->setPopupMode(QToolButton::InstantPopup); + toolbar->addWidget(button); } - toolbar->addSeparator(); + { + QToolButton* button = new QToolButton(toolbar); - { - toolbar->addAction(QIcon(":/icons/16x16/gear.png"), tr("&Settings")); + { + /* links */ + QMenu* menu = new QMenu(button); + menu->addAction("Images"); + menu->addAction("Details"); + button->setMenu(menu); + } + + button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + button->setIcon(QIcon(":/icons/16x16/ui-scroll-pane-detail.png")); + button->setText("View:"); + button->setPopupMode(QToolButton::InstantPopup); + toolbar->addWidget(button); } full_layout->addWidget(toolbar);
--- a/src/gui/widgets/anime_button.cc Wed Feb 07 07:57:37 2024 -0500 +++ b/src/gui/widgets/anime_button.cc Wed Feb 07 17:04:06 2024 -0500 @@ -46,7 +46,7 @@ _title = new QLabel("", misc_section); _title->setAutoFillBackground(true); _title->setContentsMargins(4, 4, 4, 4); - _title->setStyleSheet("background-color: rgba(0, 245, 25, 25);"); + _title->setStyleSheet("background-color: rgba(0, 245, 25, 50);"); { QFont fnt(_title->font()); fnt.setWeight(QFont::Bold); @@ -54,8 +54,7 @@ } misc_layout->addWidget(_title); - /* need to make a separate "labelled paragraph" for this */ - _info = new TextWidgets::LabelledParagraph(tr("Aired:\nEpisodes:\nGenres:\nProducers:\nScore:\nPopularity:"), "\n\n\n\n", misc_section); + _info = new TextWidgets::LabelledParagraph(tr("Aired:\nEpisodes:\nGenres:\nProducers:\nScore:\nPopularity:"), "\n\n\n\n\n", misc_section); { QFont fnt(_info->GetLabels()->font()); fnt.setWeight(QFont::Bold);
--- a/src/gui/widgets/poster.cc Wed Feb 07 07:57:37 2024 -0500 +++ b/src/gui/widgets/poster.cc Wed Feb 07 17:04:06 2024 -0500 @@ -35,6 +35,7 @@ } void Poster::SetAnime(const Anime::Anime& anime) { + /* todo: only download on showEvent() */ { HTTP::GetThread* thread = new HTTP::GetThread(anime.GetPosterUrl(), {}, this);