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 ...@@ -9,7 +9,7 @@ Name: lipstick-glacier-home-qt5
# << macros # << macros
Summary: A nice homescreen for Glacier experience Summary: A nice homescreen for Glacier experience
Version: 0.13 Version: 0.14
Release: 1 Release: 1
Group: System/GUI/Other Group: System/GUI/Other
License: BSD License: BSD
......
Name: lipstick-glacier-home-qt5 Name: lipstick-glacier-home-qt5
Summary: A nice homescreen for Glacier experience Summary: A nice homescreen for Glacier experience
Version: 0.13 Version: 0.14
Release: 1 Release: 1
Group: System/GUI/Other Group: System/GUI/Other
License: BSD License: BSD
......
...@@ -4,11 +4,24 @@ GlacierWindowModel::GlacierWindowModel(): WindowModel() ...@@ -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) 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; ...@@ -7,12 +7,16 @@ class LipstickCompositorWindow;
class QWaylandSurfaceItem; class QWaylandSurfaceItem;
class GlacierWindowModel : public WindowModel class Q_DECL_EXPORT GlacierWindowModel : public WindowModel
{ {
Q_OBJECT
public: public:
explicit GlacierWindowModel(); explicit GlacierWindowModel();
~GlacierWindowModel();
bool approveWindow(LipstickCompositorWindow *window); 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 #endif // GLACIERWINDOWMODEL_H
...@@ -39,6 +39,7 @@ GridView { ...@@ -39,6 +39,7 @@ GridView {
property Item reorderItem property Item reorderItem
property bool onUninstall property bool onUninstall
property alias deleter: deleter property alias deleter: deleter
property var switcher: null
// just for margin purposes // just for margin purposes
header: Item { header: Item {
......
...@@ -37,6 +37,8 @@ Item { ...@@ -37,6 +37,8 @@ Item {
property bool closeMode: false property bool closeMode: false
property bool visibleInHome: false property bool visibleInHome: false
property alias runningAppsCount: switcherModel.itemCount property alias runningAppsCount: switcherModel.itemCount
property var switchModel: switcherModel
property var launcher: null
onVisibleInHomeChanged: { onVisibleInHomeChanged: {
// Exit close mode when scrolling out of view // 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 { ...@@ -36,7 +36,7 @@ Item {
// Day of week // Day of week
Row { Row {
id: daterow id: daterow
height: 120 height: displayCurrentDate.height + 15
Label { Label {
id: displayDayOfWeek id: displayDayOfWeek
text: Qt.formatDateTime(wallClock.time, "dddd") + ", " text: Qt.formatDateTime(wallClock.time, "dddd") + ", "
...@@ -56,6 +56,8 @@ Item { ...@@ -56,6 +56,8 @@ Item {
id: displayCurrentDate id: displayCurrentDate
text: Qt.formatDate(wallClock.time, "d MMMM yyyy") text: Qt.formatDate(wallClock.time, "d MMMM yyyy")
font.pointSize: 12 font.pointSize: 12
width: rootitem.width - displayDayOfWeek.width - 20
wrapMode: Text.WordWrap
anchors { anchors {
left: displayDayOfWeek.right left: displayDayOfWeek.right
top: parent.top top: parent.top
...@@ -79,7 +81,7 @@ Item { ...@@ -79,7 +81,7 @@ Item {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
if (modelData.userRemovable) { if (modelData.userRemovable) {
modelData.removeRequested() modelData.actionInvoked("default")
} }
} }
...@@ -96,14 +98,16 @@ Item { ...@@ -96,14 +98,16 @@ Item {
Label { Label {
id: appSummary id: appSummary
text: modelData.summary text: modelData.summary
width: rootitem.width/2
font.pointSize: 10 font.pointSize: 10
anchors.left: appIcon.right anchors.left: appIcon.right
wrapMode: Text.WordWrap wrapMode: Text.Wrap
} }
Label { Label {
width: rootitem.width/2
text: modelData.body text: modelData.body
font.pointSize: 8 font.pointSize: 8
wrapMode: Text.WordWrap wrapMode: Text.Wrap
anchors.left: appSummary.right anchors.left: appSummary.right
} }
} }
......
...@@ -108,7 +108,12 @@ Item { ...@@ -108,7 +108,12 @@ Item {
onClicked: { onClicked: {
// TODO: disallow if close mode enabled // TODO: disallow if close mode enabled
if (model.object.type !== LauncherModel.Folder) { 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 { } else {
if (!folderLoader.visible) { if (!folderLoader.visible) {
folderLoader.visible = true folderLoader.visible = true
......
...@@ -54,6 +54,7 @@ Page { ...@@ -54,6 +54,7 @@ Page {
} }
id: desktop id: desktop
property alias lockscreen: lockScreen property alias lockscreen: lockScreen
property alias switcher: switcher
// Implements back key navigation // Implements back key navigation
Keys.onReleased: { Keys.onReleased: {
if (event.key === Qt.Key_Back) { if (event.key === Qt.Key_Back) {
...@@ -93,12 +94,14 @@ Page { ...@@ -93,12 +94,14 @@ Page {
AppLauncher { AppLauncher {
id: launcher id: launcher
height: pager.height height: pager.height
switcher: switcher
} }
AppSwitcher { AppSwitcher {
id: switcher id: switcher
width: pager.width width: pager.width
height: pager.height height: pager.height
visibleInHome: x > -width && x < desktop.width visibleInHome: x > -width && x < desktop.width
launcher: launcher
} }
FeedsPage { FeedsPage {
id: feeds id: feeds
......
...@@ -35,12 +35,8 @@ import QtQuick.Controls.Styles.Nemo 1.0 ...@@ -35,12 +35,8 @@ import QtQuick.Controls.Styles.Nemo 1.0
import MeeGo.QOfono 0.2 import MeeGo.QOfono 0.2
Component { Component {
Rectangle { CommonPanel {
id: simpanel id: simpanel
height: 240
width: root.width
color: "#313131"
opacity: 0.5
property bool needsPin: simManager.pinRequired === OfonoSimManager.SimPin || property bool needsPin: simManager.pinRequired === OfonoSimManager.SimPin ||
simManager.pinRequired === OfonoSimManager.SimPuk simManager.pinRequired === OfonoSimManager.SimPuk
onNeedsPinChanged: { onNeedsPinChanged: {
......
...@@ -123,7 +123,7 @@ Item { ...@@ -123,7 +123,7 @@ Item {
font.pointSize: 6 font.pointSize: 6
font.bold: true font.bold: true
wrapMode: Text.ElideRight wrapMode: Text.ElideRight
text: (cellularNetworkName !== "") ? cellularNetworkName.value.toUpperCase() : "N/A" text: (cellularNetworkName !== "") ? cellularNetworkName.value.substring(0,3).toUpperCase() : "N/A"
} }
Label { Label {
...@@ -175,6 +175,8 @@ Item { ...@@ -175,6 +175,8 @@ Item {
source: "image://theme/icon_play_pause" source: "image://theme/icon_play_pause"
} }
StatusbarItem { StatusbarItem {
width: 30
height: 48
Label { Label {
id: hours id: hours
width: 16 width: 16
...@@ -194,6 +196,7 @@ Item { ...@@ -194,6 +196,7 @@ Item {
} }
StatusbarItem { StatusbarItem {
panel: BatteryPanel {}
source: { source: {
if(batteryChargePercentage.value > 85) { if(batteryChargePercentage.value > 85) {
return "qrc:/qml/images/battery6.png" return "qrc:/qml/images/battery6.png"
......
...@@ -85,9 +85,9 @@ MouseArea { ...@@ -85,9 +85,9 @@ MouseArea {
} }
Label { Label {
anchors { anchors {
top: parent.bottom top: parent.top
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
topMargin: -30 topMargin: 30
} }
font.pointSize: 8 font.pointSize: 8
text: Lipstick.compositor.windowForId(model.window).title text: Lipstick.compositor.windowForId(model.window).title
......
...@@ -34,11 +34,7 @@ import QtQuick.Controls.Nemo 1.0 ...@@ -34,11 +34,7 @@ import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
Component { Component {
Rectangle { CommonPanel {
height: 240
width: root.width
color: "#313131"
opacity: 0.5
Column { Column {
Repeater { Repeater {
model: wifimodel model: wifimodel
......
...@@ -288,7 +288,9 @@ Compositor { ...@@ -288,7 +288,9 @@ Compositor {
WindowWrapperMystic { } WindowWrapperMystic { }
} }
onDisplayOff: setCurrentWindow(root.homeWindow) onDisplayOff:
if (root.topmostAlarmWindow == null)
setCurrentWindow(root.homeWindow)
onWindowAdded: { onWindowAdded: {
console.log("Compositor: Window added \"" + window.title + "\"" + " category: " + window.category) console.log("Compositor: Window added \"" + window.title + "\"" + " category: " + window.category)
...@@ -342,9 +344,14 @@ Compositor { ...@@ -342,9 +344,14 @@ Compositor {
} }
} }
onWindowRaised: {
console.log("Compositor: Raising window: " + window.title + " category: " + window.category)
windowToFront(window.windowId)
}
onWindowRemoved: { onWindowRemoved: {
console.log("Compositor: Window removed \"" + window.title + "\"" + " category: " + window.category) console.log("Compositor: Window removed \"" + window.title + "\"" + " category: " + window.category)
Desktop.instance.switcher.switchModel.removeWindowForTitle(window.title)
var w = window.userData; var w = window.userData;
if (window.category == "alarm") { if (window.category == "alarm") {
root.topmostAlarmWindow = null root.topmostAlarmWindow = null
......
...@@ -31,7 +31,9 @@ qml.files = qml/MainScreen.qml \ ...@@ -31,7 +31,9 @@ qml.files = qml/MainScreen.qml \
qml/NumButton.qml \ qml/NumButton.qml \
qml/USBModeSelector.qml \ qml/USBModeSelector.qml \
qml/Pager.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.path = /usr/share/lipstick-glacier-home-qt5/qml/compositor
qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \ qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \
...@@ -50,6 +52,8 @@ DEFINES += QT_COMPOSITOR_QUICK ...@@ -50,6 +52,8 @@ DEFINES += QT_COMPOSITOR_QUICK
HEADERS += \ HEADERS += \
glacierwindowmodel.h glacierwindowmodel.h
MOC_DIR = .moc
SOURCES += \ SOURCES += \
main.cpp \ main.cpp \
glacierwindowmodel.cpp glacierwindowmodel.cpp
...@@ -84,6 +88,8 @@ OTHER_FILES += qml/*.qml \ ...@@ -84,6 +88,8 @@ OTHER_FILES += qml/*.qml \
qml/SimPanel.qml \ qml/SimPanel.qml \
qml/NumButton.qml \ qml/NumButton.qml \
qml/USBModeSelector.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