mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 01:53:25 -08:00
[Icons] Migrate UI glyphs to palette-token SVGs
Runtime inversion is not a theming system: it rotates hue, breaks duotone art and mishandles alpha, and a QPixmap snapshot cannot follow a palette change. Redraw the top-level UI glyph set on a 24x24 grid with `currentColor` as the paint token, drop Inkscape/Sodipodi cruft, and delete the icons whose metaphor was duplicated (cogwheel/gear -> settings, scale_balanced -> scales, update.png -> reload). Load the glyphs through `loadThemedIcon` so the engine resolves the token from the palette on every request, and let `themePixmap` use the same resolution for one-shot pixmaps. `loadColorAdjustedPixmap` is gone; every caller now keeps a QIcon, which `SettingsButtonWidget::setButtonIcon` accepts instead of a QPixmap. Content art (mana, counters, countries) keeps its authored colors. Add a render test covering aspect ratio, palette flips, icon modes and high-DPI pixmaps.
This commit is contained in:
parent
339c969db8
commit
95537a8ea8
95 changed files with 535 additions and 9681 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#include "dlg_connect.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../pixel_map_generator.h"
|
||||
#include "../../theme_icon.h"
|
||||
#include "../server/handle_public_servers.h"
|
||||
#include "../server/user/user_info_connection.h"
|
||||
#include "libcockatrice/utility/macros.h"
|
||||
|
|
@ -37,7 +37,7 @@ DlgConnect::DlgConnect(QWidget *parent) : QDialog(parent)
|
|||
previousHosts = new QComboBox(this);
|
||||
|
||||
btnDeleteServer = new QPushButton(this);
|
||||
btnDeleteServer->setIcon(themePixmap(QStringLiteral("icons/remove_row")));
|
||||
btnDeleteServer->setIcon(loadThemedIcon(QStringLiteral("icons/remove_row")));
|
||||
btnDeleteServer->setToolTip(tr("Delete the currently selected saved server"));
|
||||
btnDeleteServer->setFixedWidth(30);
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ DlgConnect::DlgConnect(QWidget *parent) : QDialog(parent)
|
|||
|
||||
hps = new HandlePublicServers(this);
|
||||
btnRefreshServers = new QPushButton(this);
|
||||
btnRefreshServers->setIcon(themePixmap(QStringLiteral("icons/sync")));
|
||||
btnRefreshServers->setIcon(loadThemedIcon(QStringLiteral("icons/sync")));
|
||||
btnRefreshServers->setToolTip(tr("Refresh the server list with known public servers"));
|
||||
btnRefreshServers->setFixedWidth(30);
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ DlgConnect::DlgConnect(QWidget *parent) : QDialog(parent)
|
|||
updateDisplayInfo(previousHosts->currentText());
|
||||
|
||||
btnForgotPassword = new QPushButton(this);
|
||||
btnForgotPassword->setIcon(themePixmap(QStringLiteral("icons/forgot_password")));
|
||||
btnForgotPassword->setIcon(loadThemedIcon(QStringLiteral("icons/forgot_password")));
|
||||
btnForgotPassword->setToolTip(tr("Reset Password"));
|
||||
btnForgotPassword->setFixedWidth(30);
|
||||
connect(btnForgotPassword, &QPushButton::released, this, &DlgConnect::actForgotPassword);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "dlg_edit_tokens.h"
|
||||
|
||||
#include "../../pixel_map_generator.h"
|
||||
#include "../../theme_icon.h"
|
||||
#include "../interface/widgets/utility/get_text_with_max.h"
|
||||
#include "card_database_display_model.h"
|
||||
#include "libcockatrice/card/card_info.h"
|
||||
|
|
@ -107,10 +107,10 @@ DlgEditTokens::DlgEditTokens(QWidget *parent) : QDialog(parent), currentCard(nul
|
|||
&DlgEditTokens::tokenSelectionChanged);
|
||||
|
||||
QAction *aAddToken = new QAction(tr("Add token"), this);
|
||||
aAddToken->setIcon(themePixmap(QStringLiteral("icons/increment")));
|
||||
aAddToken->setIcon(loadThemedIcon(QStringLiteral("icons/increment")));
|
||||
connect(aAddToken, &QAction::triggered, this, &DlgEditTokens::actAddToken);
|
||||
QAction *aRemoveToken = new QAction(tr("Remove token"), this);
|
||||
aRemoveToken->setIcon(themePixmap(QStringLiteral("icons/decrement")));
|
||||
aRemoveToken->setIcon(loadThemedIcon(QStringLiteral("icons/decrement")));
|
||||
connect(aRemoveToken, &QAction::triggered, this, &DlgEditTokens::actRemoveToken);
|
||||
|
||||
auto *databaseToolBar = new QToolBar;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "dlg_manage_sets.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../pixel_map_generator.h"
|
||||
#include "../../theme_icon.h"
|
||||
#include "../interface/card_picture_loader/card_picture_loader.h"
|
||||
#include "../interface/widgets/utility/custom_line_edit.h"
|
||||
#include "libcockatrice/card/database/card_database.h"
|
||||
|
|
@ -57,28 +57,28 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
|
|||
setsEditToolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
|
||||
aTop = new QAction(QString(), this);
|
||||
aTop->setIcon(themePixmap(QStringLiteral("icons/arrow_top_green")));
|
||||
aTop->setIcon(loadThemedIcon(QStringLiteral("icons/arrow_to_top")));
|
||||
aTop->setToolTip(tr("Move selected set to the top"));
|
||||
aTop->setEnabled(false);
|
||||
connect(aTop, &QAction::triggered, this, &WndSets::actTop);
|
||||
setsEditToolBar->addAction(aTop);
|
||||
|
||||
aUp = new QAction(QString(), this);
|
||||
aUp->setIcon(themePixmap(QStringLiteral("icons/arrow_up_green")));
|
||||
aUp->setIcon(loadThemedIcon(QStringLiteral("icons/arrow_up")));
|
||||
aUp->setToolTip(tr("Move selected set up"));
|
||||
aUp->setEnabled(false);
|
||||
connect(aUp, &QAction::triggered, this, &WndSets::actUp);
|
||||
setsEditToolBar->addAction(aUp);
|
||||
|
||||
aDown = new QAction(QString(), this);
|
||||
aDown->setIcon(themePixmap(QStringLiteral("icons/arrow_down_green")));
|
||||
aDown->setIcon(loadThemedIcon(QStringLiteral("icons/arrow_down")));
|
||||
aDown->setToolTip(tr("Move selected set down"));
|
||||
aDown->setEnabled(false);
|
||||
connect(aDown, &QAction::triggered, this, &WndSets::actDown);
|
||||
setsEditToolBar->addAction(aDown);
|
||||
|
||||
aBottom = new QAction(QString(), this);
|
||||
aBottom->setIcon(themePixmap(QStringLiteral("icons/arrow_bottom_green")));
|
||||
aBottom->setIcon(loadThemedIcon(QStringLiteral("icons/arrow_to_bottom")));
|
||||
aBottom->setToolTip(tr("Move selected set to the bottom"));
|
||||
aBottom->setEnabled(false);
|
||||
connect(aBottom, &QAction::triggered, this, &WndSets::actBottom);
|
||||
|
|
@ -88,7 +88,7 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
|
|||
searchField = new LineEditUnfocusable;
|
||||
searchField->setObjectName("searchEdit");
|
||||
searchField->setPlaceholderText(tr("Search by set name, code, type, or release date"));
|
||||
searchField->addAction(themePixmap(QStringLiteral("icons/search")), LineEditUnfocusable::LeadingPosition);
|
||||
searchField->addAction(loadThemedIcon(QStringLiteral("icons/search")), LineEditUnfocusable::LeadingPosition);
|
||||
searchField->setClearButtonEnabled(true);
|
||||
setFocusProxy(searchField);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "dlg_register.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../pixel_map_generator.h"
|
||||
#include "../../theme_icon.h"
|
||||
#include "../server/handle_public_servers.h"
|
||||
#include "../server/user/user_info_connection.h"
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ DlgRegister::DlgRegister(QWidget *parent) : QDialog(parent)
|
|||
previousHosts = new QComboBox(this);
|
||||
|
||||
btnDeleteServer = new QPushButton(this);
|
||||
btnDeleteServer->setIcon(themePixmap(QStringLiteral("icons/remove_row")));
|
||||
btnDeleteServer->setIcon(loadThemedIcon(QStringLiteral("icons/remove_row")));
|
||||
btnDeleteServer->setToolTip(tr("Delete the currently selected saved server"));
|
||||
btnDeleteServer->setFixedWidth(30);
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ DlgRegister::DlgRegister(QWidget *parent) : QDialog(parent)
|
|||
|
||||
hps = new HandlePublicServers(this);
|
||||
btnRefreshServers = new QPushButton(this);
|
||||
btnRefreshServers->setIcon(themePixmap(QStringLiteral("icons/sync")));
|
||||
btnRefreshServers->setIcon(loadThemedIcon(QStringLiteral("icons/sync")));
|
||||
btnRefreshServers->setToolTip(tr("Refresh the server list with known public servers"));
|
||||
btnRefreshServers->setFixedWidth(30);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "settings_view.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../pixel_map_generator.h"
|
||||
#include "../../theme_icon.h"
|
||||
#include "../settings_page/abstract_settings_page.h"
|
||||
#include "../settings_page/appearance_settings_page.h"
|
||||
#include "../settings_page/deck_editor_settings_page.h"
|
||||
|
|
@ -133,7 +133,7 @@ void SettingsView::setupUi()
|
|||
// Search bar
|
||||
searchEdit = new QLineEdit;
|
||||
searchEdit->setClearButtonEnabled(true);
|
||||
searchEdit->addAction(themePixmap(QStringLiteral("icons/search")), QLineEdit::LeadingPosition);
|
||||
searchEdit->addAction(loadThemedIcon(QStringLiteral("icons/search")), QLineEdit::LeadingPosition);
|
||||
searchEdit->installEventFilter(this);
|
||||
connect(searchEdit, &QLineEdit::textChanged, this, &SettingsView::onSearchTextChanged);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue