on xenial help sign in
Temporary means to override GUs on the internal screen

Approved by: Lukáš Tinkl

commit3bff7ebd387636021fc47e51d38af89ac7986205 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 29 Apr 2016, 20:06 (10 years ago) parent0459278b58c17b
3 files changed+14−5
qml/Components/VirtualTouchPad.qml+1−1 qml/DisabledScreenNotice.qml+4−4 src/SecondaryWindow.cpp+9
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+4−4
@@ -96,19 +96,19 @@ 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
104104 text: i18n.tr("Your device is now connected to an external display. Use this screen as a touch pad to interact with the pointer.")
105105 color: "white"
106106 width: parent.width
107− fontSize: "large"
107+ font.pixelSize: 2.5 * internalGu
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+9
@@ -19,9 +19,18 @@
1919// local
2020#include <paths.h>
2121
22+#include <QQmlContext>
23+
2224SecondaryWindow::SecondaryWindow(QQmlEngine *engine)
2325 : QQuickView(engine, nullptr)
2426{
27+ QByteArray pxpguEnv = qgetenv("GRID_UNIT_PX");
28+ bool ok;
29+ int pxpgu = pxpguEnv.toInt(&ok);
30+ if (!ok) {
31+ pxpgu = 8;
32+ }
33+ engine->rootContext()->setContextProperty("internalGu", pxpgu);
2534 setResizeMode(QQuickView::SizeRootObjectToView);
2635 setColor("black");
2736 setTitle(QStringLiteral("Unity8 Shell - Secondary Screen"));