gui: ship the real icon set, wire toolbar/tray/window icon, rebase onto main
Adwaita-derived (GNOME Project, LGPL-3-or-CC-BY-SA), recoloured per light/dark skin and laid out in IDM's toolbar positions per docs/03-gui-spec.md §1. Licence and per-file provenance recorded in gui/resources/icons/LICENSE. New IconTheme mirrors ThemeManager's colorSchemeChanged hook so a live light/dark switch swaps every action's glyph, not just the QSS. Toolbar/menu actions, the tray icon and the window icon all now use it instead of the SP_ArrowDown placeholder. Install-path notes for PKG filed as R5 in gui/docs/pkg-qa-requests-m1.md. Also rebases lane/gui onto main (13 commits, no gui/ conflicts). Verified: full build clean, all 13 gui ctest targets pass (including gui_no_download_logic), unhappy-path DoD gate PASS against mockd (--drop-connection). Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
#include "rpc/RpcClient.hpp"
|
||||
#include "tray/TrayIcon.hpp"
|
||||
#include "util/Format.hpp"
|
||||
#include "util/IconTheme.hpp"
|
||||
#include "util/Theme.hpp"
|
||||
#include "widgets/DropTargetWidget.hpp"
|
||||
#include "widgets/ProgressDelegate.hpp"
|
||||
@@ -67,8 +68,12 @@ MainWindow::MainWindow(rpc::RpcClient *client, QWidget *parent)
|
||||
offlineBanner_(new QWidget(this)),
|
||||
countsTimer_(new QTimer(this)) {
|
||||
setWindowTitle(tr("Velox Download Manager"));
|
||||
setWindowIcon(IconTheme::appIcon());
|
||||
resize(1040, 600);
|
||||
|
||||
iconTheme_ = new IconTheme(this);
|
||||
connect(iconTheme_, &IconTheme::iconsChanged, this, &MainWindow::applyIcons);
|
||||
|
||||
proxy_->setSourceModel(model_);
|
||||
proxy_->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
||||
@@ -116,6 +121,7 @@ MainWindow::MainWindow(rpc::RpcClient *client, QWidget *parent)
|
||||
setCentralWidget(central);
|
||||
|
||||
buildActions();
|
||||
applyIcons();
|
||||
buildMenus();
|
||||
buildToolBar();
|
||||
buildTray();
|
||||
@@ -205,6 +211,24 @@ void MainWindow::buildActions() {
|
||||
connect(actShow_, &QAction::triggered, this, &MainWindow::showAndRaise);
|
||||
}
|
||||
|
||||
// gui/resources/icons/LICENSE: toolbar-position -> icon-stem mapping. Re-run on
|
||||
// IconTheme::iconsChanged so a live light/dark switch swaps every action's glyph, the
|
||||
// same way ThemeManager swaps the QSS on the same signal.
|
||||
void MainWindow::applyIcons() {
|
||||
actAddUrl_->setIcon(IconTheme::icon(QStringLiteral("add-url")));
|
||||
actResume_->setIcon(IconTheme::icon(QStringLiteral("resume")));
|
||||
actPause_->setIcon(IconTheme::icon(QStringLiteral("pause")));
|
||||
actStop_->setIcon(IconTheme::icon(QStringLiteral("stop-all")));
|
||||
actRemove_->setIcon(IconTheme::icon(QStringLiteral("delete")));
|
||||
actResumeAll_->setIcon(IconTheme::icon(QStringLiteral("resume")));
|
||||
actPauseAll_->setIcon(IconTheme::icon(QStringLiteral("pause")));
|
||||
actProperties_->setIcon(IconTheme::icon(QStringLiteral("properties")));
|
||||
actOptions_->setIcon(IconTheme::icon(QStringLiteral("options")));
|
||||
actScheduler_->setIcon(IconTheme::icon(QStringLiteral("scheduler")));
|
||||
actBatch_->setIcon(IconTheme::icon(QStringLiteral("batch")));
|
||||
actGrabber_->setIcon(IconTheme::icon(QStringLiteral("grabber")));
|
||||
}
|
||||
|
||||
void MainWindow::buildMenus() {
|
||||
QMenu *tasks = menuBar()->addMenu(tr("&Tasks"));
|
||||
tasks->addAction(actAddUrl_);
|
||||
|
||||
@@ -27,6 +27,7 @@ class DownloadTableModel;
|
||||
class CategoryPanel;
|
||||
class TrayIcon;
|
||||
class DropTargetWidget;
|
||||
class IconTheme;
|
||||
#ifdef VELOX_GUI_HAVE_DBUS
|
||||
class GlobalShortcut;
|
||||
#endif
|
||||
@@ -69,6 +70,7 @@ class MainWindow : public QMainWindow {
|
||||
void showAndRaise();
|
||||
void onSettingsChanged(const QJsonObject ¶ms);
|
||||
void onUrlDropped(const QString &url);
|
||||
void applyIcons();
|
||||
|
||||
private:
|
||||
void buildActions();
|
||||
@@ -107,6 +109,7 @@ class MainWindow : public QMainWindow {
|
||||
|
||||
QJsonArray categoriesCache_;
|
||||
QJsonArray queuesCache_;
|
||||
IconTheme *iconTheme_ = nullptr;
|
||||
TrayIcon *trayIcon_ = nullptr;
|
||||
DropTargetWidget *dropTarget_ = nullptr;
|
||||
bool minimizeToTrayEnabled_ = false;
|
||||
|
||||
Reference in New Issue
Block a user