Gave plasmoid some love

Summary:
Make the plasmoid content transparent
Include battery info in header
Only show remotekeyboard input if available
Make header always centered

before:
{F3820966}

after:
{F3820965}

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: jeanv, albertvaka, apol, #kde_connect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D6943
This commit is contained in:
Nicolas Fella 2017-07-27 00:40:47 +02:00 committed by Albert Vaca
parent 364ab02aad
commit 3c3b5b0391
2 changed files with 10 additions and 29 deletions

View file

@ -37,7 +37,7 @@ QtObject {
property bool charging: false property bool charging: false
property int charge: -1 property int charge: -1
property string displayString: (available && charge > -1) ? ((charging) ? (i18n("Charging: %1%", charge)) : (i18n("Discharging: %1%", charge))) : i18n("No info") property string displayString: (available && charge > -1) ? ((charging) ? (i18n("%1% charging", charge)) : (i18n("%1%", charge))) : i18n("No info")
property variant battery: null property variant battery: null
property variant nested1: DBusAsyncResponse { property variant nested1: DBusAsyncResponse {

View file

@ -94,13 +94,18 @@ PlasmaComponents.ListItem
{ {
Item { Item {
//spacer to make the label centre aligned in a row yet still elide and everything //spacer to make the label centre aligned in a row yet still elide and everything
implicitWidth: ring.width + browse.width + parent.spacing implicitWidth: (ring.visible? ring.width : 0) + (browse.visible? browse.width : 0) + parent.spacing
}
Battery {
id: battery
device: root.device
} }
PlasmaComponents.Label { PlasmaComponents.Label {
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight elide: Text.ElideRight
text: display text: (battery.available && battery.charge > -1) ? i18n("%1 (%2)", display, battery.displayString) : display
Layout.fillWidth: true Layout.fillWidth: true
textFormat: Text.PlainText textFormat: Text.PlainText
} }
@ -147,8 +152,7 @@ PlasmaComponents.ListItem
//RemoteKeyboard //RemoteKeyboard
PlasmaComponents.ListItem { PlasmaComponents.ListItem {
sectionDelegate: true visible: remoteKeyboardInput.available
visible: remoteKeyboard.available
width: parent.width width: parent.width
Row { Row {
@ -157,7 +161,6 @@ PlasmaComponents.ListItem
PlasmaComponents.Label { PlasmaComponents.Label {
id: remoteKeyboardLabel id: remoteKeyboardLabel
//font.bold: true
text: i18n("Remote Keyboard") text: i18n("Remote Keyboard")
} }
@ -191,34 +194,12 @@ PlasmaComponents.ListItem
} }
} }
//Battery
PlasmaComponents.ListItem {
Battery {
id: battery
device: root.device
}
sectionDelegate: true
visible: battery.available
PlasmaComponents.Label {
//font.bold: true
text: i18n("Battery")
}
PlasmaComponents.Label {
text: battery.displayString
anchors.right: parent.right
}
}
//Notifications //Notifications
PlasmaComponents.ListItem { PlasmaComponents.ListItem {
visible: notificationsModel.count>0 visible: notificationsModel.count>0
enabled: true enabled: true
sectionDelegate: true
PlasmaComponents.Label { PlasmaComponents.Label {
//font.bold: true text: i18n("Notifications:")
text: i18n("Notifications")
} }
PlasmaComponents.ToolButton { PlasmaComponents.ToolButton {
enabled: true enabled: true