mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-06 10:03:26 -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
|
|
@ -1,5 +1,7 @@
|
|||
#include "deck_preview_tag_addition_widget.h"
|
||||
|
||||
#include "../../interface/theme_manager.h"
|
||||
|
||||
#include <QBrush>
|
||||
#include <QColor>
|
||||
#include <QFlags>
|
||||
|
|
@ -65,8 +67,9 @@ void DeckPreviewTagAdditionWidget::paintEvent(QPaintEvent *event)
|
|||
painter.setPen(borderPen);
|
||||
painter.drawRect(rect().adjusted(0, 0, -1, -1)); // Adjust for pen width
|
||||
|
||||
// Calculate font size based on widget height
|
||||
QFont font = painter.font();
|
||||
// Calculate font size based on widget height. Family comes from the
|
||||
// InterfaceDefault theme role; the height-derived size stays as before.
|
||||
QFont font = themeManager->appFont(AppFont::InterfaceDefault);
|
||||
int fontSize = std::max(10, height() / 2); // Ensure a minimum font size of 10
|
||||
font.setPointSize(fontSize);
|
||||
painter.setFont(font);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include "deck_preview_tag_display_widget.h"
|
||||
|
||||
#include "../../interface/theme_manager.h"
|
||||
|
||||
#include <QBrush>
|
||||
#include <QColor>
|
||||
#include <QFlags>
|
||||
|
|
@ -117,8 +119,9 @@ void DeckPreviewTagDisplayWidget::paintEvent(QPaintEvent *event)
|
|||
painter.setPen(borderPen);
|
||||
painter.drawRect(rect().adjusted(0, 0, -1, -1));
|
||||
|
||||
// Calculate font size based on widget height
|
||||
QFont font = painter.font();
|
||||
// Calculate font size based on widget height. Family comes from the
|
||||
// InterfaceDefault theme role; the height-derived size stays as before.
|
||||
QFont font = themeManager->appFont(AppFont::InterfaceDefault);
|
||||
int fontSize = std::max(10, height() / 2); // Ensure a minimum font size of 10
|
||||
font.setPointSize(fontSize);
|
||||
painter.setFont(font);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue