Commit f5bb4ef5 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

Merge pull request #28 from locusf/master

More changes as per the reports of qwazix
parents e9f9e7ec 21e93440
......@@ -9,7 +9,7 @@ Name: lipstick-glacier-home-qt5
# << macros
Summary: A nice homescreen for Glacier experience
Version: 0.13
Version: 0.14
Release: 1
Group: System/GUI/Other
License: BSD
......
Name: lipstick-glacier-home-qt5
Summary: A nice homescreen for Glacier experience
Version: 0.13
Version: 0.14
Release: 1
Group: System/GUI/Other
License: BSD
......
......@@ -4,11 +4,24 @@ GlacierWindowModel::GlacierWindowModel(): WindowModel()
{
}
GlacierWindowModel::~GlacierWindowModel() {
int GlacierWindowModel::getWindowIdForTitle(QString title)
{
return m_titles.value(title,0);
}
bool GlacierWindowModel::approveWindow(LipstickCompositorWindow *window)
{
return window->isInProcess() == false && window->category() != QLatin1String("overlay") && window->category() != QLatin1String("cover");
bool accepted = window->isInProcess() == false && window->category() != QLatin1String("overlay") && window->category() != QLatin1String("cover");
if (accepted) {
m_titles.insert(window->title(), window->windowId());
}
return accepted;
}
void GlacierWindowModel::removeWindowForTitle(QString title)
{
qDebug() << "Removing window: " + title;
m_titles.remove(title);
}
......@@ -7,12 +7,16 @@ class LipstickCompositorWindow;
class QWaylandSurfaceItem;
class GlacierWindowModel : public WindowModel
class Q_DECL_EXPORT GlacierWindowModel : public WindowModel
{
Q_OBJECT
public:
explicit GlacierWindowModel();
~GlacierWindowModel();
bool approveWindow(LipstickCompositorWindow *window);
Q_INVOKABLE int getWindowIdForTitle(QString title);
Q_INVOKABLE void removeWindowForTitle(QString title);
private:
QHash<QString, int> m_titles;
};
#endif // GLACIERWINDOWMODEL_H
......@@ -39,6 +39,7 @@ GridView {
property Item reorderItem
property bool onUninstall
property alias deleter: deleter
property var switcher: null
// just for margin purposes
header: Item {
......
......@@ -37,6 +37,8 @@ Item {
property bool closeMode: false
property bool visibleInHome: false
property alias runningAppsCount: switcherModel.itemCount
property var switchModel: switcherModel
property var launcher: null
onVisibleInHomeChanged: {
// Exit close mode when scrolling out of view
......
/****************************************************************************************
**
** Copyright (C) 2014 Aleksi Suomalainen <suomalainen.aleksi@gmail.com>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the author nor the
** names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
****************************************************************************************/
import QtQuick 2.1
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
Component {
CommonPanel {
Label {
text: "Battery level: " + batteryChargePercentage.value + "%"
font.pointSize: 8
}
}
}
/****************************************************************************************
**
** Copyright (C) 2014 Aleksi Suomalainen <suomalainen.aleksi@gmail.com>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the author nor the
** names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
****************************************************************************************/
import QtQuick 2.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
Rectangle {
height: 240
width: root.width
color: "#313131"
opacity: 0.5
Button {
text: "Close"
anchors.bottom: parent.bottom
anchors.right: parent.right
onClicked: {
panel_loader.visible = !panel_loader.visible
}
}
}
......@@ -36,7 +36,7 @@ Item {
// Day of week
Row {
id: daterow
height: 120
height: displayCurrentDate.height + 15
Label {
id: displayDayOfWeek
text: Qt.formatDateTime(wallClock.time, "dddd") + ", "
......@@ -56,6 +56,8 @@ Item {
id: displayCurrentDate
text: Qt.formatDate(wallClock.time, "d MMMM yyyy")
font.pointSize: 12
width: rootitem.width - displayDayOfWeek.width - 20
wrapMode: Text.WordWrap
anchors {
left: displayDayOfWeek.right
top: parent.top
......@@ -79,7 +81,7 @@ Item {
anchors.fill: parent
onClicked: {
if (modelData.userRemovable) {
modelData.removeRequested()
modelData.actionInvoked("default")
}
}
......@@ -96,14 +98,16 @@ Item {
Label {
id: appSummary
text: modelData.summary
width: rootitem.width/2
font.pointSize: 10
anchors.left: appIcon.right
wrapMode: Text.WordWrap
wrapMode: Text.Wrap
}
Label {
width: rootitem.width/2
text: modelData.body
font.pointSize: 8
wrapMode: Text.WordWrap
wrapMode: Text.Wrap
anchors.left: appSummary.right
}
}
......
......@@ -108,7 +108,12 @@ Item {
onClicked: {
// TODO: disallow if close mode enabled
if (model.object.type !== LauncherModel.Folder) {
model.object.launchApplication()
var winId = switcher.switchModel.getWindowIdForTitle(model.object.title)
console.log("Window id found: " + winId)
if (winId == 0)
model.object.launchApplication()
else
Lipstick.compositor.windowToFront(winId)
} else {
if (!folderLoader.visible) {
folderLoader.visible = true
......
......@@ -54,6 +54,7 @@ Page {
}
id: desktop
property alias lockscreen: lockScreen
property alias switcher: switcher
// Implements back key navigation
Keys.onReleased: {
if (event.key === Qt.Key_Back) {
......@@ -93,12 +94,14 @@ Page {
AppLauncher {
id: launcher
height: pager.height
switcher: switcher
}
AppSwitcher {
id: switcher
width: pager.width
height: pager.height
visibleInHome: x > -width && x < desktop.width
launcher: launcher
}
FeedsPage {
id: feeds
......
......@@ -35,12 +35,8 @@ import QtQuick.Controls.Styles.Nemo 1.0
import MeeGo.QOfono 0.2
Component {
Rectangle {
CommonPanel {
id: simpanel
height: 240
width: root.width
color: "#313131"
opacity: 0.5
property bool needsPin: simManager.pinRequired === OfonoSimManager.SimPin ||
simManager.pinRequired === OfonoSimManager.SimPuk
onNeedsPinChanged: {
......
......@@ -123,7 +123,7 @@ Item {
font.pointSize: 6
font.bold: true
wrapMode: Text.ElideRight
text: (cellularNetworkName !== "") ? cellularNetworkName.value.toUpperCase() : "N/A"
text: (cellularNetworkName !== "") ? cellularNetworkName.value.substring(0,3).toUpperCase() : "N/A"
}
Label {
......@@ -175,6 +175,8 @@ Item {
source: "image://theme/icon_play_pause"
}
StatusbarItem {
width: 30
height: 48
Label {
id: hours
width: 16
......@@ -194,6 +196,7 @@ Item {
}
StatusbarItem {
panel: BatteryPanel {}
source: {
if(batteryChargePercentage.value > 85) {
return "qrc:/qml/images/battery6.png"
......
......@@ -85,9 +85,9 @@ MouseArea {
}
Label {
anchors {
top: parent.bottom
top: parent.top
horizontalCenter: parent.horizontalCenter
topMargin: -30
topMargin: 30
}
font.pointSize: 8
text: Lipstick.compositor.windowForId(model.window).title
......
......@@ -34,11 +34,7 @@ import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
Component {
Rectangle {
height: 240
width: root.width
color: "#313131"
opacity: 0.5
CommonPanel {
Column {
Repeater {
model: wifimodel
......
......@@ -288,7 +288,9 @@ Compositor {
WindowWrapperMystic { }
}
onDisplayOff: setCurrentWindow(root.homeWindow)
onDisplayOff:
if (root.topmostAlarmWindow == null)
setCurrentWindow(root.homeWindow)
onWindowAdded: {
console.log("Compositor: Window added \"" + window.title + "\"" + " category: " + window.category)
......@@ -342,9 +344,14 @@ Compositor {
}
}
onWindowRaised: {
console.log("Compositor: Raising window: " + window.title + " category: " + window.category)
windowToFront(window.windowId)
}
onWindowRemoved: {
console.log("Compositor: Window removed \"" + window.title + "\"" + " category: " + window.category)
Desktop.instance.switcher.switchModel.removeWindowForTitle(window.title)
var w = window.userData;
if (window.category == "alarm") {
root.topmostAlarmWindow = null
......
......@@ -31,7 +31,9 @@ qml.files = qml/MainScreen.qml \
qml/NumButton.qml \
qml/USBModeSelector.qml \
qml/Pager.qml \
qml/VolumeControl.qml
qml/VolumeControl.qml \
qml/BatteryPanel.qml \
qml/CommonPanel.qml
qmlcompositor.path = /usr/share/lipstick-glacier-home-qt5/qml/compositor
qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \
......@@ -50,6 +52,8 @@ DEFINES += QT_COMPOSITOR_QUICK
HEADERS += \
glacierwindowmodel.h
MOC_DIR = .moc
SOURCES += \
main.cpp \
glacierwindowmodel.cpp
......@@ -84,6 +88,8 @@ OTHER_FILES += qml/*.qml \
qml/SimPanel.qml \
qml/NumButton.qml \
qml/USBModeSelector.qml \
qml/VolumeControl.qml
qml/VolumeControl.qml \
qml/BatteryPanel.qml \
qml/CommonPanel.qml
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment