summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@digia.com>2014-09-02 10:25:25 +0300
committerSamuli Piippo <samuli.piippo@digia.com>2014-09-02 10:25:35 +0300
commitf5fd2dedf13706f88194ee2c1fd6a01dc38debee (patch)
tree064d5fdfc02d88b9b32f09ad2307413c384044f2
parent748cff4efc54cf6e4b89af8f248ef8f790533277 (diff)
parent5632bf93ca885f067a1d9bb9d8fef67d2a346129 (diff)
Merge remote-tracking branch 'origin/stable' into dev
* origin/stable: Fixes application icon reflection Update VirtualKeyboard version Change bottom link text Stop animateToCenter when a finger is on the screen Remove left over shell script qt_run.sh. Ignore the GPU blacklist for Qt WebEngine. Add Digia eval URL to main page Fix unwanted translucency in the demo launcher Auto-select a demo on startup as well as on movement stop Add possibility to launch QtWebEngine applications Change-Id: I147ac29591620decd12d99510f4d5806fed3f4f0
-rw-r--r--qml/ApplicationIcon.qml13
-rw-r--r--qml/LaunchScreen.qml18
-rw-r--r--qml/Main.qml28
-rw-r--r--qt_run.sh9
-rw-r--r--src/engine.h1
-rw-r--r--src/main.cpp12
-rw-r--r--startup.pro5
7 files changed, 69 insertions, 17 deletions
diff --git a/qml/ApplicationIcon.qml b/qml/ApplicationIcon.qml
index 9fdcbdf..8c4ae79 100644
--- a/qml/ApplicationIcon.qml
+++ b/qml/ApplicationIcon.qml
@@ -83,7 +83,7 @@ Item {
varying highp vec2 v_TexCoord;
void main() {
- gl_FragColor = texture2D(source, v_TexCoord) * qt_Opacity * selection;
+ gl_FragColor = vec4(texture2D(source, v_TexCoord).rgb * selection, 1.0) * qt_Opacity;
}
"
}
@@ -92,14 +92,12 @@ Item {
id: reflection
width: shader.width
- height: shader.height * reflectionRatio
+ height: shader.height
anchors.top: shader.bottom;
anchors.topMargin: height * 0.05;
- property real reflectionRatio: 0.7
-
- opacity: 0.5
+ opacity: 0.4
property real x1: appIcon.x1;
property real x2: appIcon.x2 - appIcon.x1;
@@ -136,7 +134,10 @@ Item {
uniform sampler2D source;
varying highp vec2 v_TexCoord;
void main() {
- gl_FragColor = texture2D(source, v_TexCoord) * qt_Opacity * v_TexCoord.y;
+ if (v_TexCoord.y < 0.3)
+ gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
+ else
+ gl_FragColor = texture2D(source, v_TexCoord) * qt_Opacity * ( v_TexCoord.y - 0.3);
}
"
}
diff --git a/qml/LaunchScreen.qml b/qml/LaunchScreen.qml
index 2bf25a5..371c12e 100644
--- a/qml/LaunchScreen.qml
+++ b/qml/LaunchScreen.qml
@@ -55,7 +55,7 @@ Item {
offset: list.contentX;
- onClicked: {
+ function select() {
list.targetContentX = iconRoot.x - (list.width / 2 - list.cellWidth / 2);
list.targetIndex = index;
if (Math.abs(list.targetContentX - list.contentX) < 50) {
@@ -65,6 +65,7 @@ Item {
}
animateToCenter.running = true;
}
+ onClicked: select()
}
property int targetIndex;
@@ -84,6 +85,21 @@ Item {
nameLabel.text = ""
}
}
+
+ onMovementEnded: {
+ var center = mapToItem(contentItem, width / 2, height / 2)
+ itemAt(center.x, center.y).select()
+ }
+
+ onCountChanged: if (count > 0 && currentIndex < 0) currentIndex = 0
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ animateToCenter.stop()
+ mouse.accepted = false
+ }
+ }
}
Text {
diff --git a/qml/Main.qml b/qml/Main.qml
index 667053e..a56e851 100644
--- a/qml/Main.qml
+++ b/qml/Main.qml
@@ -16,7 +16,7 @@
**
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Enterprise.VirtualKeyboard 1.0
+import QtQuick.Enterprise.VirtualKeyboard 1.1
Item {
id: root
@@ -27,11 +27,14 @@ Item {
property int stateDelay: 400;
property int bootDelay: 1000;
+ property color qtpurple: '#ae32a0'
+
states: [
State {
name: "booting"
PropertyChanges { target: appGrid; opacity: 0 }
PropertyChanges { target: splashScreen; opacity: 0 }
+ PropertyChanges { target: url; opacity: 0 }
},
State {
name: "running"
@@ -49,6 +52,7 @@ Item {
PropertyChanges { target: applicationLoader; opacity: 1 }
PropertyChanges { target: appGrid; opacity: 0 }
PropertyChanges { target: splashScreen; opacity: 0 }
+ PropertyChanges { target: url; opacity: 0 }
},
State {
name: "app-closing"
@@ -293,4 +297,26 @@ Item {
}
}
+ Item {
+ id: url
+ anchors.bottom: parent.bottom;
+ anchors.horizontalCenter: parent.horizontalCenter;
+ anchors.margins: height/2
+ width: urlLabel.width
+ height: urlLabel.height
+
+ Rectangle {
+ color: "black"
+ opacity: 0.7
+ anchors.fill: urlLabel
+ }
+
+ Text {
+ id: urlLabel;
+ text: "qt.digia.com/QtEnterpriseEmbedded"
+ color: qtpurple
+ font.pixelSize: engine.sensibleButtonSize() * 0.2
+ font.bold: true
+ }
+ }
}
diff --git a/qt_run.sh b/qt_run.sh
deleted file mode 100644
index e439a55..0000000
--- a/qt_run.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/system/bin/sh
-
-export QT_QPA_EGLFS_NO_SURFACEFLINGER=1
-export QT_QPA_EGLFS_HIDECURSOR=1
-
-export QMLSCENE_DEVICE=customcontext
-export CUSTOMCONTEXT_NO_MULTISAMPLE=1
-
-/system/bin/qtlauncher -plugin evdevtouch:/dev/input/event0 --logcat
diff --git a/src/engine.h b/src/engine.h
index 89fa28d..a837879 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -71,6 +71,7 @@ public:
void setWindow(QQuickWindow *window) { m_window = window; }
+ Q_INVOKABLE QUrl fromUserInput(const QString& userInput) { return QUrl::fromUserInput(userInput); }
Q_INVOKABLE int sensibleButtonSize() const;
Q_INVOKABLE int titleBarSize() const;
Q_INVOKABLE int smallFontSize() const { return qMax<int>(m_dpcm * 0.4, 10); }
diff --git a/src/main.cpp b/src/main.cpp
index 60ec4d7..3df76b6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -32,6 +32,10 @@
#include <QtQml/QQmlContext>
#include <QtQml/QQmlComponent>
+#if defined(USE_QTWEBENGINE)
+#include <qtwebengineglobal.h>
+#endif
+
#include "engine.h"
#include "applicationsmodel.h"
#include "logmanager.h"
@@ -64,6 +68,14 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
+#if defined(USE_QTWEBENGINE)
+ // This is currently needed by all QtWebEngine applications using the HW accelerated QQuickWebView.
+ // It enables sharing the QOpenGLContext of all QQuickWindows of the application.
+ // We have to do so until we expose a public API for it in Qt or choose to enable it
+ // by default earliest in Qt 5.4.0.
+ QWebEngine::initialize();
+#endif
+
QPalette pal;
pal.setColor(QPalette::Text, Qt::black);
pal.setColor(QPalette::WindowText, Qt::black);
diff --git a/startup.pro b/startup.pro
index 661ac49..0c9283a 100644
--- a/startup.pro
+++ b/startup.pro
@@ -9,6 +9,11 @@ TARGET = qtlauncher
QML_FILES += qml
+qtHaveModule(webengine) {
+ DEFINES += USE_QTWEBENGINE
+ QT += webengine
+}
+
HEADERS += \
src/engine.h \
src/applicationsmodel.h \