Skip to content

Commit

Permalink
Merge pull request #44 from eekkelund/master
Browse files Browse the repository at this point in the history
[scaling] Scaling of statusbar
  • Loading branch information
locusf committed Mar 1, 2016
2 parents e95df7e + 5022b21 commit a6b102e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
41 changes: 25 additions & 16 deletions src/qml/Statusbar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import MeeGo.Connman 0.2
Item {
id: root
z: 201
height: 48
height: width/12
width: parent.width
anchors.bottom: parent.bottom

Expand Down Expand Up @@ -130,28 +130,30 @@ Item {

RowLayout {
anchors.fill: statusbar
spacing: 16
spacing: root.height/4
StatusbarItem {
iconSize: root.height/2
source: (cellularSignalBars.value > 0) ? "image://theme/icon_cell" + cellularSignalBars.value : "image://theme/icon_cell1"
}

StatusbarItem {
iconSize: root.height/2
Label {
id: tech
width: 16
height: 16
font.pointSize: 6
width: root.height/4
height: root.height/4
font.pixelSize: root.height/4+root.height/5
font.bold: true
wrapMode: Text.ElideRight
text: (cellularNetworkName.value !== "") ? cellularNetworkName.value.substring(0,3).toUpperCase() : "NA"
}

Label {
anchors.top: tech.bottom
anchors.topMargin: 4
width: 16
height: 16
font.pointSize: 6
anchors.topMargin: root.height/8
width: root.height/4
height: root/height/4
font.pixelSize: root.height/4+root.height/5
text: {
var techToG = {gprs: "2", egprs: "2.5", umts: "3", hspa: "3.5", lte: "4", unknown: "0"}
return techToG[cellularDataTechnology.value ? cellularDataTechnology.value : "unknown"] + "G"
Expand All @@ -161,6 +163,7 @@ Item {
}

StatusbarItem {
iconSize: root.height/2
source: {
if (wlan.connected) {
if (networkManager.defaultRoute.type !== "wifi")
Expand All @@ -183,37 +186,43 @@ Item {
panel: WifiPanel {}
}
StatusbarItem {
iconSize: root.height/2
source: "image://theme/icon_bt_normal"
}
StatusbarItem {
iconSize: root.height/2
source: "image://theme/icon_nfc_normal"
}
StatusbarItem {
iconSize: root.height/2
source: "image://theme/icon_gps_normal"
}
StatusbarItem {
iconSize: root.height/2
source: "image://theme/icon_play_pause"
}
StatusbarItem {
iconSize: root.height/2
Label {
id: hours
width: 16
height: 16
font.pointSize: 6
width: root.height/4
height: root.height/4
font.pixelSize: root.height/4+root.height/5
text: Qt.formatDateTime(wallClock.time, "hh")
}
Label {
id: minutes
anchors.top: hours.bottom
anchors.topMargin: 4
width: 16
height: 16
font.pointSize: 6
anchors.topMargin: root.height/8
width: root.height/4
height: root.height/4
font.pixelSize: root.height/4+root.height/5
text: Qt.formatDateTime(wallClock.time, "mm")
}
}

StatusbarItem {
iconSize: root.height/2
panel: BatteryPanel {}
source: {
if(batteryChargePercentage.value > 85) {
Expand Down
3 changes: 3 additions & 0 deletions src/qml/StatusbarItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ Item {
property alias source: icon.source
property string panel_source
property Component panel
property double iconSize
Layout.fillWidth: true
Layout.fillHeight: true
Image {
width: iconSize
height: iconSize
id: icon
anchors.centerIn: parent
}
Expand Down

0 comments on commit a6b102e

Please sign in to comment.