diff --git a/kded/qml/OutputIdentifier.qml b/kded/qml/OutputIdentifier.qml index af899df..a5a2454 100644 --- a/kded/qml/OutputIdentifier.qml +++ b/kded/qml/OutputIdentifier.qml @@ -1,53 +1,58 @@ /* - * Copyright 2014 Martin Klapetek + * Copyright 2016 Sebastian Kügler * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -import QtQuick 2.0 +import QtQuick 2.5 +import QtQuick.Layouts 1.3 +import QtQuick.Window 2.2 + import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtra -import QtQuick.Window 2.2 -Item { +ColumnLayout { + property QtObject rootItem - id: root; property string outputName: rootItem ? rootItem.outputName : "" property string modeName: rootItem ? rootItem.modeName : "" - width: childrenRect.width + 2 * childrenRect.x - height: childrenRect.height + 2 * childrenRect.y - PlasmaComponents.Label { id: displayName - x: units.largeSpacing * 2 - y: units.largeSpacing + + Layout.maximumWidth: Screen.width * 0.8 + Layout.maximumHeight: Screen.height * 0.8 + Layout.margins: units.largeSpacing + Layout.bottomMargin: units.smallSpacing + + text: root.outputName font.pointSize: theme.defaultFont.pointSize * 3 - text: root.outputName; - wrapMode: Text.WordWrap; - horizontalAlignment: Text.AlignHCenter; + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + maximumLineCount: 2 + elide: Text.ElideLeft } PlasmaComponents.Label { id: modeLabel; - anchors { - horizontalCenter: displayName.horizontalCenter - top: displayName.bottom - } + + Layout.fillWidth: true + Layout.bottomMargin: units.largeSpacing + text: root.modeName; horizontalAlignment: Text.AlignHCenter; } }