mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 17:43:23 -08:00
[Fonts] Migrate DeckList and InterfaceDefault surfaces to theme roles
This commit is contained in:
parent
8bede27158
commit
e2e12a3743
44 changed files with 393 additions and 75 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "../deck_share/shared_deck_preview_widget.h"
|
||||
#include "../general/layout_containers/flow_widget.h"
|
||||
#include "../interface/theme_manager.h"
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QDateTime>
|
||||
|
|
@ -34,10 +35,17 @@ DlgSharedDecksPreview::DlgSharedDecksPreview(QWidget *parent,
|
|||
// QLabels render AutoText and markup would otherwise be shown as rich text.
|
||||
auto *titleLabel =
|
||||
new QLabel(tr("Share: %1").arg((shareName.isEmpty() ? tr("Untitled") : shareName).toHtmlEscaped()), this);
|
||||
QFont titleFont = titleLabel->font();
|
||||
// Family comes from the InterfaceDefault theme role; the +2 size and bold stay caller-side.
|
||||
QFont titleFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||
titleFont.setBold(true);
|
||||
titleFont.setPointSize(titleFont.pointSize() + 2);
|
||||
titleLabel->setFont(titleFont);
|
||||
connect(themeManager, &ThemeManager::fontsChanged, this, [this, titleLabel]() {
|
||||
QFont refreshedFont = themeManager->appFont(AppFont::InterfaceDefault);
|
||||
refreshedFont.setBold(true);
|
||||
refreshedFont.setPointSize(refreshedFont.pointSize() + 2);
|
||||
titleLabel->setFont(refreshedFont);
|
||||
});
|
||||
mainLayout->addWidget(titleLabel);
|
||||
|
||||
if (!serverText.isEmpty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue