Changeset View
Changeset View
Standalone View
Standalone View
Modules/energy/package/contents/ui/main.qml
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU General Public License * | 14 | * You should have received a copy of the GNU General Public License * | ||
15 | * along with this program; if not, write to the * | 15 | * along with this program; if not, write to the * | ||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | import QtQuick 2.2 | 20 | import QtQuick 2.2 | ||
21 | import QtQuick.Controls 1.3 | 21 | import QtQuick.Controls 1.3 | ||
22 | import QtQuick.Controls 2.0 as QQC2 | ||||
22 | import QtQuick.Layouts 1.1 | 23 | import QtQuick.Layouts 1.1 | ||
23 | 24 | | |||
24 | import org.kde.kquickcontrolsaddons 2.0 | 25 | import org.kde.kquickcontrolsaddons 2.0 | ||
25 | import org.kde.kinfocenter.energy.private 1.0 | 26 | import org.kde.kinfocenter.energy.private 1.0 | ||
26 | 27 | | |||
27 | //We need units from it | 28 | //We need units from it | ||
28 | import org.kde.plasma.core 2.0 as PlasmaCore | 29 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
29 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 30 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Line(s) | 273 | yMax: { | |||
280 | } else { | 281 | } else { | ||
281 | return 100; | 282 | return 100; | ||
282 | } | 283 | } | ||
283 | } | 284 | } | ||
284 | yStep: root.historyType == HistoryModel.RateType ? 10 : 20 | 285 | yStep: root.historyType == HistoryModel.RateType ? 10 : 20 | ||
285 | visible: history.count > 1 | 286 | visible: history.count > 1 | ||
286 | } | 287 | } | ||
287 | 288 | | |||
288 | Label { | 289 | QQC2.Label { | ||
289 | Layout.fillWidth: true | 290 | Layout.fillWidth: true | ||
290 | Layout.minimumHeight: column.width / 3 | 291 | Layout.minimumHeight: column.width / 3 | ||
291 | Layout.maximumHeight: column.width / 3 | 292 | Layout.maximumHeight: column.width / 3 | ||
292 | horizontalAlignment: Text.AlignHCenter | 293 | horizontalAlignment: Text.AlignHCenter | ||
293 | verticalAlignment: Text.AlignVCenter | 294 | verticalAlignment: Text.AlignVCenter | ||
294 | text: i18n("This type of history is currently not available for this device.") | 295 | text: i18n("This type of history is currently not available for this device.") | ||
295 | wrapMode: Text.WordWrap | 296 | wrapMode: Text.WordWrap | ||
296 | visible: !graph.visible | 297 | visible: !graph.visible | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 352 | RowLayout { | |||
360 | 361 | | |||
361 | ColumnLayout { | 362 | ColumnLayout { | ||
362 | Layout.fillWidth: true | 363 | Layout.fillWidth: true | ||
363 | spacing: 0 | 364 | spacing: 0 | ||
364 | 365 | | |||
365 | RowLayout { | 366 | RowLayout { | ||
366 | Layout.fillWidth: true | 367 | Layout.fillWidth: true | ||
367 | 368 | | |||
368 | Label { | 369 | QQC2.Label { | ||
369 | Layout.fillWidth: true | 370 | Layout.fillWidth: true | ||
370 | elide: Text.ElideRight | 371 | elide: Text.ElideRight | ||
371 | text: model.prettyName || model.name | 372 | text: model.prettyName || model.name | ||
372 | } | 373 | } | ||
373 | 374 | | |||
374 | /*Label { | 375 | /*Label { | ||
375 | text: i18n("System Service") | 376 | text: i18n("System Service") | ||
376 | visible: !model.userSpace | 377 | visible: !model.userSpace | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 434 | Repeater { | |||
434 | id: detailsRepeater | 435 | id: detailsRepeater | ||
435 | model: modelData.data || [] | 436 | model: modelData.data || [] | ||
436 | 437 | | |||
437 | RowLayout { | 438 | RowLayout { | ||
438 | Layout.fillWidth: true | 439 | Layout.fillWidth: true | ||
439 | spacing: units.smallSpacing * 2 | 440 | spacing: units.smallSpacing * 2 | ||
440 | visible: valueLabel.text !== "" | 441 | visible: valueLabel.text !== "" | ||
441 | 442 | | |||
442 | Label { | 443 | QQC2.Label { | ||
443 | Layout.minimumWidth: detailsColumn.legendWidth + units.gridUnit | 444 | Layout.minimumWidth: detailsColumn.legendWidth + units.gridUnit | ||
444 | horizontalAlignment: Text.AlignRight | 445 | horizontalAlignment: Text.AlignRight | ||
445 | text: i18n("%1:", modelData.label) | 446 | text: i18n("%1:", modelData.label) | ||
446 | wrapMode: Text.NoWrap | 447 | wrapMode: Text.NoWrap | ||
447 | opacity: 0.8 | 448 | opacity: 0.8 | ||
448 | onPaintedWidthChanged: { | 449 | onPaintedWidthChanged: { | ||
449 | if (paintedWidth > detailsColumn.legendWidth) { | 450 | if (paintedWidth > detailsColumn.legendWidth) { | ||
450 | detailsColumn.legendWidth = paintedWidth | 451 | detailsColumn.legendWidth = paintedWidth | ||
451 | } | 452 | } | ||
452 | } | 453 | } | ||
453 | } | 454 | } | ||
454 | 455 | | |||
455 | Label { | 456 | QQC2.Label { | ||
456 | id: valueLabel | 457 | id: valueLabel | ||
457 | Layout.fillWidth: true | 458 | Layout.fillWidth: true | ||
458 | text: { | 459 | text: { | ||
459 | var value = currentBattery[modelData.value] | 460 | var value = currentBattery[modelData.value] | ||
460 | 461 | | |||
461 | if (typeof value === "boolean") { | 462 | if (typeof value === "boolean") { | ||
462 | if (value) { | 463 | if (value) { | ||
463 | return i18n("Yes") | 464 | return i18n("Yes") | ||
Show All 33 Lines |