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#220
  • Loading branch information
deepin-ci-robot committed Jan 23, 2024
1 parent 740cea5 commit 7002143
Showing 1 changed file with 7 additions and 6 deletions.
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

0 comments on commit 7002143

Please sign in to comment.