Skip to content

Commit daf7b68

Browse files
committed
Update Screenshot util to work with new launcher
Change-Id: I9d4216454efb05c1276ed943f480f9283cc24b08 Reviewed-by: Eirik Aavitsland <[email protected]>
1 parent 8f0ca3c commit daf7b68

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

screenshot/Main.qml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,33 @@
1818
import QtQuick 2.0
1919

2020
import Qt.labs.screenshot 1.0
21+
import QtQuick.Window 2.0
22+
import com.qtcompany.B2QtLauncher 1.0
2123

22-
Item
24+
25+
Window
2326
{
24-
id: root;
27+
id: root
28+
visible: true
2529

2630
width: 1280
2731
height: 720
2832

29-
Connections {
30-
target: applicationsModel
31-
onReady: listView.listIndex = 0;
33+
LauncherApplicationsModel {
34+
id: applicationsModel
35+
onReady: {
36+
engine.markApplicationsModelReady();
37+
}
38+
Component.onCompleted: {
39+
//Set the directory to parse for apps
40+
initialize(applicationSettings.appsRoot);
41+
}
42+
}
43+
44+
LauncherEngine {
45+
id: engine
46+
bootAnimationEnabled: applicationSettings.isBootAnimationEnabled
47+
fpsEnabled: applicationSettings.isShowFPSEnabled
3248
}
3349

3450
ListView {
@@ -75,7 +91,7 @@ Item
7591
script: {
7692
var isPortrait = root.width < root.height;
7793

78-
var size = Qt.size(400, 225);
94+
var size = Qt.size(800, 450);
7995
var smallSize = Qt.size(128, 72);
8096
var loc = applicationsModel.locationAt(listView.listIndex) + "/"
8197
var name = "preview_l"
@@ -88,7 +104,7 @@ Item
88104
}
89105

90106
screenshot.grab(loc + name + ext, size); // medium resolution
91-
screenshot.grab(loc + name + "_lr" + ext, smallSize); // low resolution
107+
//screenshot.grab(loc + name + "_lr" + ext, smallSize); // low resolution
92108
}
93109
}
94110
PauseAnimation { duration: 100 }

0 commit comments

Comments
 (0)