try overriding units.gu for the internal screen
commitddc2cd3d10642afbc0e3434f0cb98bb1167daa73
authorMichael Zanetti <michael.zanetti@canonical.com>
dateThu 18 Feb 2016, 18:21 (11 years ago)
parentc2d8f1f
qml/Components/VirtualTouchPad.qml+1−1
@@ -31,7 +31,7 @@ Item {
3131 anchors.fill: parent
3232
3333 // FIXME: Once we have Qt DPR support, this should be Qt.styleHints.startDragDistance
34− readonly property int clickThreshold: units.gu(1.5)
34+ readonly property int clickThreshold: internalGu * 1.5
3535 property bool isClick: false
3636 property bool isDoubleClick: false
3737 property bool isDrag: false
qml/DisabledScreenNotice.qml+3−3
@@ -96,8 +96,8 @@ Item {
9696
9797 Column {
9898 anchors.centerIn: parent
99− width: parent.width - units.gu(8)
100− spacing: units.gu(4)
99+ width: parent.width - (internalGu * 8)
100+ spacing: internalGu * 4
101101
102102 Label {
103103 id: text
@@ -108,7 +108,7 @@ Item {
108108 wrapMode: Text.Wrap
109109 }
110110 Icon {
111− height: units.gu(8)
111+ height: internalGu * 8
112112 width: height
113113 name: "input-touchpad-symbolic"
114114 color: "white"
src/SecondaryWindow.cpp+4
@@ -19,9 +19,13 @@
1919// local
2020#include <paths.h>
2121
22+#include <QQmlContext>
23+
2224SecondaryWindow::SecondaryWindow(QQmlEngine *engine)
2325 : QQuickView(engine, nullptr)
2426{
27+ QByteArray pxpgu = qgetenv("GRID_UNIT_PX");
28+ engine->rootContext()->setContextProperty("internalGu", pxpgu.toInt());
2529 setResizeMode(QQuickView::SizeRootObjectToView);
2630 setColor("black");
2731 setTitle(QStringLiteral("Unity8 Shell - Secondary Screen"));