Skip to content

Commit

Permalink
fix: Fix default display right angle
Browse files Browse the repository at this point in the history
A call to `FETCH_PROPERTY("DTK/WindowRadius", windowRadius)` will return -1 by default, resulting in the right angle parameter. So the cup is fixed here.

Log:
Change-Id: I4988af2bdd0a57ae99d9c5562fe8ba6808de8700
Reviewed-on: http://gerrit.uniontech.com/c/dtkgui/+/7769
Reviewed-by: <[email protected]>
Reviewed-by: chenke <[email protected]>
Tested-by: <[email protected]>
  • Loading branch information
XMuli committed Oct 16, 2020
1 parent a3b9836 commit de1f742
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/dplatformhandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,10 @@ bool DPlatformHandle::isEnabledDXcb(const QWindow *window)
static void initWindowRadius(QWindow *window)
{
auto theme = DGuiApplicationHelper::instance()->windowTheme(window);
//###(zccrs): 暂时在此处给窗口默认设置为18px的圆角
int radius = theme->windowRadius(18);
int radius = theme->windowRadius();

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

setWindowProperty(window, _windowRadius, radius);
window->connect(theme, &DPlatformTheme::windowRadiusChanged, window, [=] (int radius) {
Expand Down
4 changes: 1 addition & 3 deletions src/dplatformtheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,8 @@ int DPlatformTheme::windowRadius() const

int DPlatformTheme::windowRadius(int defaultValue) const
{
FETCH_PROPERTY("DTK/WindowRadius", windowRadius)

bool ok = false;
int radius = value.toInt(&ok);
int radius = this->property("windowRadius").toInt(&ok);

return ok ? radius : defaultValue;
}
Expand Down

0 comments on commit de1f742

Please sign in to comment.