Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[misc] Many changes:
* USB Mode selection dialog now appears
* Migration to LauncherFolderModel in AppLauncher, folders not functional
* Notifications screen
* Application title in covers
  • Loading branch information
locusf committed Jul 2, 2014
1 parent 1dfe722 commit b96271a
Show file tree
Hide file tree
Showing 12 changed files with 247 additions and 45 deletions.
3 changes: 1 addition & 2 deletions rpm/lipstick-glacier-home-qt5.spec
Expand Up @@ -9,7 +9,7 @@ Name: lipstick-glacier-home-qt5
# << macros

Summary: A nice homescreen for Glacier experience
Version: 0.10
Version: 0.11
Release: 1
Group: System/GUI/Other
License: BSD
Expand All @@ -24,7 +24,6 @@ Requires: nemo-qml-plugin-time-qt5
Requires: qt5-qtdeclarative-import-window2
Requires: qt5-qtquickcontrols-nemo
Requires: nemo-qml-plugin-contextkit-qt5
Requires: connman-qt5
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(lipstick-qt5) >= 0.12.0
Expand Down
2 changes: 1 addition & 1 deletion rpm/lipstick-glacier-home-qt5.yaml
@@ -1,6 +1,6 @@
Name: lipstick-glacier-home-qt5
Summary: A nice homescreen for Glacier experience
Version: 0.10
Version: 0.11
Release: 1
Group: System/GUI/Other
License: BSD
Expand Down
3 changes: 0 additions & 3 deletions src/main.cpp
Expand Up @@ -33,9 +33,6 @@ int main(int argc, char **argv)
HomeApplication app(argc, argv, QString());

QGuiApplication::setFont(QFont("Open Sans"));
setenv("EGL_PLATFORM", "wayland", 1);
setenv("QT_QPA_PLATFORM", "wayland", 1);
setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1);

app.setCompositorPath("qrc:/qml/compositor.qml");
qmlRegisterType<GlacierWindowModel>("org.nemomobile.glacier", 1, 0 ,"GlacierWindowModel");
Expand Down
2 changes: 1 addition & 1 deletion src/qml/AppLauncher.qml
Expand Up @@ -84,7 +84,7 @@ GridView {
}
}

model: LauncherModel { id: launcherModel }
model: LauncherFolderModel { id: launcherModel }

delegate: LauncherItemDelegate {
id: launcherItem
Expand Down
1 change: 1 addition & 0 deletions src/qml/AppSwitcher.qml
Expand Up @@ -72,6 +72,7 @@ Item {
id: gridview
columns: 2
spacing: 10

move: Transition {
NumberAnimation {
properties: "x,y"
Expand Down
96 changes: 61 additions & 35 deletions src/qml/FeedsPage.qml
Expand Up @@ -22,50 +22,76 @@
// Copyright (c) 2011, Tom Swindell <t.swindell@rubyx.co.uk>
// Copyright (c) 2012, Timur Kristóf <venemo@fedoraproject.org>

import QtQuick 2.0
import QtQuick 2.1
import org.nemomobile.lipstick 0.1
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
// Feeds page:
// the place for an event feed.

Item {
// Day of week
Label {
id: displayDayOfWeek
text: Qt.formatDateTime(wallClock.time, "dddd")
color: "white"
anchors {
top: parent.top
left: parent.left
topMargin: 30
leftMargin: 20
}
}
Column {
spacing: 40
// Day of week
Row {
id: daterow
height: 120
Label {
id: displayDayOfWeek
text: Qt.formatDateTime(wallClock.time, "dddd") + ", "
color: "white"
font.pointSize: 12
font.bold: true
anchors {
top: parent.top
left: parent.left
topMargin: 30
leftMargin: 20
}
}

// Current date
Label {
id: displayCurrentDate
text: Qt.formatDate(wallClock.time, Qt.SystemLocaleShortDate)
color: "#888888"
anchors {
top: displayDayOfWeek.bottom
left: parent.left
topMargin: 5
leftMargin: 20
// Current date
Label {
id: displayCurrentDate
text: Qt.formatDate(wallClock.time, "d MMMM yyyy")
font.pointSize: 12
anchors {
left: displayDayOfWeek.right
top: parent.top
topMargin: 30
}
}
}
}
Column {
anchors.top: daterow.bottom
spacing: 40
Repeater {
model: NotificationListModel {
id: notifmodel
}
delegate: Row {
spacing: 16
height: 40
Image {
source: {
if (modelData.appIcon)
return "image://theme/" + modelData.appIcon
else
return ""
}
}

// Separator thingy
Rectangle {
height: 2
color: "#888888"
anchors {
top: displayCurrentDate.bottom
left: parent.left
right: parent.right
topMargin: 5
leftMargin: 20
rightMargin: 20
Label {
id: appSummary
text: modelData.summary
font.pointSize: 10
}
Label {
text: modelData.body
font.pointSize: 8
}
}
}
}
}
}
2 changes: 1 addition & 1 deletion src/qml/LauncherItemDelegate.qml
Expand Up @@ -157,7 +157,7 @@ Item {
Spinner {
id: spinner
anchors.centerIn: parent
enabled: model.object.isLaunching
enabled: (model.object.type === 0) ? model.object.isLaunching : false
}
}

Expand Down
11 changes: 11 additions & 0 deletions src/qml/SwitcherItem.qml
Expand Up @@ -24,6 +24,8 @@

import QtQuick 2.0
import org.nemomobile.lipstick 0.1
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0

MouseArea {
id: switcherItemRoot
Expand Down Expand Up @@ -81,6 +83,15 @@ MouseArea {
script: switcherItemRoot.close()
}
}
Label {
anchors {
top: parent.bottom
horizontalCenter: parent.horizontalCenter
topMargin: -30
}
font.pointSize: 8
text: Lipstick.compositor.windowForId(model.window).title
}

CloseButton {
id: closeButton
Expand Down
163 changes: 163 additions & 0 deletions src/qml/USBModeSelector.qml
@@ -0,0 +1,163 @@
import QtQuick 2.0
import org.nemomobile.lipstick 0.1

Item {
property bool isPortrait: (orientationAngleContextProperty.value == 90 || orientationAngleContextProperty.value == 270)
id: usbWindow
width: initialSize.width
height: initialSize.height

/*
TODO
ContextProperty {
id: orientationAngleContextProperty
key: "/Screen/CurrentWindow/OrientationAngle"
}
*/
QtObject {
id: orientationAngleContextProperty
property int value: 0
}

Item {
property bool shouldBeVisible
id: usbDialog
width: usbWindow.isPortrait ? usbWindow.height : usbWindow.width
height: usbWindow.isPortrait ? usbWindow.width : usbWindow.height
transform: Rotation {
origin.x: { switch(orientationAngleContextProperty.value) {
case 270:
return usbWindow.height / 2
case 180:
case 90:
return usbWindow.width / 2
default:
return 0
} }
origin.y: { switch(orientationAngleContextProperty.value) {
case 270:
case 180:
return usbWindow.height / 2
case 90:
return usbWindow.width / 2
default:
return 0
} }
angle: (orientationAngleContextProperty.value === undefined || orientationAngleContextProperty.value == 0) ? 0 : -360 + orientationAngleContextProperty.value
}
opacity: shouldBeVisible ? 1 : 0

Rectangle {
anchors.fill: parent
color: "black"
opacity: 0.8
border.color: "white"
}

MouseArea {
id: usbDialogBackground
anchors.fill: parent
onClicked: { usbModeSelector.setUSBMode(4); usbDialog.shouldBeVisible = false }

Rectangle {
id: chargingOnly
anchors {
top: parent.top
left: parent.left
right: parent.right
topMargin: parent.height / 4
}
height: 102
color: "black"
radius: 5
border {
color: "gray"
width: 2
}

Text {
anchors {
fill: parent
}
text: "Current mode: Charging only"
color: "white"
font.pixelSize: 30
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}

Text {
id: button1
anchors {
top: chargingOnly.bottom
topMargin: 40
left: parent.left
right: parent.right
}
text: "MTP Mode"
color: "white"
font.pixelSize: 30
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter

MouseArea {
anchors.fill: parent
onClicked: { usbModeSelector.setUSBMode(11); usbDialog.shouldBeVisible = false }
}
}

Text {
id: button2
anchors {
top: button1.bottom
topMargin: 40
left: parent.left
right: parent.right
}
text: "Mass Storage Mode"
color: "white"
font.pixelSize: 30
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter

MouseArea {
anchors.fill: parent
onClicked: { usbModeSelector.setUSBMode(3); usbDialog.shouldBeVisible = false }
}
}

Text {
id: button3
anchors {
top: button2.bottom
topMargin: 40
left: parent.left
right: parent.right
}
text: "Developer Mode"
color: "white"
font.pixelSize: 30
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter

MouseArea {
anchors.fill: parent
onClicked: { usbModeSelector.setUSBMode(10); usbDialog.shouldBeVisible = false }
}
}
}

Connections {
target: usbModeSelector
onWindowVisibleChanged: if (usbModeSelector.windowVisible) usbDialog.shouldBeVisible = true
}

Behavior on opacity {
NumberAnimation {
duration: 250
onRunningChanged: if (!running && usbDialog.opacity == 0) usbModeSelector.windowVisible = false
}
}
}
}
5 changes: 4 additions & 1 deletion src/qml/compositor.qml
Expand Up @@ -286,7 +286,8 @@ Compositor {
onWindowAdded: {
if (debug) console.log("Compositor: Window added \"" + window.title + "\"")

var isHomeWindow = window.isInProcess && root.homeWindow == null && window.title == "Home"
var isHomeWindow = window.isInProcess && root.homeWindow == null && window.title === "Home"
var isDialogWindow = window.category === "dialog"
var isNotificationWindow = window.category == "notification"
var isOverlayWindow = window.category == "overlay"
var parent = null
Expand Down Expand Up @@ -315,6 +316,8 @@ Compositor {
setCurrentWindow(homeWindow)
} else if (isNotificationWindow || isOverlayWindow) {

} else if (isDialogWindow){
setCurrentWindow(window)
} else {
w = mysticWrapper.createObject(parent, {window: window})
window.userData = w
Expand Down
1 change: 1 addition & 0 deletions src/resources-qml.qrc
Expand Up @@ -42,5 +42,6 @@
<file>qml/WifiPanel.qml</file>
<file>qml/SimPanel.qml</file>
<file>qml/NumButton.qml</file>
<file>qml/USBModeSelector.qml</file>
</qresource>
</RCC>
3 changes: 2 additions & 1 deletion src/src.pro
Expand Up @@ -51,6 +51,7 @@ OTHER_FILES += qml/*.qml \
qml/WifiPanel.qml \
nemovars.conf \
qml/SimPanel.qml \
qml/NumButton.qml
qml/NumButton.qml \
qml/USBModeSelector.qml


0 comments on commit b96271a

Please sign in to comment.