summaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/video-widget.cpp6
-rw-r--r--video/video-widget.hpp3
2 files changed, 5 insertions, 4 deletions
diff --git a/video/video-widget.cpp b/video/video-widget.cpp
index 9100e0ea..8262a380 100644
--- a/video/video-widget.cpp
+++ b/video/video-widget.cpp
@@ -11,9 +11,8 @@
void video_widget::init_image_nolock()
{
- double dpr = devicePixelRatioF();
- size_.store({ iround(width() * dpr), iround(height() * dpr) },
- std::memory_order_release);
+ double dpi = screen_dpi();
+ size_.store({ iround(width() * dpi), iround(height() * dpi) }, std::memory_order_release);
}
video_widget::video_widget(QWidget* parent) : QWidget(parent)
@@ -85,3 +84,4 @@ void video_widget::set_fresh(bool x)
{
fresh_.store(x, std::memory_order_release);
}
+
diff --git a/video/video-widget.hpp b/video/video-widget.hpp
index bb218c69..9218643b 100644
--- a/video/video-widget.hpp
+++ b/video/video-widget.hpp
@@ -7,6 +7,7 @@
#pragma once
+#include "compat/qt-dpi.hpp"
#include "compat/math.hpp"
#include "export.hpp"
@@ -20,7 +21,7 @@
#include <QMutex>
-struct OTR_VIDEO_EXPORT video_widget : QWidget
+struct OTR_VIDEO_EXPORT video_widget : QWidget, public screen_dpi_mixin<video_widget>
{
video_widget(QWidget* parent = nullptr);