~albaguirre/qtubuntu/use-mir-rs-api

« back to all changes in this revision

Viewing changes to src/ubuntumirclient/qmirclientscreen.h

  • Committer: Bileto Bot
  • Author(s): Daniel d'Andrada
  • Date: 2017-03-28 17:12:27 UTC
  • mfrom: (384.2.2 logicalDpi)
  • Revision ID: ci-train-bot@canonical.com-20170328171227-enk6bc31gd2xric1
Proper implementation of QPlatformScreen::logicalDpi

It's *not* the physical DPI.
It's just a value used for scaling point sized UI elements (mainly QWidget text)

You can view it as the value used to convert pt (point) to pixels (LP: #1675572)

Approved by: Gerry Boland, Lukáš Tinkl, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/****************************************************************************
2
2
**
3
 
** Copyright (C) 2014-2016 Canonical, Ltd.
 
3
** Copyright (C) 2014-2017 Canonical, Ltd.
4
4
** Contact: https://www.qt.io/licensing/
5
5
**
6
6
** This file is part of the plugins of the Qt Toolkit.
85
85
 
86
86
private:
87
87
    void setMirOutput(const MirOutput *output);
 
88
    void updateLogicalDpi();
88
89
 
89
90
    QRect mGeometry, mNativeGeometry;
90
91
    QSizeF mPhysicalSize;
93
94
    Qt::ScreenOrientation mCurrentOrientation;
94
95
    QImage::Format mFormat;
95
96
    int mDepth;
96
 
    int mDpi;
97
97
    qreal mRefreshRate;
98
98
    MirFormFactor mFormFactor;
99
99
    float mScale;
100
100
    int mOutputId;
101
101
    QMirClientCursor mCursor;
 
102
    float mLogicalDpiEnv{0};
 
103
    QDpi mLogicalDpi;
 
104
 
 
105
    static const float mMirScaleToLogicalDpiMultiplier;
102
106
 
103
107
    friend class QMirClientNativeInterface;
104
108
};