Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
glacier-home
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
glacier-home
Commits
0f875c5a
Commit
0f875c5a
authored
Mar 11, 2018
by
Chupligin Sergey
Committed by
Sergey Chupligin
Mar 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Notifications] Fixup some warnings in qml and set Lockscreen notify
configurable
parent
5a825cb4
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
208 additions
and
87 deletions
+208
-87
Lockscreen.qml
src/qml/Lockscreen.qml
+11
-6
NotificationItem.qml
src/qml/notifications/NotificationItem.qml
+102
-76
notifications.json
src/settings-plugins/notifications/notifications.json
+5
-0
notifications.qml
src/settings-plugins/notifications/notifications.qml
+72
-0
notifications.svg
src/settings-plugins/notifications/notifications.svg
+2
-0
src.pro
src/src.pro
+16
-5
No files found.
src/qml/Lockscreen.qml
View file @
0f875c5a
...
@@ -24,6 +24,12 @@ Image {
...
@@ -24,6 +24,12 @@ Image {
defaultValue
:
"
/usr/share/lipstick-glacier-home-qt5/qml/images/graphics-wallpaper-home.jpg
"
defaultValue
:
"
/usr/share/lipstick-glacier-home-qt5/qml/images/graphics-wallpaper-home.jpg
"
}
}
ConfigurationValue
{
id
:
showNotifiBody
key
:
"
/home/glacier/lockScreen/showNotifiBody
"
defaultValue
:
false
}
LockscreenClock
{
LockscreenClock
{
id
:
clock
id
:
clock
anchors
{
anchors
{
...
@@ -276,20 +282,19 @@ Image {
...
@@ -276,20 +282,19 @@ Image {
}
}
clip
:
true
clip
:
true
delegate
:
NotificationItem
{
delegate
:
NotificationItem
{
height
:
Theme
.
itemHeightLarge
height
:
(
showNotifiBody
.
value
)
?
Theme
.
itemHeightExtraLarge
:
Theme
.
itemHeightLarge
enabled
:
DeviceLock
.
state
!==
DeviceLock
.
Locked
enabled
:
DeviceLock
.
state
!==
DeviceLock
.
Locked
scale
:
notificationColumn
.
opacity
scale
:
notificationColumn
.
opacity
transformOrigin
:
Item
.
Left
transformOrigin
:
Item
.
Left
iconSize
:
Theme
.
itemHeightMedium
appName.font.pixelSize
:
Theme
.
fontSizeSmall
appName.font.pixelSize
:
Theme
.
fontSizeSmall
appName.visible
:
DeviceLock
.
state
!==
DeviceLock
.
Locked
appName.visible
:
DeviceLock
.
state
!==
DeviceLock
.
Locked
appName.anchors.verticalCenter
:
labelColumn
.
verticalCenter
appName.anchors.verticalCenter
:
parent
.
verticalCenter
appBody.font.pixelSize
:
Theme
.
fontSizeTiny
appBody.font.pixelSize
:
Theme
.
fontSizeTiny
appBody.visible
:
fals
e
appBody.visible
:
showNotifiBody
.
valu
e
appTimestamp.visible
:
false
appTimestamp.visible
:
false
appSummary.visible
:
fals
e
appSummary.visible
:
showNotifiBody
.
valu
e
pressBg.visible
:
DeviceLock
.
state
!==
DeviceLock
.
Locked
pressBg.visible
:
DeviceLock
.
state
!==
DeviceLock
.
Locked
pressBg.opacity
:
0.
3
pressBg.opacity
:
0.
5
}
}
}
}
}
}
src/qml/notifications/NotificationItem.qml
View file @
0f875c5a
...
@@ -2,23 +2,31 @@ import QtQuick 2.6
...
@@ -2,23 +2,31 @@ import QtQuick 2.6
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
MouseArea
{
Item
{
id
:
notifyArea
id
:
notifyArea
height
:
Theme
.
itemHeightExtraLarge
height
:
Theme
.
itemHeightExtraLarge
width
:
parent
.
width
width
:
parent
.
width
-
Theme
.
itemSpacingSmall
*
2
anchors
{
left
:
parent
.
left
leftMargin
:
Theme
.
itemSpacingSmall
}
property
alias
appIcon
:
appIcon
property
alias
appIcon
:
appIcon
property
alias
appBody
:
appBody
property
alias
appBody
:
appBody
property
alias
appName
:
appName
property
alias
appName
:
appName
property
alias
appSummary
:
appSummary
property
alias
appSummary
:
appSummary
property
alias
labelColumn
:
labelColumn
property
alias
appTimestamp
:
appTimestamp
property
alias
appTimestamp
:
appTimestamp
property
alias
pressBg
:
pressBg
property
alias
pressBg
:
pressBg
property
int
iconSize
:
Math
.
min
(
Theme
.
iconSizeLauncher
,
height
-
Theme
.
itemSpacingMedium
)
property
int
iconSize
:
Math
.
min
(
Theme
.
iconSizeLauncher
,
height
-
Theme
.
itemSpacingMedium
)
property
string
timeAgo
property
string
timeAgo
property
int
swipeTreshold
:
notifyArea
.
width
/
3
property
int
swipeTreshold
:
notifyArea
.
width
/
3
MouseArea
{
id
:
notifyMouseArea
anchors.fill
:
parent
drag.target
:
modelData
.
userRemovable
?
notifyArea
:
null
drag.target
:
modelData
.
userRemovable
?
notifyArea
:
null
drag.axis
:
Drag
.
XAxis
drag.axis
:
Drag
.
XAxis
drag.minimumX
:
-
notifyArea
.
width
drag.minimumX
:
-
notifyArea
.
width
...
@@ -35,6 +43,15 @@ MouseArea {
...
@@ -35,6 +43,15 @@ MouseArea {
}
}
}
}
onClicked
:
{
if
(
modelData
.
userRemovable
)
{
slideAnimation
.
start
()
}
else
{
modelData
.
actionInvoked
(
"
default
"
)
}
}
}
function
refreshTimestamp
()
{
function
refreshTimestamp
()
{
var
seconds
=
Math
.
floor
((
new
Date
()
-
modelData
.
timestamp
)
/
1000
)
var
seconds
=
Math
.
floor
((
new
Date
()
-
modelData
.
timestamp
)
/
1000
)
var
years
=
Math
.
floor
(
seconds
/
(
365
*
24
*
60
*
60
))
var
years
=
Math
.
floor
(
seconds
/
(
365
*
24
*
60
*
60
))
...
@@ -78,13 +95,6 @@ MouseArea {
...
@@ -78,13 +95,6 @@ MouseArea {
}
}
}
}
onClicked
:
{
if
(
modelData
.
userRemovable
)
{
slideAnimation
.
start
()
}
else
{
modelData
.
actionInvoked
(
"
default
"
)
}
}
NumberAnimation
{
NumberAnimation
{
id
:
slideAnimation
id
:
slideAnimation
target
:
notifyArea
target
:
notifyArea
...
@@ -119,9 +129,23 @@ MouseArea {
...
@@ -119,9 +129,23 @@ MouseArea {
id
:
pressBg
id
:
pressBg
anchors.fill
:
parent
anchors.fill
:
parent
color
:
Theme
.
fillColor
color
:
Theme
.
fillColor
visible
:
notifyArea
.
pressed
visible
:
notifyMouseArea
.
pressed
radius
:
Theme
.
itemSpacingMedium
opacity
:
0.5
}
Rectangle
{
id
:
progressBar
width
:
parent
.
width
*
modelData
.
progress
height
:
parent
.
height
color
:
Theme
.
accentColor
radius
:
Theme
.
itemSpacingMedium
radius
:
Theme
.
itemSpacingMedium
opacity
:
0.1
opacity
:
0.75
anchors
{
top
:
parent
.
top
left
:
parent
.
left
}
visible
:
modelData
.
hasProgress
}
}
Image
{
Image
{
...
@@ -155,15 +179,6 @@ MouseArea {
...
@@ -155,15 +179,6 @@ MouseArea {
}
}
}
}
}
}
Column
{
id
:
labelColumn
anchors
{
left
:
appIcon
.
right
leftMargin
:
Theme
.
itemSpacingLarge
verticalCenter
:
appIcon
.
verticalCenter
}
height
:
parent
.
height
width
:
parent
.
width
-
appIcon
.
width
-
Theme
.
itemSpacingLarge
*
2
Label
{
Label
{
id
:
appName
id
:
appName
...
@@ -173,9 +188,13 @@ MouseArea {
...
@@ -173,9 +188,13 @@ MouseArea {
elide
:
Text
.
ElideRight
elide
:
Text
.
ElideRight
font.pixelSize
:
Theme
.
fontSizeSmall
font.pixelSize
:
Theme
.
fontSizeSmall
anchors
{
anchors
{
left
:
parent
.
left
left
:
appIcon
.
right
leftMargin
:
Theme
.
itemSpacingSmall
top
:
parent
.
top
topMargin
:
Theme
.
itemSpacingSmall
}
}
}
}
Label
{
Label
{
id
:
appTimestamp
id
:
appTimestamp
color
:
Theme
.
textColor
color
:
Theme
.
textColor
...
@@ -183,9 +202,11 @@ MouseArea {
...
@@ -183,9 +202,11 @@ MouseArea {
text
:
if
(
timeAgo
)
timeAgo
text
:
if
(
timeAgo
)
timeAgo
horizontalAlignment
:
Text
.
AlignRight
horizontalAlignment
:
Text
.
AlignRight
anchors
{
anchors
{
verticalCenter
:
appName
.
verticalCenter
top
:
parent
.
top
topMargin
:
Theme
.
itemSpacingSmall
right
:
parent
.
right
rightMargin
:
Theme
.
itemSpacingSmall
rightMargin
:
Theme
.
itemSpacingSmall
right
:
labelColumn
.
right
}
}
Component.onCompleted
:
refreshTimestamp
()
Component.onCompleted
:
refreshTimestamp
()
}
}
...
@@ -197,7 +218,10 @@ MouseArea {
...
@@ -197,7 +218,10 @@ MouseArea {
color
:
Theme
.
textColor
color
:
Theme
.
textColor
font.pixelSize
:
Theme
.
fontSizeTiny
font.pixelSize
:
Theme
.
fontSizeTiny
anchors
{
anchors
{
left
:
parent
.
left
left
:
appIcon
.
right
leftMargin
:
Theme
.
itemSpacingSmall
top
:
appName
.
bottom
topMargin
:
Theme
.
itemSpacingSmall
}
}
maximumLineCount
:
1
maximumLineCount
:
1
elide
:
Text
.
ElideRight
elide
:
Text
.
ElideRight
...
@@ -210,10 +234,12 @@ MouseArea {
...
@@ -210,10 +234,12 @@ MouseArea {
color
:
Theme
.
textColor
color
:
Theme
.
textColor
font.pixelSize
:
Theme
.
fontSizeTiny
font.pixelSize
:
Theme
.
fontSizeTiny
anchors
{
anchors
{
left
:
parent
.
left
left
:
appIcon
.
right
leftMargin
:
Theme
.
itemSpacingSmall
top
:
appSummary
.
bottom
topMargin
:
Theme
.
itemSpacingSmall
}
}
maximumLineCount
:
1
maximumLineCount
:
1
elide
:
Text
.
ElideRight
elide
:
Text
.
ElideRight
}
}
}
}
}
src/settings-plugins/notifications/notifications.json
0 → 100644
View file @
0f875c5a
{
"path"
:
"notifications"
,
"category"
:
"Personalization"
,
"title"
:
"Notifications"
}
src/settings-plugins/notifications/notifications.qml
0 → 100644
View file @
0f875c5a
/*
* Copyright (C) 2018 Chupligin Sergey <neochapay@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
import
QtQuick
2.6
import
QtQuick
.
Controls
1.0
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
org
.
nemomobile
.
configuration
1.0
import
"
../../components
"
Page
{
id
:
notifySettingsPage
headerTools
:
HeaderToolsLayout
{
showBackButton
:
true
;
title
:
qsTr
(
"
Notifications
"
)}
ConfigurationValue
{
id
:
showNotifiBody
key
:
"
/home/glacier/lockScreen/showNotifiBody
"
defaultValue
:
false
}
SettingsColumn
{
id
:
showNotifiBodySettings
Rectangle
{
id
:
showNotifiBodyArea
width
:
parent
.
width
height
:
childrenRect
.
height
color
:
"
transparent
"
Label
{
id
:
showNotifiBodyLabel
text
:
qsTr
(
"
Show notification body on lockscreen
"
);
anchors
{
left
:
parent
.
left
top
:
parent
.
top
}
width
:
parent
.
width
-
showNotifiBodyCheck
.
width
wrapMode
:
Text
.
WordWrap
}
CheckBox
{
id
:
showNotifiBodyCheck
checked
:
showNotifiBody
.
value
anchors
{
right
:
parent
.
right
verticalCenter
:
showNotifiBodyLabel
.
verticalCenter
}
onClicked
:
showNotifiBody
.
value
=
checked
}
}
}
}
src/settings-plugins/notifications/notifications.svg
0 → 100644
View file @
0f875c5a
<?xml version="1.0" encoding="utf-8"?>
<svg
width=
"1792"
height=
"1792"
viewBox=
"0 0 1792 1792"
xmlns=
"http://www.w3.org/2000/svg"
><path
d=
"M912 1696q0-16-16-16-59 0-101.5-42.5t-42.5-101.5q0-16-16-16t-16 16q0 73 51.5 124.5t124.5 51.5q16 0 16-16zm816-288q0 52-38 90t-90 38h-448q0 106-75 181t-181 75-181-75-75-181h-448q-52 0-90-38t-38-90q50-42 91-88t85-119.5 74.5-158.5 50-206 19.5-260q0-152 117-282.5t307-158.5q-8-19-8-39 0-40 28-68t68-28 68 28 28 68q0 20-8 39 190 28 307 158.5t117 282.5q0 139 19.5 260t50 206 74.5 158.5 85 119.5 91 88z"
fill=
"#fff"
/></svg>
\ No newline at end of file
src/src.pro
View file @
0f875c5a
...
@@ -83,13 +83,20 @@ statusbar.files = qml/statusbar/BatteryPanel.qml\
...
@@ -83,13 +83,20 @@ statusbar.files = qml/statusbar/BatteryPanel.qml\
qml/statusbar/NumButton.qml \
qml/statusbar/NumButton.qml \
qml/statusbar/MediaController.qml
qml/statusbar/MediaController.qml
settingsplugin.files = settings-plugins/wallpaper/wallpaper.qml \
settings
wallpaper
plugin.files = settings-plugins/wallpaper/wallpaper.qml \
settings-plugins/wallpaper/selectImage.qml \
settings-plugins/wallpaper/selectImage.qml \
settings-plugins/wallpaper/wallpaper.svg
settings-plugins/wallpaper/wallpaper.svg
settingsplugin.path = /usr/share/glacier-settings/qml/plugins/wallpaper
settingswallpaperplugin.path = /usr/share/glacier-settings/qml/plugins/wallpaper
settingsnotificationsplugin.files = settings-plugins/notifications/notifications.qml \
settings-plugins/notifications/notifications.svg
settingsnotificationsplugin.path = /usr/share/glacier-settings/qml/plugins/notifications
settingspluginconfig.files = settings-plugins/wallpaper/wallpaper.json \
settings-plugins/notifications/notifications.json
settingspluginconfig.files = settings-plugins/wallpaper/wallpaper.json
settingspluginconfig.path = /usr/share/glacier-settings/plugins
settingspluginconfig.path = /usr/share/glacier-settings/plugins
INSTALLS += styles \
INSTALLS += styles \
...
@@ -103,7 +110,8 @@ INSTALLS += styles \
...
@@ -103,7 +110,8 @@ INSTALLS += styles \
connectivity\
connectivity\
notifications\
notifications\
statusbar\
statusbar\
settingsplugin\
settingswallpaperplugin\
settingsnotificationsplugin\
settingspluginconfig
settingspluginconfig
CONFIG += qt link_pkgconfig
CONFIG += qt link_pkgconfig
...
@@ -158,4 +166,7 @@ DISTFILES += \
...
@@ -158,4 +166,7 @@ DISTFILES += \
i18n/glacer-home.ts \
i18n/glacer-home.ts \
qml/connectivity/ConnectionSelector.qml \
qml/connectivity/ConnectionSelector.qml \
qml/statusbar/BatteryIndicator.qml \
qml/statusbar/BatteryIndicator.qml \
settings-plugins/wallpaper/selectImage.qml
settings-plugins/wallpaper/selectImage.qml \
settings-plugins/notifications/notifications.json \
settings-plugins/notifications/notifications.svg \
settings-plugins/notifications/notifications.qml
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment