Skip to content

Commit

Permalink
fix(style): update all widgets on font changed
Browse files Browse the repository at this point in the history
feat(theme): read monospace font from config file

Change-Id: I4fc06deaae5b3f44323fccb1290e64f7c45832ae
  • Loading branch information
zccrs committed Nov 1, 2017
1 parent 3a4f7d7 commit d4a65de
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 9 additions & 1 deletion dstyleplugin/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,16 @@ void StylePrivate::_q_removeAnimation()

void StylePrivate::_q_updateAppFont()
{
if (qApp->desktopSettingsAware())
if (qApp->desktopSettingsAware()) {
qApp->setFont(QGuiApplication::font());

for (QWidget *w : qApp->allWidgets()) {
if (!w->isWindow() && w->testAttribute(Qt::WA_StyleSheet)) {
QEvent e(QEvent::ApplicationFontChange);
qApp->sendEvent(w, &e);
}
}
}
}

Style::Style(StyleType style)
Expand Down
5 changes: 4 additions & 1 deletion platformplugin/dplatformintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@ QPlatformWindow *DPlatformIntegration::createPlatformWindow(QWindow *window) con
}

#ifdef Q_OS_LINUX
qDebug() << window << window->type();

if (window->type() == Qt::Widget
|| window->type() == Qt::Window
|| window->type() == Qt::Dialog) {
|| window->type() == Qt::Dialog
|| window->type() == Qt::Popup) {
Q_UNUSED(new WindowEventHook(xw))
}
#endif
Expand Down
4 changes: 4 additions & 0 deletions platformplugin/windoweventhook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ void WindowEventHook::handleClientMessageEvent(const xcb_client_message_event_t

// reset
drag->target_time = XCB_CURRENT_TIME;
} else if (event->type == me->atom(QXcbAtom::_XEMBED)) {
qDebug() << event->data.data32[1] << hex << event->window;
} else {
qDebug() << event->type;

me->QXcbWindow::handleClientMessageEvent(event);
}
}
Expand Down

0 comments on commit d4a65de

Please sign in to comment.