Commit a6b102e6 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen

Merge pull request #44 from eekkelund/master

[scaling] Scaling of statusbar
parents e95df7e2 5022b21c
...@@ -38,7 +38,7 @@ import MeeGo.Connman 0.2 ...@@ -38,7 +38,7 @@ import MeeGo.Connman 0.2
Item { Item {
id: root id: root
z: 201 z: 201
height: 48 height: width/12
width: parent.width width: parent.width
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
...@@ -130,17 +130,19 @@ Item { ...@@ -130,17 +130,19 @@ Item {
RowLayout { RowLayout {
anchors.fill: statusbar anchors.fill: statusbar
spacing: 16 spacing: root.height/4
StatusbarItem { StatusbarItem {
iconSize: root.height/2
source: (cellularSignalBars.value > 0) ? "image://theme/icon_cell" + cellularSignalBars.value : "image://theme/icon_cell1" source: (cellularSignalBars.value > 0) ? "image://theme/icon_cell" + cellularSignalBars.value : "image://theme/icon_cell1"
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2
Label { Label {
id: tech id: tech
width: 16 width: root.height/4
height: 16 height: root.height/4
font.pointSize: 6 font.pixelSize: root.height/4+root.height/5
font.bold: true font.bold: true
wrapMode: Text.ElideRight wrapMode: Text.ElideRight
text: (cellularNetworkName.value !== "") ? cellularNetworkName.value.substring(0,3).toUpperCase() : "NA" text: (cellularNetworkName.value !== "") ? cellularNetworkName.value.substring(0,3).toUpperCase() : "NA"
...@@ -148,10 +150,10 @@ Item { ...@@ -148,10 +150,10 @@ Item {
Label { Label {
anchors.top: tech.bottom anchors.top: tech.bottom
anchors.topMargin: 4 anchors.topMargin: root.height/8
width: 16 width: root.height/4
height: 16 height: root/height/4
font.pointSize: 6 font.pixelSize: root.height/4+root.height/5
text: { text: {
var techToG = {gprs: "2", egprs: "2.5", umts: "3", hspa: "3.5", lte: "4", unknown: "0"} var techToG = {gprs: "2", egprs: "2.5", umts: "3", hspa: "3.5", lte: "4", unknown: "0"}
return techToG[cellularDataTechnology.value ? cellularDataTechnology.value : "unknown"] + "G" return techToG[cellularDataTechnology.value ? cellularDataTechnology.value : "unknown"] + "G"
...@@ -161,6 +163,7 @@ Item { ...@@ -161,6 +163,7 @@ Item {
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2
source: { source: {
if (wlan.connected) { if (wlan.connected) {
if (networkManager.defaultRoute.type !== "wifi") if (networkManager.defaultRoute.type !== "wifi")
...@@ -183,37 +186,43 @@ Item { ...@@ -183,37 +186,43 @@ Item {
panel: WifiPanel {} panel: WifiPanel {}
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2
source: "image://theme/icon_bt_normal" source: "image://theme/icon_bt_normal"
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2
source: "image://theme/icon_nfc_normal" source: "image://theme/icon_nfc_normal"
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2
source: "image://theme/icon_gps_normal" source: "image://theme/icon_gps_normal"
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2
source: "image://theme/icon_play_pause" source: "image://theme/icon_play_pause"
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2
Label { Label {
id: hours id: hours
width: 16 width: root.height/4
height: 16 height: root.height/4
font.pointSize: 6 font.pixelSize: root.height/4+root.height/5
text: Qt.formatDateTime(wallClock.time, "hh") text: Qt.formatDateTime(wallClock.time, "hh")
} }
Label { Label {
id: minutes id: minutes
anchors.top: hours.bottom anchors.top: hours.bottom
anchors.topMargin: 4 anchors.topMargin: root.height/8
width: 16 width: root.height/4
height: 16 height: root.height/4
font.pointSize: 6 font.pixelSize: root.height/4+root.height/5
text: Qt.formatDateTime(wallClock.time, "mm") text: Qt.formatDateTime(wallClock.time, "mm")
} }
} }
StatusbarItem { StatusbarItem {
iconSize: root.height/2
panel: BatteryPanel {} panel: BatteryPanel {}
source: { source: {
if(batteryChargePercentage.value > 85) { if(batteryChargePercentage.value > 85) {
......
...@@ -5,9 +5,12 @@ Item { ...@@ -5,9 +5,12 @@ Item {
property alias source: icon.source property alias source: icon.source
property string panel_source property string panel_source
property Component panel property Component panel
property double iconSize
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Image { Image {
width: iconSize
height: iconSize
id: icon id: icon
anchors.centerIn: parent anchors.centerIn: parent
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment