Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' into applauncher_fixes
  • Loading branch information
eetu committed Aug 20, 2017
2 parents 61263bc + 4dd1e10 commit 807b975
Show file tree
Hide file tree
Showing 19 changed files with 308 additions and 103 deletions.
111 changes: 111 additions & 0 deletions src/i18n/glacer-home-nl.ts
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>AppLauncher</name>
<message>
<location filename="../qml/AppLauncher.qml" line="67"/>
<source>Remove</source>
<translation>Verwijderen</translation>
</message>
<message>
<location filename="../qml/AppLauncher.qml" line="82"/>
<source>Uninstall</source>
<translation>Verwijderen</translation>
</message>
</context>
<context>
<name>AppSwitcher</name>
<message>
<location filename="../qml/AppSwitcher.qml" line="173"/>
<source>Close
All</source>
<translation>Alles sluiten</translation>
</message>
<message>
<location filename="../qml/AppSwitcher.qml" line="187"/>
<source>No apps open</source>
<translation>Geen open apps</translation>
</message>
</context>
<context>
<name>BatteryPanel</name>
<message>
<location filename="../qml/BatteryPanel.qml" line="39"/>
<source>Battery level</source>
<translation>Batterijniveau</translation>
</message>
</context>
<context>
<name>CommonPanel</name>
<message>
<location filename="../qml/CommonPanel.qml" line="42"/>
<source>Close</source>
<translation>Sluiten</translation>
</message>
</context>
<context>
<name>LauncherItemDelegate</name>
<message>
<location filename="../qml/LauncherItemDelegate.qml" line="147"/>
<source>Remove</source>
<translation>Verwijderen</translation>
</message>
<message>
<location filename="../qml/LauncherItemDelegate.qml" line="148"/>
<source>Uninstall</source>
<translation>Verwijderen</translation>
</message>
<message>
<location filename="../qml/LauncherItemDelegate.qml" line="170"/>
<source>Removing</source>
<translation>Verwijderen</translation>
</message>
<message>
<location filename="../qml/LauncherItemDelegate.qml" line="172"/>
<source>Uninstalling</source>
<translation>Verwijderen</translation>
</message>
</context>
<context>
<name>SimPanel</name>
<message>
<location filename="../qml/SimPanel.qml" line="76"/>
<source>OK</source>
<translation>Oké</translation>
</message>
<message>
<location filename="../qml/SimPanel.qml" line="87"/>
<source>Clear</source>
<translation>Wissen</translation>
</message>
<message>
<location filename="../qml/SimPanel.qml" line="135"/>
<source>No pin required!</source>
<translation>Geen PIN-code nodig!</translation>
</message>
</context>
<context>
<name>USBModeSelector</name>
<message>
<location filename="../qml/USBModeSelector.qml" line="82"/>
<source>Current mode: Charging only</source>
<translation>Huidige modus: alleen opladen</translation>
</message>
<message>
<location filename="../qml/USBModeSelector.qml" line="98"/>
<source>MTP Mode</source>
<translation>MTP-modus</translation>
</message>
<message>
<location filename="../qml/USBModeSelector.qml" line="118"/>
<source>Mass Storage Mode</source>
<translation>Massaopslagmodus</translation>
</message>
<message>
<location filename="../qml/USBModeSelector.qml" line="138"/>
<source>Developer Mode</source>
<translation>Ontwikkelaarsmodus</translation>
</message>
</context>
</TS>
21 changes: 11 additions & 10 deletions src/qml/AppLauncher.qml
Expand Up @@ -34,17 +34,20 @@ import QtQuick.Controls.Styles.Nemo 1.0

GridView {
id: gridview
cellWidth: cellSize
cellHeight: cellSize
width: parent.width
width: cellWidth * columns
cacheBuffer: gridview.contentHeight
property Item reorderItem
property bool onUninstall
property alias deleter: deleter
property var switcher: null
property string searchString
property int minCellSize: Theme.iconSizeLauncher + Theme.itemSpacingHuge
property int rows: Math.floor(parent.height / minCellSize)
property int columns: Math.floor(parent.width / minCellSize)

cellWidth: parent.width / columns
cellHeight: Math.round(parent.height / rows)

property int cellSize: Math.min(parent.width,parent.height)/4
property int folderIndex: -1
property bool isRootFolder:true
property bool newFolderActive
Expand Down Expand Up @@ -232,7 +235,7 @@ GridView {
height: parent.height
width: parent.width - (removeIcon.visible ? removeIcon.width : 0)
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: Theme.fontSizeLarge
font.pixelSize: Theme.fontSizeSmall
elide:Text.ElideRight
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
Expand Down Expand Up @@ -266,14 +269,13 @@ GridView {
source: "image://theme/trash"
visible: deleter.state != "uninstall"
}

Label {
id: uninstallLabel
height: parent.height
width: parent.width - (trashIcon.visible ? trashIcon.width : 0)
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Uninstall")
font.pixelSize: Theme.fontSizeLarge
font.pixelSize: Theme.fontSizeSmall
elide:Text.ElideRight
horizontalAlignment:Text.AlignHCenter
verticalAlignment:Text.AlignVCenter
Expand All @@ -288,12 +290,11 @@ GridView {
//Using loader that in the future we can also have widgets as delegate
delegate: Loader {
id:loader
width: cellSize
height: cellSize
width: cellWidth
height: cellHeight
onXChanged: item.x = x
onYChanged: item.y = y
property QtObject modelData : model
property int cellSize: gridview.cellHeight
property int cellIndex: index
sourceComponent: object.type == LauncherModel.Folder ? folder : app
}
Expand Down
2 changes: 1 addition & 1 deletion src/qml/AppSwitcher.qml
Expand Up @@ -68,7 +68,7 @@ Item {
left: parent.left
}
font.weight: Font.Light
font.pixelSize: Theme.fontSizeExtraLarge
font.pixelSize: Theme.fontSizeLarge
}
}
Flickable {
Expand Down
52 changes: 32 additions & 20 deletions src/qml/DeviceLockUI.qml
Expand Up @@ -14,6 +14,8 @@ Item {

property bool shouldAuthenticate: Lipstick.compositor.visible
&& authenticator.availableMethods !== 0
property int remainingAttempts

onShouldAuthenticateChanged: {
if (shouldAuthenticate) {
DeviceLock.authorization.requestChallenge()
Expand All @@ -36,32 +38,50 @@ Item {
}
}


Authenticator {
id: authenticator
onAuthenticated: {
DeviceLock.unlock(authenticationToken)
Desktop.instance.setLockScreen(false)
Desktop.instance.codepadVisible = false
remainingAttempts = 0
}
onFeedback: {
console.log('### still locked', feedback, attemptsRemaining)
remainingAttempts = attemptsRemaining
animation.start()
}
}

ColumnLayout {
anchors.fill: parent
spacing: Theme.itemSpacingLarge
spacing: Theme.itemSpacingExtraSmall

SequentialAnimation {
id: animation;
SequentialAnimation {
loops: 4
NumberAnimation { target: codePad; property: "anchors.horizontalCenterOffset"; to: 55; duration: 50 }
NumberAnimation { target: codePad; property: "anchors.horizontalCenterOffset"; to: 0; duration: 50 }
}
NumberAnimation { target: codePad; property: "anchors.horizontalCenterOffset"; to: 0; duration: 100 }
}
Label {
font.pixelSize: Theme.fontSizeMedium
width: parent.width
text: remainingAttempts > 0 ? qsTr("Attempts remaining:") + " " + remainingAttempts : ""
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
id: lockCodeField
anchors.horizontalCenter: parent.horizontalCenter
readOnly: true
echoMode: TextInput.PasswordEchoOnEdit
font.pixelSize: Theme.fontSizeExtraLarge
font.pixelSize: Theme.fontSizeMedium
}

GridLayout {
id: codePad
height: parent.height
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
Expand All @@ -70,27 +90,19 @@ Item {
model: ["1","2","3","4","5","6","7","8","9","Ca","0","OK"]
delegate:
Button {
height: Theme.itemHeightHuge
width: Theme.itemHeightHuge
Layout.maximumWidth: Theme.itemHeightHuge * 1.5
Layout.maximumHeight: Theme.itemHeightHuge * 1.5
Label {
id: btnLabel
text: modelData
font.pixelSize: Theme.fontSizeExtraLarge * 1.5
anchors {
centerIn: parent
}
}

id:button
Layout.maximumWidth: Theme.itemWidthSmall
Layout.maximumHeight: Theme.itemHeightHuge * 2
Layout.minimumHeight: Theme.itemHeightHuge * 1.5
text: modelData
onClicked: {
if (btnLabel.text !== "Ca" && btnLabel.text !== "OK") {
lockCodeField.insert(lockCodeField.cursorPosition, btnLabel.text)
if (button.text !== "Ca" && button.text !== "OK") {
lockCodeField.insert(lockCodeField.cursorPosition, button.text)
} else {
if (btnLabel.text === "OK") {
if (button.text === "OK") {
authenticator.enterLockCode(lockCodeField.text)
lockCodeField.text = ""
} else if (btnLabel.text === "Ca"){
} else if (button.text === "Ca"){
lockCodeField.text = ""
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/qml/FeedsPage.qml
Expand Up @@ -59,7 +59,7 @@ Flickable {
id: displayDayOfWeek
text: Qt.formatDateTime(wallClock.time, "dddd")
color: Theme.textColor
font.pixelSize: Theme.fontSizeExtraLarge
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Bold
anchors {
top: parent.top
Expand All @@ -71,7 +71,7 @@ Flickable {
Label {
id: displayCurrentDate
text: Qt.formatDate(wallClock.time, "d MMMM yyyy")
font.pixelSize: Theme.fontSizeExtraLarge
font.pixelSize: Theme.fontSizeLarge
color: Theme.textColor
font.weight: Font.Light
wrapMode: Text.WordWrap
Expand Down
33 changes: 14 additions & 19 deletions src/qml/LauncherItemDelegate.qml
Expand Up @@ -67,19 +67,18 @@ Item {

Item {
id: iconWrapper
width: parent.width -parent.width/10
height: width - iconText.height
anchors.centerIn: parent
height: parent.height - iconText.height
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
y: Math.round((parent.height - (height + iconText.height)) / 2)

Image {
id: iconImage
anchors {
// centerIn: launcherItem.n.otNemoIcon ? parent : undefined
horizontalCenter: /* launcherItemnotNemoIcon ? undefined : */parent.horizontalCenter
top: parent.top
//topMargin: Theme.itemSpacingExtraSmall
}
width:/*launcherItem.notNemoIcon ? parent.width-parent.width/3 : */parent.width - parent.width/4
height: width
anchors.centerIn: parent
sourceSize.width: Theme.iconSizeLauncher
sourceSize.height: Theme.iconSizeLauncher
height: Theme.iconSizeLauncher
width: height
asynchronous: true
onStatusChanged: {
if (iconImage.status == Image.Error) {
Expand All @@ -89,11 +88,7 @@ Item {
}
Spinner {
id: spinnerr
anchors {
centerIn: iconImage
top: iconImage.top
topMargin: Theme.itemSpacingExtraSmall
}
anchors.centerIn: iconImage
width: iconWrapper.width
height: width
enabled: (modelData.object.type === LauncherModel.Application) ? modelData.object.isLaunching ? switcher.switchModel.getWindowIdForTitle(modelData.object.title) == 0 : false : false
Expand All @@ -116,13 +111,13 @@ Item {
width: iconWrapper.width
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
font.pixelSize: Theme.fontSizeSmall
font.pixelSize: Theme.fontSizeTiny
color: Theme.textColor
//https://bugreports.qt.io/browse/QTBUG-56052
y: -contentHeight + font.pixelSize + iconWrapper.y + iconWrapper.height
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
topMargin: Theme.itemSpacingExtraSmall
}
}
}
Expand Down

0 comments on commit 807b975

Please sign in to comment.