mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 20:13:24 -08:00
[Icons] Give sharing and pinning their semantic families
Sharing is an informational act: the app already tints reveal and make-public with the informational family, so the deck storage share action, the replay share-code action and the visual deck storage share button follow it. The printing-selector pin badge marks a card as pinned. Paint it with the marked family, the same one used for a mark left on a card, instead of leaving it neutral.
This commit is contained in:
parent
97d5787d76
commit
d073a007bb
4 changed files with 5 additions and 4 deletions
|
|
@ -430,7 +430,8 @@ static QPixmap composePinBadgePixmap(const QSize &logicalSize, qreal devicePixel
|
|||
// Inset the glyph so the backdrop reads as a badge around it, not as a border.
|
||||
const int inset = qRound(logicalSize.width() * 0.16);
|
||||
const QSize glyphSize = logicalSize - QSize(inset * 2, inset * 2);
|
||||
const QPixmap glyph = loadThemedIcon(QStringLiteral("icons/pin")).pixmap(glyphSize, devicePixelRatio);
|
||||
const QPixmap glyph =
|
||||
loadThemedIcon(QStringLiteral("icons/pin"), AppColor::Marked).pixmap(glyphSize, devicePixelRatio);
|
||||
if (glyph.isNull()) {
|
||||
// Let the caller fall back to the textual badge instead of drawing an empty panel.
|
||||
return QPixmap();
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ TabDeckStorage::TabDeckStorage(TabSupervisor *_tabSupervisor,
|
|||
connect(aDeleteRemoteDeck, &QAction::triggered, this, &TabDeckStorage::actDeleteRemoteDeck);
|
||||
|
||||
aShareDecks = new QAction(this);
|
||||
aShareDecks->setIcon(loadThemedIcon(QStringLiteral("icons/share")));
|
||||
aShareDecks->setIcon(loadThemedIcon(QStringLiteral("icons/share"), AppColor::Informational));
|
||||
connect(aShareDecks, &QAction::triggered, this, &TabDeckStorage::actShareDecks);
|
||||
|
||||
aPublishDeck = new QAction(this);
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ QGroupBox *TabReplays::createRightLayout()
|
|||
loadThemedIcon(QStringLiteral("icons/remove_row"), AppColor::Negative, IconStyle::Sticker));
|
||||
connect(aDeleteRemoteReplay, &QAction::triggered, this, &TabReplays::actDeleteRemoteReplay);
|
||||
aGetReplayCode = new QAction(this);
|
||||
aGetReplayCode->setIcon(loadThemedIcon(QStringLiteral("icons/share")));
|
||||
aGetReplayCode->setIcon(loadThemedIcon(QStringLiteral("icons/share"), AppColor::Informational));
|
||||
connect(aGetReplayCode, &QAction::triggered, this, &TabReplays::actGetReplayCode);
|
||||
|
||||
aSubmitReplayCode = new QAction(this);
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
|
|||
connect(refreshButton, &QPushButton::clicked, this, &VisualDeckStorageWidget::refreshIfPossible);
|
||||
|
||||
shareButton = new QToolButton(this);
|
||||
shareButton->setIcon(loadThemedIcon(QStringLiteral("icons/share")));
|
||||
shareButton->setIcon(loadThemedIcon(QStringLiteral("icons/share"), AppColor::Informational));
|
||||
shareButton->setFixedSize(32, 32);
|
||||
shareButton->setVisible(false);
|
||||
connect(shareButton, &QPushButton::clicked, this, &VisualDeckStorageWidget::shareRequested);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue