Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkgui
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkgui.

Source-pull-request: linuxdeepin/dtkgui#217
  • Loading branch information
deepin-ci-robot committed Jan 6, 2024
1 parent 2f0d0d4 commit 0f264d7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/kernel/dplatformhandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,17 @@ static void initWindowRadius(QWindow *window)
int radius = theme->windowRadius(18); //###(zccrs): 暂时在此处给窗口默认设置为18px的圆角

setWindowProperty(window, _windowRadius, radius);
window->connect(theme, &DPlatformTheme::windowRadiusChanged, window, [=] (int radius) {
if (!resolved(window, PropRole::WindowRadius))
setWindowProperty(window, _windowRadius, radius);
}, Qt::UniqueConnection);
// Qt::UniqueConnection will report a warning
// to `unique connections require a pointer to member function of a QObject subclass`.
const char *uniqueueConnectionFlag("_d_uniqueueConnectionFlag");
bool connected = window->property(uniqueueConnectionFlag).toBool();
if (!connected) {
window->setProperty(uniqueueConnectionFlag, true);
window->connect(theme, &DPlatformTheme::windowRadiusChanged, window, [window] (int radius) {
if (!resolved(window, PropRole::WindowRadius))
setWindowProperty(window, _windowRadius, radius);
});
}
}

class Q_DECL_HIDDEN CreatorWindowEventFile : public QObject {
Expand Down

0 comments on commit 0f264d7

Please sign in to comment.