diff --git a/src/qml/IntroView.qml b/src/qml/IntroView.qml index 5a1eefb..3ae8c2a 100644 --- a/src/qml/IntroView.qml +++ b/src/qml/IntroView.qml @@ -1,8 +1,11 @@ import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.2 +import com.iktwo.qutelauncher 1.0 as QL FocusScope { + id: root + property alias currentIndex: listView.currentIndex property alias model: listView.model property alias progress: animationController.progress @@ -13,9 +16,14 @@ FocusScope { property alias rectangleDividerHeight: rectangleDivider.height property alias dragging: listView.dragging + property int navbarMargin + property int statusbarMargin + readonly property double xPosition: (listView.contentX / listView.width) readonly property bool movingLeft: listView.movingLeft + signal done + onXPositionChanged: { if (currentIndex < 0) return @@ -61,7 +69,7 @@ FocusScope { anchors.fill: parent - ColorAnimation on color { } + ColorAnimation on color { duration: 325 } } ListView { @@ -98,16 +106,31 @@ FocusScope { preferredHighlightBegin: 0 preferredHighlightEnd: width + cacheBuffer: width * 3 + maximumFlickVelocity: width * 2 - delegate: Rectangle { + delegate: Item { height: ListView.view.height width: ListView.view.width - color: "transparent" + Loader { + id: loader - border { - color: "black" - width: 1 + anchors { + fill: parent + topMargin: statusbarMargin + bottomMargin: navbarMargin + } + + source: "intro/" + model.name + } + + Connections { + target: loader.item + + ignoreUnknownSignals: true + + onDone: root.done() } } } @@ -118,10 +141,10 @@ FocusScope { anchors { left: parent.left right: parent.right - bottom: parent.bottom + bottom: parent.bottom; bottomMargin: root.navbarMargin } - height: 57 + height: 56 * QL.ScreenValues.dp Rectangle { id: rectangleDivider @@ -131,10 +154,84 @@ FocusScope { right: parent.right } - height: 1 + height: 1 * QL.ScreenValues.dp color: "#44ffffff" } + + Row { + anchors.centerIn: parent + + spacing: 8 * QL.ScreenValues.dp + + Repeater { + model: root.model.count + + Item { + height: 16 * QL.ScreenValues.dp + width: height + + Rectangle { + id: rectangleIndicator + + property bool active: index === listView.currentIndex + + anchors.centerIn: parent + + height: 10 * QL.ScreenValues.dp + width: height + radius: height + opacity: active ? 1 : 0.6 + + state: "inactive" + states: [ + State { + name: "active" + when: rectangleIndicator.active + + PropertyChanges { + target: rectangleIndicator + height: 16 * QL.ScreenValues.dp + width: 16 * QL.ScreenValues.dp + } + }, + State { + name: "inactive" + when: !rectangleIndicator.active + + PropertyChanges { + target: rectangleIndicator + height: 10 * QL.ScreenValues.dp + width: 10 * QL.ScreenValues.dp + } + } + ] + + transitions: [ + Transition { + from: "active" + to: "inactive" + reversible: true + + ParallelAnimation { + NumberAnimation { + property: "height" + duration: 175 + easing.type: Easing.OutQuad + } + + NumberAnimation { + property: "width" + duration: 175 + easing.type: Easing.OutQuad + } + } + } + ] + } + } + } + } } AnimationController { diff --git a/src/qml/config/Dimensions.qml b/src/qml/config/Dimensions.qml index 4964dca..4443428 100644 --- a/src/qml/config/Dimensions.qml +++ b/src/qml/config/Dimensions.qml @@ -3,5 +3,5 @@ import QtQuick 2.0 import com.iktwo.qutelauncher 1.0 as QL Item { - property int navbarShadowBorderSize: 5 * QL.ScreenValues.dp + property int barsShadowSize: 85 * QL.ScreenValues.dp } diff --git a/src/qml/intro/IntroEnd.qml b/src/qml/intro/IntroEnd.qml new file mode 100644 index 0000000..67eacb4 --- /dev/null +++ b/src/qml/intro/IntroEnd.qml @@ -0,0 +1,16 @@ +import QtQuick 2.6 +import QtQuick.Controls 1.4 +import com.iktwo.qutelauncher 1.0 as QL + +Item { + id: root + + signal done + + Button { + anchors.centerIn: parent + + text: "DONE" + onClicked: root.done() + } +} diff --git a/src/qml/intro/IntroMain.qml b/src/qml/intro/IntroMain.qml new file mode 100644 index 0000000..5d9c7a2 --- /dev/null +++ b/src/qml/intro/IntroMain.qml @@ -0,0 +1,56 @@ +import QtQuick 2.6 +import QtQuick.Controls 1.4 +import com.iktwo.qutelauncher 1.0 as QL + +Item { + + Column { + anchors { + fill: parent + margins: 8 * QL.ScreenValues.dp + } + + Label { + anchors { + left: parent.left + right: parent.right + } + + text: qsTr("QuteLauncher") + color: "#ffffff" + horizontalAlignment: Text.AlignHCenter + + font.pointSize: 22 + } + + Item { + height: 16 * QL.ScreenValues.dp + } + + Label { + anchors { + left: parent.left + right: parent.right + } + + text: "**PLACEHOLDER** Customizable open source Android launcher. Get the source code and contribute at https://iktwo.github.io/QuteLauncher/" + color: "#ffffff" + horizontalAlignment: Text.AlignJustify + wrapMode: Text.Wrap + + font.pointSize: 16 + } + + Item { + height: 24 * QL.ScreenValues.dp + } + + Image { + anchors.horizontalCenter: parent.horizontalCenter + + width: Math.min(parent.width, parent.height) * 0.34 + height: width + source: "qrc:/images/icon" + } + } +} diff --git a/src/qml/main.qml b/src/qml/main.qml index cd7de41..5225a49 100755 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -1,8 +1,9 @@ import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Window 2.2 -import com.iktwo.qutelauncher 1.0 +import com.iktwo.qutelauncher 1.0 as QL import config 1.0 as Config +import debug 1.0 as D ApplicationWindow { id: applicationWindow @@ -20,70 +21,74 @@ ApplicationWindow { ] property int currentResolution: 3 - property bool isScreenPortrait: height >= width - property bool activeScreen: Qt.application.state === Qt.ApplicationActive - property int tilesHorizontally: getNumberOfTilesHorizontally(isScreenPortrait) - property int tilesVertically: getNumberOfTilesVertically(isScreenPortrait) + property bool activeScreen: Qt.application.state === Qt.ApplicationActive - function getNumberOfTilesHorizontally(isScreenPortrait) { - if (isScreenPortrait) { - if (ScreenValues.isTablet) { - return 5 - } else { - return 4 - } - } else { - if (ScreenValues.isTablet) { - return 6 - } else { - return 4 - } - } + function updatePortraitMode() { + if (height >= width) + Config.Theme.portrait = true + else + Config.Theme.portrait = true } - function getNumberOfTilesVertically(isScreenPortrait) { - if (isScreenPortrait) { - return 6 - } else { - if (ScreenValues.isTablet) { - return 5 - } else { - return 4 - } + function getScreenDensityConfiguration(density) { + switch(density) { + case 420: + return "xxhigh" + case 480: + return "xxhigh" + case 560: + return "xxxhigh" + case 640: + return "xxxhigh" } } - color: "#00000000" + color: Config.Theme.colorApplicationWindow width: resolutions[currentResolution].width height: resolutions[currentResolution].height visible: true + onWidthChanged: updatePortraitMode() + onHeightChanged: updatePortraitMode() + onActiveScreenChanged: { if (activeScreen) - ScreenValues.updateScreenValues() + QL.ScreenValues.updateScreenValues() + } + + Component.onCompleted: { + Config.Theme.tablet = QL.ScreenValues.isTablet } FocusScope { - id: backKeyHandler + id: keyHandler height: 1 width: 1 focus: true - Keys.onAsteriskPressed: { - if (explandableItem.isOpened) { - explandableItem.close() + Keys.onBackPressed: { + if (loaderMainTheme.item && loaderMainTheme.item.opened) { + QL.Launcher.minimize() } } - Keys.onBackPressed: { - if (explandableItem.isOpened) { + Keys.onUpPressed: { + if (Qt.platform.os !== "android") + explandableItem.open() + + event.accepted = false + } + + Keys.onDownPressed: { + if (Qt.platform.os !== "android") explandableItem.close() - } + + event.accepted = false } } @@ -92,142 +97,93 @@ ApplicationWindow { running: true onTriggered: { - Launcher.registerMethods() - PackageManager.registerBroadcast() + QL.Launcher.registerMethods() + QL.PackageManager.registerBroadcast() } } - BorderImage { - anchors { - left: parent.left - right: parent.right - top: parent.top + Loader { + id: loader + + function unload() { + sourceComponent = null } - height: ScreenValues.statusBarHeight + anchors.fill: parent - border { - left: Config.Dimensions.navbarShadowBorderSize - top: Config.Dimensions.navbarShadowBorderSize - right: Config.Dimensions.navbarShadowBorderSize - bottom: Config.Dimensions.navbarShadowBorderSize - } + /// TODO: load only if this has never been displayed + // sourceComponent: introView - source: "qrc:/images/shadow" - } + Component { + id: introView - BorderImage { - id: borderImageNavBar + IntroView { + anchors.fill: parent - anchors { - left: parent.left - right: parent.right - bottom: parent.bottom - } + statusbarMargin: QL.ScreenValues.statusBarHeight + navbarMargin: QL.ScreenValues.navBarVisible ? QL.ScreenValues.navigationBarHeight : 0 - height: ScreenValues.navBarVisible ? ScreenValues.navigationBarHeight : 0 - source: ScreenValues.navBarVisible ? "qrc:/images/shadow_navigationbar" : "" + // enabled: false + // visible: false - border { - left: Config.Dimensions.navbarShadowBorderSize - top: Config.Dimensions.navbarShadowBorderSize - right: Config.Dimensions.navbarShadowBorderSize - bottom: Config.Dimensions.navbarShadowBorderSize + model: ListModel { + ListElement { name: "IntroMain.qml"; backgroundColor: "#424242" } + ListElement { name: "IntroEnd.qml"; backgroundColor: "#2c3e50" } + } + + onDone: loader.unload() + } } + } - Item { + Image { anchors { - top: parent.top; topMargin: ScreenValues.statusBarHeight - bottom: borderImageNavBar.top left: parent.left right: parent.right + top: parent.top } - ExpandableItem { - id: explandableItem - - anchors.fill: parent + height: QL.ScreenValues.statusBarHeight - ApplicationGrid { - model: PackageManager + fillMode: Image.Tile - anchors.fill: parent - - onPressAndHold: { - /// TODO: implement this - // applicationTile.source = "image://icon/" + model.packageName - // applicationTile.text = model.name - - explandableItem.close() - } - } - } - } - - MouseArea { - anchors.fill: parent - - enabled: explandableItem.busy + source: "qrc:/images/shadow" } - IntroView { - anchors.fill: parent - - enabled: false - visible: false - - model: ListModel { - ListElement { backgroundColor: "#1abd9c" } - ListElement { backgroundColor: "#2fcd72" } - } - } + Image { + id: borderImageNavBar - GridView { - /// TODO: verify in landscape mode anchors { - top: parent.top; topMargin: ScreenValues.statusBarHeight left: parent.left right: parent.right + bottom: parent.bottom } - height: 4 * (80 * ScreenValues.dp) - model: 16 - interactive: false - cellHeight: height / 4 - cellWidth: width / 4 - - delegate: DropArea { - width: GridView.view.cellWidth - height: GridView.view.cellHeight - } - } - - Row { - id: rowFavorites - - anchors.bottom: borderImageNavBar.top - - height: 80 * ScreenValues.dp + height: QL.ScreenValues.navBarVisible ? QL.ScreenValues.navigationBarHeight : 0 - Repeater { - model: 5 + fillMode: Image.Tile - DropArea { - width: 80 * ScreenValues.dp - height: 80 * ScreenValues.dp - } - } + source: QL.ScreenValues.navBarVisible ? "qrc:/images/shadow_navigationbar" : "" } - ApplicationTile { - id: applicationTile + Loader { + id: loaderMainTheme - dragTarget: applicationTile + anchors.fill: parent + source: "themes/classic/ThemeMain.qml" } - Connections { - target: Launcher - onNewIntentReceived: explandableItem.close() - } + // D.Debug { + // debugData: { + // 'sdkInt': QL.System.sdkInt, + // 'height': applicationWindow.height, + // 'width': applicationWindow.width, + // 'dp': QL.ScreenValues.dp.toFixed(2), + // 'dpi': QL.ScreenValues.dpi.toFixed(2), + // 'density': QL.ScreenValues.density.toFixed(2), + // 'isTablet': QL.ScreenValues.isTablet, + // 'navBarVisible': QL.ScreenValues.navBarVisible + // } + // } } diff --git a/src/qml/themes/classic/ApplicationGrid.qml b/src/qml/themes/classic/ApplicationGrid.qml new file mode 100755 index 0000000..f74ce5c --- /dev/null +++ b/src/qml/themes/classic/ApplicationGrid.qml @@ -0,0 +1,84 @@ +import QtQuick 2.5 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.3 +import QtQuick.Layouts 1.1 +import QtGraphicalEffects 1.0 +import com.iktwo.qutelauncher 1.0 as QL +import config 1.0 as Config + +ScrollView { + id: root + + property alias model: gridView.model + + signal pressAndHold(var model) + + anchors.fill: parent + + style: ScrollViewStyle { + transientScrollBars: false + + scrollBarBackground: Rectangle { + implicitWidth: 5 * QL.ScreenValues.dp + + color: "#d9d9d9" + } + + handle: Rectangle { + implicitWidth: 5 * QL.ScreenValues.dp + + color: "#129688" + } + + corner: Item { } + decrementControl: Item { } + incrementControl: Item { } + } + + GridView { + id: gridView + + property int highlightedItem + + maximumFlickVelocity: height * 5 + + header: Item { + width: parent.width + height: 20 * ScreenValues.dp + } + + add: Transition { + NumberAnimation { properties: "opacity"; from: 0; to: 1; duration: 450 } + NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 500 } + } + + displaced: Transition { + NumberAnimation { property: "opacity"; to: 1.0 } + NumberAnimation { property: "scale"; to: 1.0 } + } + + clip: true + interactive: visible + + cellHeight: height / Config.Theme.getColumns() + cellWidth: width / Config.Theme.getRows() + + delegate: ApplicationTile { + id: applicationTile + + height: GridView.view.cellHeight + width: GridView.view.cellWidth + + source: "image://icon/" + model.packageName + text: model.name + + onClicked: QL.PackageManager.launchApplication(model.packageName) + onPressAndHold: root.pressAndHold(model) + } + + onHeightChanged: { + if (height !== 0) + cacheBuffer = Math.max(1080, height * 5) + } + } +} diff --git a/src/qml/themes/classic/ApplicationTile.qml b/src/qml/themes/classic/ApplicationTile.qml new file mode 100644 index 0000000..1ae196b --- /dev/null +++ b/src/qml/themes/classic/ApplicationTile.qml @@ -0,0 +1,123 @@ +import QtQuick 2.5 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.2 +import com.iktwo.qutelauncher 1.0 + +Item { + id: root + + property alias text: label.text + property alias source: image.source + property var dragTarget + + property var _originalParent + property var _newParent + + signal pressAndHold(var model) + signal clicked + + Drag.active: mouseArea.drag.active + Drag.hotSpot.x: width / 2 + Drag.hotSpot.y: height / 2 + + width: 80 + height: 80 + + Component.onCompleted: { + _originalParent = parent + _newParent = _originalParent + } + + ColumnLayout { + anchors { + top: parent.top + left: parent.left + right: parent.right + } + + Image { + id: image + + anchors.horizontalCenter: parent.horizontalCenter + + asynchronous: true + + Layout.preferredHeight: Math.round(48 * ScreenValues.dp) + Layout.preferredWidth: Math.round(48 * ScreenValues.dp) + + fillMode: Image.PreserveAspectFit + } + + Label { + id: label + + anchors.horizontalCenter: parent.horizontalCenter + + Layout.preferredWidth: parent.width * 0.90 + + elide: Text.ElideRight + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.NoWrap + maximumLineCount: 1 + + font.pixelSize: 12 * ScreenValues.dp + + color: "#666666" + } + } + + MouseArea { + id: mouseArea + + property var originalParent + + anchors.fill: parent + + drag.target: root.dragTarget + + onClicked: root.clicked() + onPressAndHold: root.pressAndHold(model) + + onReleased: root._newParent = (root.Drag.target !== null ? root.Drag.target : root._originalParent) + + states: [ + State { + name: "dragging" + when: mouseArea.drag.active + + ParentChange { target: root; parent: root._originalParent } + + AnchorChanges { + target: root + anchors { + verticalCenter: undefined + horizontalCenter: undefined + left: undefined + right: undefined + top: undefined + bottom: undefined + } + } + }, + State { + name: "notDragging" + when: !mouseArea.drag.active + + ParentChange { target: root; parent: root._newParent } + + AnchorChanges { + target: root + + anchors { + verticalCenter: parent !== root._originalParent ? parent.verticalCenter : undefined + horizontalCenter: parent !== root._originalParent ? parent.horizontalCenter : undefined + left: undefined + right: undefined + top: undefined + bottom: undefined + } + } + } + ] + } +} diff --git a/src/qml/themes/classic/ExpandableItem.qml b/src/qml/themes/classic/ExpandableItem.qml new file mode 100644 index 0000000..95bd0f1 --- /dev/null +++ b/src/qml/themes/classic/ExpandableItem.qml @@ -0,0 +1,142 @@ +import QtQuick 2.5 +import com.iktwo.qutelauncher 1.0 +import config 1.0 as Config + +Item { + default property alias content: itemContainer.data + property alias color: rectangleMinizedIndicator.color + property alias busy: transition.running + + property int minimizedHeight: Math.round(48 * ScreenValues.dp) + property int minimizedWidth: Math.round(48 * ScreenValues.dp) + + property int targetWidth: Math.round(parent.width - (getSideMargin() * ScreenValues.dp)) + property int targetHeight: Math.round(parent.height - 8 * ScreenValues.dp) + + property point minimizedPoint: Qt.point(Math.round(parent.width / 2), Math.round(parent.height - rectangleMinizedIndicator.height - (4 * ScreenValues.dp))) + property point centerPoint: Qt.point(Math.round(parent.width / 2), Math.round(parent.height / 2)) + property point targetPoint: Qt.point(Math.round(centerPoint.x - (targetWidth / 2)), Math.round(6 * ScreenValues.dp)) + + readonly property bool isOpened: stateGroup.state === "opened" + + function close() { + stateGroup.state = "closed" + } + + function open() { + stateGroup.state = "opened" + } + + function getSideMargin() { + if (applicationWindow.isScreenPortrait) { + if (ScreenValues.isTablet) + return -1 /// TODO: find right value + else + return 16 + } else { + if (ScreenValues.isTablet) + return 138 + else + return -1 /// TODO: find right value + } + } + + Rectangle { + id: rectangleMinizedIndicator + + color: Config.Theme.colorGridContainer + + width: minimizedWidth + height: minimizedHeight + + x: minimizedPoint.x + y: minimizedPoint.y + } + + StateGroup { + id: stateGroup + + state: "closed" + + states: [ + State { + name: "closed" + PropertyChanges { + target: rectangleMinizedIndicator + height: minimizedHeight; width: minimizedWidth + x: Math.round(minimizedPoint.x - (minimizedWidth / 2)); y: minimizedPoint.y + radius: Math.round(minimizedWidth / 2) + } + + PropertyChanges { + target: itemContainer + opacity: 0 + } + }, + State { + name: "opened" + PropertyChanges { + target: rectangleMinizedIndicator + height: targetHeight; width: targetWidth + x: targetPoint.x; y: targetPoint.y + radius: Math.round(2 * ScreenValues.dp) + } + + PropertyChanges { + target: itemContainer + opacity: 1 + } + } + ] + + transitions: [ + Transition { + id: transition + + from: "closed" + to: "opened" + reversible: true + ParallelAnimation { + PropertyAnimation { property: "y"; duration: 275; easing.type: Easing.InOutCubic } + + SequentialAnimation { + PauseAnimation { duration: 50 } + ParallelAnimation { + PropertyAnimation { target: rectangleMinizedIndicator; properties: "height, width"; easing.type: Easing.InOutCubic; duration: 250 } + PropertyAnimation { target: rectangleMinizedIndicator; property: "radius"; easing.type: Easing.InOutCubic; duration: 250 } + PropertyAnimation { target: rectangleMinizedIndicator; property: "x"; easing.type: Easing.InOutCubic; duration: 250 } + SequentialAnimation { + PauseAnimation { duration: 150 } + PropertyAnimation { target: itemContainer; property: "opacity"; easing.type: Easing.InOutCubic} + } + } + } + } + } + ] + } + + Item { + id: itemContainer + + anchors { + right: rectangleMinizedIndicator.right; rightMargin: -ScreenValues.dp + verticalCenter: rectangleMinizedIndicator.verticalCenter + } + + width: targetWidth + height: targetHeight + } + + MouseArea { + anchors.fill: parent + enabled: stateGroup.state === "closed" + } + + MouseArea { + anchors.fill: rectangleMinizedIndicator + enabled: stateGroup.state === "closed" + + onClicked: open() + } +} diff --git a/src/qml/themes/classic/ThemeMain.qml b/src/qml/themes/classic/ThemeMain.qml new file mode 100644 index 0000000..b85ad35 --- /dev/null +++ b/src/qml/themes/classic/ThemeMain.qml @@ -0,0 +1,100 @@ +import QtQuick 2.0 +import com.iktwo.qutelauncher 1.0 as QL + +Item { + id: root + + property int navbarMargin: QL.ScreenValues.navBarVisible ? QL.ScreenValues.navigationBarHeight : 0 + property int statusbarMargin: QL.ScreenValues.statusBarHeight + + property bool opened: explandableItem.isOpened + + MouseArea { + anchors.fill: parent + + enabled: !explandableItem.isOpened + + onPressAndHold: QL.Launcher.pickWallpaper() + } + + Item { + anchors { + top: parent.top; topMargin: QL.ScreenValues.statusBarHeight + bottom: parent.bottom; bottomMargin: root.navbarMargin + left: parent.left + right: parent.right + } + + ExpandableItem { + id: explandableItem + + anchors.fill: parent + + ApplicationGrid { + model: QL.PackageManager + + anchors.fill: parent + + onPressAndHold: { + /// TODO: implement this + // applicationTile.source = "image://icon/" + model.packageName + // applicationTile.text = model.name + + explandableItem.close() + } + } + } + } + + MouseArea { + anchors.fill: parent + + enabled: explandableItem.busy + } + + GridView { + /// TODO: verify in landscape mode + anchors { + top: parent.top; topMargin: QL.ScreenValues.statusBarHeight + left: parent.left + right: parent.right + } + + height: 4 * (80 * QL.ScreenValues.dp) + model: 16 + enabled: false + interactive: false + cellHeight: height / 4 + cellWidth: width / 4 + + delegate: DropArea { + width: GridView.view.cellWidth + height: GridView.view.cellHeight + } + } + + Row { + id: rowFavorites + + anchors { + bottom: parent.bottom; bottomMargin: root.navbarMargin + } + + height: 80 * QL.ScreenValues.dp + + Repeater { + model: 5 + + DropArea { + width: 80 * QL.ScreenValues.dp + height: 80 * QL.ScreenValues.dp + } + } + } + + Connections { + target: QL.Launcher + onNewIntentReceived: explandableItem.close() + onMinimized: explandableItem.close() + } +} diff --git a/src/resources.qrc b/src/resources.qrc index 4911c06..e9ae3fe 100755 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -1,19 +1,23 @@ qml/main.qml - qml/ApplicationGrid.qml - qml/ExpandableItem.qml - qml/ApplicationTile.qml qml/IntroView.qml qml/config/qmldir qml/config/Theme.qml qml/config/Dimensions.qml qml/debug/Debug.qml qml/debug/qmldir + qml/intro/IntroMain.qml + qml/intro/IntroEnd.qml + qml/themes/classic/ThemeMain.qml + qml/themes/classic/ApplicationGrid.qml + qml/themes/classic/ExpandableItem.qml + qml/themes/classic/ApplicationTile.qml resources/images/test.png resources/images/shadow.png resources/images/shadow_navigationbar.png + resources/images/icon.svg diff --git a/src/resources/images/icon.svg b/src/resources/images/icon.svg new file mode 100644 index 0000000..b102f88 --- /dev/null +++ b/src/resources/images/icon.svg @@ -0,0 +1,114 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/src/launcher.cpp b/src/src/launcher.cpp index ce6259c..29da35a 100644 --- a/src/src/launcher.cpp +++ b/src/src/launcher.cpp @@ -38,6 +38,11 @@ void Launcher::registerMethods() registerNativeMethods(); } +void Launcher::minimize() +{ + emit minimized(); +} + void Launcher::registerNativeMethods() { #ifdef Q_OS_ANDROID diff --git a/src/src/launcher.h b/src/src/launcher.h index e457754..d8886b8 100644 --- a/src/src/launcher.h +++ b/src/src/launcher.h @@ -16,9 +16,11 @@ class Launcher : public QObject Q_INVOKABLE void pickWallpaper(); Q_INVOKABLE void emitNewIntent(); Q_INVOKABLE void registerMethods(); + Q_INVOKABLE void minimize(); signals: void newIntentReceived(); + void minimized(); private: void registerNativeMethods();