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
d052d9ed
Commit
d052d9ed
authored
Mar 16, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Battery as images.
parent
e5f94796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
22 deletions
+23
-22
MainScreen.qml
src/qml/MainScreen.qml
+16
-22
resources-qml.qrc
src/resources-qml.qrc
+7
-0
No files found.
src/qml/MainScreen.qml
View file @
d052d9ed
...
@@ -66,16 +66,20 @@ Page {
...
@@ -66,16 +66,20 @@ Page {
Connections
{
Connections
{
target
:
batterystatus
target
:
batterystatus
onValueChanged
:
{
onValueChanged
:
{
batterylbl
.
text
=
"
Battery status:
"
+
batterystatus
.
value
if
(
batterystatus
.
value
>
85
)
{
}
batteryimg
.
source
=
"
images/battery6.png
"
}
}
else
if
(
batterystatus
.
value
<=
70
)
{
Connections
{
batteryimg
.
source
=
"
images/battery5.png
"
target
:
onbattery
}
else
if
(
batterystatus
.
value
<=
55
)
{
onValueChanged
:
{
batteryimg
.
source
=
"
images/battery4.png
"
if
(
onbattery
.
value
)
{
}
else
if
(
batterystatus
.
value
<=
40
)
{
charging
.
text
=
"
On battery
"
batteryimg
.
source
=
"
images/battery3.png
"
}
else
{
}
else
if
(
batterystatus
.
value
<=
25
)
{
charging
.
text
=
"
On wall
"
batteryimg
.
source
=
"
images/battery2.png
"
}
else
if
(
batterystatus
.
value
<=
10
)
{
batteryimg
.
source
=
"
images/battery1.png
"
}
else
if
(
batterystatus
.
value
<=
5
)
{
batteryimg
.
source
=
"
images/battery0.png
"
}
}
}
}
}
}
...
@@ -85,22 +89,12 @@ Page {
...
@@ -85,22 +89,12 @@ Page {
key
:
"
Battery.ChargePercentage
"
key
:
"
Battery.ChargePercentage
"
value
:
"
100
"
value
:
"
100
"
}
}
ContextProperty
{
id
:
onbattery
key
:
"
Battery.OnBattery
"
}
tools
:
Item
{
tools
:
Item
{
Label
{
Image
{
id
:
batterylbl
id
:
batteryimg
font.pointSize
:
8
color
:
"
black
"
}
Label
{
id
:
charging
font.pointSize
:
8
font.pointSize
:
8
color
:
"
black
"
color
:
"
black
"
anchors.right
:
batterylbl
.
left
}
}
}
}
...
...
src/resources-qml.qrc
View file @
d052d9ed
...
@@ -23,5 +23,12 @@
...
@@ -23,5 +23,12 @@
<file>qml/images/textinput.png</file>
<file>qml/images/textinput.png</file>
<file>qml/images/toolbar.png</file>
<file>qml/images/toolbar.png</file>
<file>qml/images/graphics-wallpaper-home.jpg</file>
<file>qml/images/graphics-wallpaper-home.jpg</file>
<file>qml/images/battery0.png</file>
<file>qml/images/battery1.png</file>
<file>qml/images/battery2.png</file>
<file>qml/images/battery3.png</file>
<file>qml/images/battery4.png</file>
<file>qml/images/battery5.png</file>
<file>qml/images/battery6.png</file>
</qresource>
</qresource>
</RCC>
</RCC>
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