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
659bdf70
Commit
659bdf70
authored
Jan 26, 2017
by
Sergey Chupligin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[StatusBar] Update dir structure add animation of charging
parent
f3242fa6
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
112 additions
and
35 deletions
+112
-35
Statusbar.qml
src/qml/Statusbar.qml
+5
-30
BatteryIndicator.qml
src/qml/statusbar/BatteryIndicator.qml
+75
-0
BatteryPanel.qml
src/qml/statusbar/BatteryPanel.qml
+5
-1
CommonPanel.qml
src/qml/statusbar/CommonPanel.qml
+0
-0
NumButton.qml
src/qml/statusbar/NumButton.qml
+0
-0
SimPanel.qml
src/qml/statusbar/SimPanel.qml
+4
-0
StatusbarItem.qml
src/qml/statusbar/StatusbarItem.qml
+0
-0
WifiPanel.qml
src/qml/statusbar/WifiPanel.qml
+1
-1
src.pro
src/src.pro
+22
-3
No files found.
src/qml/Statusbar.qml
View file @
659bdf70
/****************************************************************************************
/****************************************************************************************
**
**
** Copyright (C) 2014 Aleksi Suomalainen <suomalainen.aleksi@gmail.com>
** Copyright (C) 2014 Aleksi Suomalainen <suomalainen.aleksi@gmail.com>
** Copyright (C) 2017 Sergey Chupligin <mail@neochapay.ru>
** All rights reserved.
** All rights reserved.
**
**
** You may use this file under the terms of BSD license as follows:
** You may use this file under the terms of BSD license as follows:
...
@@ -36,6 +37,8 @@ import org.freedesktop.contextkit 1.0
...
@@ -36,6 +37,8 @@ import org.freedesktop.contextkit 1.0
import
MeeGo
.
Connman
0.2
import
MeeGo
.
Connman
0.2
import
org
.
nemomobile
.
lipstick
0.1
import
org
.
nemomobile
.
lipstick
0.1
import
"
statusbar
"
Item
{
Item
{
id
:
root
id
:
root
z
:
201
z
:
201
...
@@ -69,12 +72,6 @@ Item {
...
@@ -69,12 +72,6 @@ Item {
}
}
}
}
ContextProperty
{
id
:
batteryChargePercentage
key
:
"
Battery.ChargePercentage
"
value
:
"
100
"
}
ContextProperty
{
ContextProperty
{
id
:
cellularSignalBars
id
:
cellularSignalBars
key
:
"
Cellular.SignalBars
"
key
:
"
Cellular.SignalBars
"
...
@@ -245,28 +242,6 @@ Item {
...
@@ -245,28 +242,6 @@ Item {
}
}
}
}
StatusbarItem
{
BatteryIndicator
{}
iconSize
:
root
.
height
/
2
panel
:
BatteryPanel
{}
source
:
{
if
(
batteryChargePercentage
.
value
>
85
)
{
return
"
/usr/share/lipstick-glacier-home-qt5/qml/images/battery6.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
5
)
{
return
"
/usr/share/lipstick-glacier-home-qt5/qml/images/battery0.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
10
)
{
return
"
/usr/share/lipstick-glacier-home-qt5/qml/images/battery1.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
25
)
{
return
"
/usr/share/lipstick-glacier-home-qt5/qml/images/battery2.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
40
)
{
return
"
/usr/share/lipstick-glacier-home-qt5/qml/imagesbattery3.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
65
)
{
return
"
/usr/share/lipstick-glacier-home-qt5/qml/images/battery4.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
80
)
{
return
"
/usr/share/lipstick-glacier-home-qt5/qml/images/battery5.png
"
}
else
{
return
"
/usr/share/lipstick-glacier-home-qt5/qml/images/battery6.png
"
}
}
}
}
}
}
}
src/qml/statusbar/BatteryIndicator.qml
0 → 100644
View file @
659bdf70
import
QtQuick
2.0
import
org
.
freedesktop
.
contextkit
1.0
StatusbarItem
{
id
:
batteryIndicator
property
int
chargeValue
:
0
ContextProperty
{
id
:
batteryChargePercentage
key
:
"
Battery.ChargePercentage
"
value
:
"
100
"
}
ContextProperty
{
id
:
batteryStateContextProperty
key
:
"
Battery.State
"
onValueChanged
:
{
if
(
batteryStateContextProperty
.
value
==
"
charging
"
)
{
chargingTimer
.
start
()
}
else
{
chargingTimer
.
stop
()
chargeIcon
();
}
}
}
iconSize
:
root
.
height
/
2
panel
:
BatteryPanel
{}
source
:
"
/usr/share/lipstick-glacier-home-qt5/qml/images/battery
"
+
chargeValue
+
"
.png
"
Timer
{
id
:
chargingTimer
interval
:
500
repeat
:
true
running
:
false
onTriggered
:
{
if
(
batteryIndicator
.
chargeValue
==
6
)
{
batteryIndicator
.
chargeValue
=
0
}
else
{
batteryIndicator
.
chargeValue
++
}
}
}
Component.onCompleted
:
{
chargeIcon
();
}
function
chargeIcon
()
{
if
(
batteryChargePercentage
.
value
>
85
)
{
batteryIndicator
.
chargeValue
=
6
}
else
if
(
batteryChargePercentage
.
value
<=
5
)
{
batteryIndicator
.
chargeValue
=
0
}
else
if
(
batteryChargePercentage
.
value
<=
10
)
{
batteryIndicator
.
chargeValue
=
1
}
else
if
(
batteryChargePercentage
.
value
<=
25
)
{
batteryIndicator
.
chargeValue
=
2
}
else
if
(
batteryChargePercentage
.
value
<=
40
)
{
batteryIndicator
.
chargeValue
=
3
}
else
if
(
batteryChargePercentage
.
value
<=
65
)
{
batteryIndicator
.
chargeValue
=
4
}
else
if
(
batteryChargePercentage
.
value
<=
80
)
{
batteryIndicator
.
chargeValue
=
5
}
else
{
batteryIndicator
.
chargeValue
=
6
}
}
}
src/qml/BatteryPanel.qml
→
src/qml/
statusbar/
BatteryPanel.qml
View file @
659bdf70
...
@@ -35,9 +35,13 @@ import QtQuick.Controls.Styles.Nemo 1.0
...
@@ -35,9 +35,13 @@ import QtQuick.Controls.Styles.Nemo 1.0
Component
{
Component
{
CommonPanel
{
CommonPanel
{
name
:
qsTr
(
"
Battery
"
);
switcherEnabled
:
false
Label
{
Label
{
text
:
qsTr
(
"
Battery l
evel
"
)
+
"
:
"
+
batteryChargePercentage
.
value
+
"
%
"
text
:
qsTr
(
"
L
evel
"
)
+
"
:
"
+
batteryChargePercentage
.
value
+
"
%
"
font.pointSize
:
8
font.pointSize
:
8
anchors.centerIn
:
parent
}
}
}
}
}
}
src/qml/CommonPanel.qml
→
src/qml/
statusbar/
CommonPanel.qml
View file @
659bdf70
File moved
src/qml/NumButton.qml
→
src/qml/
statusbar/
NumButton.qml
View file @
659bdf70
File moved
src/qml/SimPanel.qml
→
src/qml/
statusbar/
SimPanel.qml
View file @
659bdf70
...
@@ -38,6 +38,9 @@ import QtQuick.Layouts 1.0
...
@@ -38,6 +38,9 @@ import QtQuick.Layouts 1.0
Component
{
Component
{
CommonPanel
{
CommonPanel
{
id
:
simpanel
id
:
simpanel
name
:
qsTr
(
"
SimCard
"
)
switcherEnabled
:
false
property
bool
needsPin
:
simManager
.
pinRequired
===
OfonoSimManager
.
SimPin
||
property
bool
needsPin
:
simManager
.
pinRequired
===
OfonoSimManager
.
SimPin
||
simManager
.
pinRequired
===
OfonoSimManager
.
SimPuk
simManager
.
pinRequired
===
OfonoSimManager
.
SimPuk
onNeedsPinChanged
:
{
onNeedsPinChanged
:
{
...
@@ -136,6 +139,7 @@ Component {
...
@@ -136,6 +139,7 @@ Component {
visible
:
!
needsPin
visible
:
!
needsPin
text
:
qsTr
(
"
No pin required!
"
)
text
:
qsTr
(
"
No pin required!
"
)
font.pointSize
:
16
font.pointSize
:
16
anchors.centerIn
:
parent
}
}
}
}
}
}
src/qml/StatusbarItem.qml
→
src/qml/
statusbar/
StatusbarItem.qml
View file @
659bdf70
File moved
src/qml/WifiPanel.qml
→
src/qml/
statusbar/
WifiPanel.qml
View file @
659bdf70
...
@@ -82,7 +82,7 @@ Component {
...
@@ -82,7 +82,7 @@ Component {
Label
{
Label
{
anchors
{
anchors
{
leftMargin
:
20
leftMargin
:
20
vertialCenter
:
statusImage
.
verticalCenter
verti
c
alCenter
:
statusImage
.
verticalCenter
}
}
width
:
root
.
width
width
:
root
.
width
font.pointSize
:
8
font.pointSize
:
8
...
...
src/src.pro
View file @
659bdf70
...
@@ -70,8 +70,26 @@ notifications.path = /usr/share/lipstick-glacier-home-qt5/qml/notifications
...
@@ -70,8 +70,26 @@ notifications.path = /usr/share/lipstick-glacier-home-qt5/qml/notifications
notifications.files = qml/notifications/NotificationItem.qml\
notifications.files = qml/notifications/NotificationItem.qml\
qml/notifications/NotificationPreview.qml
qml/notifications/NotificationPreview.qml
statusbar.path = /usr/share/lipstick-glacier-home-qt5/qml/statusbar
INSTALLS += styles images theme qml qmlcompositor scripts system volumecontrol connectivity notifications
statusbar.files = qml/statusbar/BatteryPanel.qml\
qml/statusbar/BatteryIndicator.qml \
qml/statusbar/CommonPanel.qml\
qml/statusbar/SimPanel.qml\
qml/statusbar/WifiPanel.qml\
qml/statusbar/StatusbarItem.qml\
qml/statusbar/NumButton.qml
INSTALLS += styles \
images \
theme \
qml \
qmlcompositor\
scripts\
system\
volumecontrol\
connectivity\
notifications\
statusbar
CONFIG += qt link_pkgconfig
CONFIG += qt link_pkgconfig
QT += quick compositor
QT += quick compositor
...
@@ -122,4 +140,5 @@ TRANSLATIONS += i18n/glacer-home.ts
...
@@ -122,4 +140,5 @@ TRANSLATIONS += i18n/glacer-home.ts
DISTFILES += \
DISTFILES += \
i18n/glacer-home.ts \
i18n/glacer-home.ts \
qml/connectivity/ConnectionSelector.qml
qml/connectivity/ConnectionSelector.qml \
qml/statusbar/BatteryIndicator.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