diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-06-25 21:04:15 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-06-25 21:04:29 +0200 |
commit | 0b7de47259713acef2682755cc79263883741bf1 (patch) | |
tree | 46106e6304db240f8b2ab35524fdc78d812d0293 /spline/spline-widget.cpp | |
parent | 6f4388a445c6701b592e90d87f08361d773a09b1 (diff) |
spline: set minimum size hint
Diffstat (limited to 'spline/spline-widget.cpp')
-rw-r--r-- | spline/spline-widget.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spline/spline-widget.cpp b/spline/spline-widget.cpp index d329d8e2..363720c8 100644 --- a/spline/spline-widget.cpp +++ b/spline/spline-widget.cpp @@ -260,6 +260,21 @@ void spline_widget::drawFunction() } } +double spline_widget::screen_dpi() const +{ +#ifdef _WIN32 + return std::max(devicePixelRatioF, 1.); +#else + return std::max(std::max(logicalDpiX()/(double)physicalDpiX(), devicePixelRatioF()), 1.); +#endif +} + +QSize spline_widget::minimumSizeHint() const +{ + const double dpi = screen_dpi(); + return { iround(800 * dpi), iround(250 * dpi) }; +} + void spline_widget::paintEvent(QPaintEvent *e) { if (!config) |