Use Qt's High-DPI scaling on Windows (#4868)
This commit is contained in:
@@ -270,20 +270,22 @@ void AttachedWindow::updateWindowRect(void *_attachedPtr)
|
||||
}
|
||||
|
||||
float scale = 1.f;
|
||||
float ourScale = 1.F;
|
||||
if (auto dpi = getWindowDpi(attached))
|
||||
{
|
||||
scale = *dpi / 96.f;
|
||||
ourScale = scale / this->devicePixelRatio();
|
||||
|
||||
for (auto w : this->ui_.split->findChildren<BaseWidget *>())
|
||||
{
|
||||
w->setOverrideScale(scale);
|
||||
w->setOverrideScale(ourScale);
|
||||
}
|
||||
this->ui_.split->setOverrideScale(scale);
|
||||
this->ui_.split->setOverrideScale(ourScale);
|
||||
}
|
||||
|
||||
if (this->height_ != -1)
|
||||
{
|
||||
this->ui_.split->setFixedWidth(int(this->width_ * scale));
|
||||
this->ui_.split->setFixedWidth(int(this->width_ * ourScale));
|
||||
|
||||
// offset
|
||||
int o = this->fullscreen_ ? 0 : 8;
|
||||
|
||||
Reference in New Issue
Block a user