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 #20

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 7 additions & 6 deletions src/kernel/dplatformhandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,10 @@ static void initWindowRadius(QWindow *window)
return;

auto theme = DGuiApplicationHelper::instance()->systemTheme();
int radius = theme->windowRadius(18); //###(zccrs): 暂时在此处给窗口默认设置为18px的圆角

setWindowProperty(window, _windowRadius, radius);
if (theme->isValid()) {
int radius = theme->windowRadius(18); //###(zccrs): 暂时在此处给窗口默认设置为18px的圆角
setWindowProperty(window, _windowRadius, radius);
}
// Qt::UniqueConnection will report a warning
// to `unique connections require a pointer to member function of a QObject subclass`.
const char *uniqueueConnectionFlag("_d_uniqueueConnectionFlag");
Expand All @@ -604,9 +605,9 @@ static void initWindowRadius(QWindow *window)
}
}

class Q_DECL_HIDDEN CreatorWindowEventFile : public QObject {
class Q_DECL_HIDDEN WindowCreateEventFilter : public QObject {
public:
CreatorWindowEventFile(QObject *par= nullptr): QObject(par){}
WindowCreateEventFilter(QObject *par= nullptr) : QObject(par){}

public:
bool eventFilter(QObject *watched, QEvent *event) override {
Expand Down Expand Up @@ -657,7 +658,7 @@ bool DPlatformHandle::setEnabledNoTitlebarForWindow(QWindow *window, bool enable
if (window->handle()) {
initWindowRadius(window);
} else {
window->installEventFilter(new CreatorWindowEventFile(window));
window->installEventFilter(new WindowCreateEventFilter(window));
}
}

Expand Down
Loading