Use Qt's High-DPI scaling on Windows (#4868)
This commit is contained in:
@@ -615,7 +615,7 @@ void ChannelView::scaleChangedEvent(float scale)
|
||||
|
||||
if (this->goToBottom_)
|
||||
{
|
||||
auto factor = this->qtFontScale();
|
||||
auto factor = this->scale();
|
||||
#ifdef Q_OS_MACOS
|
||||
factor = scale * 80.F /
|
||||
std::max<float>(
|
||||
@@ -703,8 +703,10 @@ void ChannelView::layoutVisibleMessages(
|
||||
{
|
||||
const auto &message = messages[i];
|
||||
|
||||
redrawRequired |= message->layout(layoutWidth, this->scale(), flags,
|
||||
this->bufferInvalidationQueued_);
|
||||
redrawRequired |= message->layout(
|
||||
layoutWidth, this->scale(),
|
||||
this->scale() * static_cast<float>(this->devicePixelRatio()),
|
||||
flags, this->bufferInvalidationQueued_);
|
||||
|
||||
y += message->getHeight();
|
||||
}
|
||||
@@ -738,7 +740,10 @@ void ChannelView::updateScrollbar(
|
||||
{
|
||||
auto *message = messages[i].get();
|
||||
|
||||
message->layout(layoutWidth, this->scale(), flags, false);
|
||||
message->layout(
|
||||
layoutWidth, this->scale(),
|
||||
this->scale() * static_cast<float>(this->devicePixelRatio()), flags,
|
||||
false);
|
||||
|
||||
h -= message->getHeight();
|
||||
|
||||
@@ -1720,9 +1725,11 @@ void ChannelView::wheelEvent(QWheelEvent *event)
|
||||
}
|
||||
else
|
||||
{
|
||||
snapshot[i - 1]->layout(this->getLayoutWidth(),
|
||||
this->scale(), this->getFlags(),
|
||||
false);
|
||||
snapshot[i - 1]->layout(
|
||||
this->getLayoutWidth(), this->scale(),
|
||||
this->scale() *
|
||||
static_cast<float>(this->devicePixelRatio()),
|
||||
this->getFlags(), false);
|
||||
scrollFactor = 1;
|
||||
currentScrollLeft = snapshot[i - 1]->getHeight();
|
||||
}
|
||||
@@ -1755,9 +1762,11 @@ void ChannelView::wheelEvent(QWheelEvent *event)
|
||||
}
|
||||
else
|
||||
{
|
||||
snapshot[i + 1]->layout(this->getLayoutWidth(),
|
||||
this->scale(), this->getFlags(),
|
||||
false);
|
||||
snapshot[i + 1]->layout(
|
||||
this->getLayoutWidth(), this->scale(),
|
||||
this->scale() *
|
||||
static_cast<float>(this->devicePixelRatio()),
|
||||
this->getFlags(), false);
|
||||
|
||||
scrollFactor = 1;
|
||||
currentScrollLeft = snapshot[i + 1]->getHeight();
|
||||
|
||||
Reference in New Issue
Block a user