Skip to content

Commit

Permalink
fix: font size don't synchronize changes
Browse files Browse the repository at this point in the history
font size of some widgets don't change when changing font size in dcc

Issue: linuxdeepin#5
  • Loading branch information
wangfei committed Jun 20, 2023
1 parent bab1396 commit c578482
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions app/widgetstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,17 @@ PluginCell::PluginCell(QWidget *parent)
auto layout = new QVBoxLayout(this);
layout->setContentsMargins(UI::Store::leftMargin, UI::Store::topMargin, UI::Store::rightMargin, UI::Store::bottomMargin);
layout->setAlignment(Qt::AlignHCenter);
DFontSizeManager *fontManager = DFontSizeManager::instance();
m_title = new QLabel();
m_title->setObjectName("store-title-label");
{
QFont font;
font.setBold(true);
m_title->setFont(DFontSizeManager::instance()->t5(font));
}
fontManager->bind(m_title, DFontSizeManager::T5, QFont::Bold);
m_title->setAlignment(Qt::AlignHCenter);
layout->addWidget(m_title);
m_description = new QLabel();
m_description->setWordWrap(true);
m_title->setObjectName("store-description-label");
m_description->setAlignment(Qt::AlignHCenter);
{
m_description->setFont(DFontSizeManager::instance()->t8());
}
fontManager->bind(m_description, DFontSizeManager::T8);

QWidget *views = new QWidget();
auto viewsLayout = new QVBoxLayout(views);
Expand Down
6 changes: 3 additions & 3 deletions notification/notification/appbody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ void AppBody::refreshTheme()
if (m_showStyle == OSD::BUBBLEWIDGET) {
m_titleLbl->setOpacity(1.0);
m_bodyLbl->setOpacity(Notify::BubbleOpacity);

m_titleLbl->setFont(DFontSizeManager::instance()->t6());
m_bodyLbl->setFont(DFontSizeManager::instance()->t7());
DFontSizeManager *fontManager = DFontSizeManager::instance();
fontManager->bind(m_titleLbl, DFontSizeManager::T6);
fontManager->bind(m_bodyLbl, DFontSizeManager::T7);
} else {
m_titleLbl->setOpacity(Notify::BubbleOpacity);
m_bodyLbl->setOpacity(1.0);
Expand Down

0 comments on commit c578482

Please sign in to comment.