Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync: from linuxdeepin/dtkgui #15

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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