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
4b3155db
Commit
4b3155db
authored
Jun 17, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[statusbar] Statusbar as Row with StatusbarItems.
parent
699ab01f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
131 deletions
+75
-131
Statusbar.qml
src/qml/Statusbar.qml
+50
-130
StatusbarItem.qml
src/qml/StatusbarItem.qml
+22
-0
resources-qml.qrc
src/resources-qml.qrc
+1
-0
src.pro
src/src.pro
+2
-1
No files found.
src/qml/Statusbar.qml
View file @
4b3155db
...
...
@@ -48,35 +48,6 @@ Item {
z
:
200
}
Connections
{
target
:
batteryChargePercentage
onValueChanged
:
{
if
(
batteryChargePercentage
.
value
>
85
)
{
batteryimg
.
source
=
"
images/battery6.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
5
)
{
batteryimg
.
source
=
"
images/battery0.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
10
)
{
batteryimg
.
source
=
"
images/battery1.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
25
)
{
batteryimg
.
source
=
"
images/battery2.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
40
)
{
batteryimg
.
source
=
"
images/battery3.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
65
)
{
batteryimg
.
source
=
"
images/battery4.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
80
)
{
batteryimg
.
source
=
"
images/battery5.png
"
}
}
}
Connections
{
target
:
cellularSignalBars
onValueChanged
:
{
cellularbars
.
text
=
cellularSignalBars
.
value
}
}
ContextProperty
{
id
:
batteryChargePercentage
key
:
"
Battery.ChargePercentage
"
...
...
@@ -93,88 +64,29 @@ Item {
key
:
"
Cellular.RegistrationStatus
"
}
Rectangle
{
id
:
cellular
anchors.left
:
parent
.
left
color
:
"
transparent
"
height
:
48
width
:
48
anchors.margins
:
8
Label
{
id
:
cellularbars
width
:
32
height
:
32
font.pointSize
:
8
}
}
Rectangle
{
id
:
wifi
anchors.left
:
cellular
.
right
color
:
"
transparent
"
height
:
48
width
:
48
anchors.margins
:
8
}
Rectangle
{
id
:
bluetooth
anchors.left
:
wifi
.
right
color
:
"
transparent
"
height
:
48
width
:
48
anchors.margins
:
8
Image
{
source
:
bluetoothConnected
.
value
!==
undefined
&&
bluetoothConnected
.
value
?
"
image://theme/icon-status-bluetooth-connected
"
:
"
image://theme/icon-status-bluetooth
"
ContextProperty
{
id
:
bluetoothEnabled
key
:
"
Bluetooth.Enabled
"
Row
{
spacing
:
16
StatusbarItem
{
source
:
"
image://theme/icon_cell
"
+
cellularSignalBars
.
value
}
ContextProperty
{
id
:
bluetoothConnected
key
:
"
Bluetooth.Connected
"
StatusbarItem
{
source
:
{
return
"
image://theme/icon_wifi_normal1
"
}
}
StatusbarItem
{
source
:
"
image://theme/icon_bt_normal
"
}
Rectangle
{
id
:
nfc
anchors.left
:
bluetooth
.
right
color
:
"
transparent
"
height
:
48
width
:
48
anchors.margins
:
8
Image
{
source
:
"
image://theme/icon-nfc-enabled
"
StatusbarItem
{
source
:
"
image://theme/icon_nfc_normal
"
}
StatusbarItem
{
source
:
"
image://theme/icon_gps_normal
"
}
Rectangle
{
id
:
gps
anchors.left
:
nfc
.
right
color
:
"
transparent
"
height
:
48
width
:
48
anchors.margins
:
8
Image
{
source
:
"
image://theme/icon-gps-enabled
"
StatusbarItem
{
source
:
"
image://theme/icon_play_pause
"
}
}
Rectangle
{
id
:
playlist
anchors.left
:
gps
.
right
color
:
"
transparent
"
height
:
48
width
:
48
anchors.margins
:
8
Image
{
source
:
"
image://theme/icon-playlist-playpause
"
}
}
Rectangle
{
id
:
clock
anchors.left
:
playlist
.
right
color
:
"
transparent
"
height
:
48
width
:
48
anchors.margins
:
8
StatusbarItem
{
Label
{
id
:
hours
width
:
16
...
...
@@ -193,16 +105,24 @@ Item {
}
}
Rectangle
{
anchors.right
:
parent
.
right
height
:
48
width
:
48
color
:
"
transparent
"
anchors.margins
:
8
Image
{
id
:
batteryimg
width
:
32
height
:
32
StatusbarItem
{
source
:
{
if
(
batteryChargePercentage
.
value
>
85
)
{
return
"
images/battery6.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
5
)
{
return
"
images/battery0.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
10
)
{
return
"
images/battery1.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
25
)
{
return
"
images/battery2.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
40
)
{
return
"
images/battery3.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
65
)
{
return
"
images/battery4.png
"
}
else
if
(
batteryChargePercentage
.
value
<=
80
)
{
return
"
images/battery5.png
"
}
}
}
}
}
src/qml/StatusbarItem.qml
0 → 100644
View file @
4b3155db
import
QtQuick
2.0
Item
{
height
:
48
width
:
48
property
alias
source
:
icon
.
source
Image
{
id
:
icon
anchors.centerIn
:
parent
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
icon
.
source
.
toString
().
match
(
"
normal
"
))
{
icon
.
source
=
icon
.
source
.
toString
().
replace
(
"
normal
"
,
"
focused
"
)
}
else
{
icon
.
source
=
icon
.
source
.
toString
().
replace
(
"
focused
"
,
"
normal
"
)
}
}
}
}
src/resources-qml.qrc
View file @
4b3155db
...
...
@@ -38,5 +38,6 @@
<file>qml/FeedsPage.qml</file>
<file>qml/Statusbar.qml</file>
<file>qml/images/wallpaper-portrait-bubbles.png</file>
<file>qml/StatusbarItem.qml</file>
</qresource>
</RCC>
src/src.pro
View file @
4b3155db
...
...
@@ -44,6 +44,7 @@ OTHER_FILES += qml/*.qml \
qml/NotificationPreview.qml \
qml/scripts/desktop.js \
qml/FeedsPage.qml \
qml/Statusbar.qml
qml/Statusbar.qml \
qml/StatusbarItem.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