aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-20 18:29:03 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-20 18:29:03 +0900
commit78d62b2db44043efb397c666622cb04fc0e0f318 (patch)
tree281a1ce2f275e632b8fe58650f5c55ffbff909d6
parent4309e1fdcd89e7b9d6ae857628382a297a526ea3 (diff)
-rw-r--r--launcher/qml/IconItem.qml8
-rw-r--r--launcher/qml/Launcher.qml15
-rw-r--r--launcher/src/applicationmodel.cpp30
3 files changed, 25 insertions, 28 deletions
diff --git a/launcher/qml/IconItem.qml b/launcher/qml/IconItem.qml
index 4faa3ea..59c2180 100644
--- a/launcher/qml/IconItem.qml
+++ b/launcher/qml/IconItem.qml
@@ -22,7 +22,7 @@ import "ChangeItemPosition.js" as Cip
Item {
id: main
width: 300
- height: 485
+ height: 300
property string icon: model.icon
property int pid: -1
property bool isBlank: false
@@ -88,11 +88,7 @@ Item {
Image {
id: item
- anchors.top: parent.top
- anchors.topMargin: 230
- anchors.horizontalCenter: parent.horizontalCenter
- width: 300
- height: 300
+ anchors.fill: parent
source: './images/%1_active.png'.arg(model.icon)
property string initial: model.name.substring(0,1).toUpperCase()
property bool hasIcon: model.icon !== 'blank'
diff --git a/launcher/qml/Launcher.qml b/launcher/qml/Launcher.qml
index 31a9848..522e1ce 100644
--- a/launcher/qml/Launcher.qml
+++ b/launcher/qml/Launcher.qml
@@ -23,6 +23,8 @@ import "ChangeItemPosition.js" as Cip
ApplicationWindow {
id: root
+ width: 1920
+ height: 720
property int pid: -1
property int firstPox: -1
@@ -50,7 +52,8 @@ ApplicationWindow {
property int currentState: 1
width: 300
- height: 590
+ height: 300
+ anchors.topMargin: 230
smooth: true
@@ -67,8 +70,8 @@ ApplicationWindow {
Rotation {
id: rotate
angle: 0
- origin.y: 243
- origin.x: 160
+ origin.y: 150
+ origin.x: 150
axis { x: 0; y: 1; z: 0 }
Behavior on angle {
NumberAnimation { easing.overshoot: 1; easing.type: Easing.OutBack; duration: 600 }
@@ -87,8 +90,8 @@ ApplicationWindow {
},
Scale {
id: scale
- origin.x: 160
- origin.y: 243
+ origin.x: 150
+ origin.y: 150
xScale: 1
yScale: 1
Behavior on xScale {
@@ -418,7 +421,7 @@ ApplicationWindow {
PropertyChanges {
target: trans
x: 0
- y: -50
+ y: 0
}
PropertyChanges {
target: rect1
diff --git a/launcher/src/applicationmodel.cpp b/launcher/src/applicationmodel.cpp
index dd6ae5f..d57d643 100644
--- a/launcher/src/applicationmodel.cpp
+++ b/launcher/src/applicationmodel.cpp
@@ -32,6 +32,7 @@ class ApplicationModel::Private
{
public:
Private();
+ int loadAppInfo();
QList<AppInfo> data;
};
@@ -52,8 +53,19 @@ namespace {
ApplicationModel::Private::Private()
{
+ int appCount = 0;
+ while(appCount <= 22)
+ {
+ appCount += loadAppInfo();
+ HMI_DEBUG("launcher", "appCount = %d", appCount);
+ }
+}
+
+int ApplicationModel::Private::loadAppInfo()
+{
QString apps = afm_user_daemon_proxy->runnables(QStringLiteral(""));
QJsonDocument japps = QJsonDocument::fromJson(apps.toUtf8());
+ int appCount = 0;
for (auto const &app : japps.array()) {
QJsonObject const &jso = app.toObject();
auto const name = jso["name"].toString();
@@ -67,25 +79,11 @@ ApplicationModel::Private::Private()
!name.contains("OnScreen", Qt::CaseInsensitive)) {
this->data.append(AppInfo(icon, name, id));
}
+ appCount++;
HMI_DEBUG("launcher","name: %s icon: %s id: %s.", name.toStdString().c_str(), icon.toStdString().c_str(), id.toStdString().c_str());
}
- for (auto const &app : japps.array()) {
- QJsonObject const &jso = app.toObject();
- auto const name = jso["name"].toString();
- auto const id = jso["id"].toString();
- auto const icon = get_icon_name(jso);
-
- // Hide HomeScreen icon itself
- if (name != "launcher" &&
- name != "homescreen" &&
- name != "HomeScreen" &&
- !name.contains("OnScreen", Qt::CaseInsensitive)) {
- this->data.append(AppInfo(icon, name, id));
- }
-
- HMI_DEBUG("launcher","name: %s icon: %s id: %s.", name.toStdString().c_str(), icon.toStdString().c_str(), id.toStdString().c_str());
- }
+ return appCount;
}
ApplicationModel::ApplicationModel(QObject *parent)