diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-qml')
4 files changed, 38 insertions, 38 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml index 2a8579a8..65c8a0eb 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/Panel.qml @@ -10,13 +10,13 @@ import QtQuick.Controls 1 import QtQuick.Layouts 1.3 import Lumina.Backend.PanelObject 2.0 -import "./plugins" as PLUGINS Rectangle { //C++ backend object property string panel_id property PanelObject object + id: panel //Normal geometries/placements color: object.background x: object.x @@ -26,30 +26,24 @@ Rectangle { GridLayout{ id: layout - anchors.fill: parent; - columns: parent.object.isVertical ? 1 : -1 - rows: parent.object.isVertical ? -1 : 1 + anchors.fill: parent + //columns: parent.object.isVertical ? 1 : -1 + //rows: parent.object.isVertical ? -1 : 1 + flow: parent.isVertical ? GridLayout.TopToBottom : GridLayout.LeftToRight + //horizontalItemAlignment: parent.object.isVertical ? Grid.AlignHCenter : Qt.AlignLeft + //verticalItemAlignment: parent.object.isVertical ? Grid.AlignTop : Qt.AlignVCenter + Repeater { + model: panel.object.plugins + Loader{ + asynchronous: true + property bool vertical : layout.parent.object.isVertical + property bool isspacer : modelData.endsWith("/Spacer.qml"); + source: modelData + Layout.fillWidth : (vertical || isspacer) ? true : false + Layout.fillHeight : (vertical && ! isspacer) ? false : true + Layout.alignment : Qt.AlignVCenter | Qt.AlignHCenter + } - //hardcode some plugins for the moment - //PLUGINS.Spacer{} - - PLUGINS.StatusTray{ - id: "statustray" - vertical: layout.parent.object.isVertical - //Layout.fillWidth: layout.parent.object.isVertical ? true : false - //Layout.fillHeight: layout.parent.object.isVertical ? false : true - } - - //PLUGINS.Spacer{} - - PLUGINS.Clock_Digital{ - id: "clock" - vertical: layout.parent.object.isVertical - //Layout.fillWidth: layout.parent.object.isVertical ? true : false - //Layout.fillHeight: layout.parent.object.isVertical ? false : true } - - //PLUGINS.Spacer{} - } //end of grid layout } diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml index f82d398b..e68788f6 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Clock_Digital.qml @@ -13,9 +13,11 @@ import QtQuick.Controls 1 import Lumina.Backend.RootDesktopObject 2.0 Label{ - property bool vertical + anchors.fill: parent text: RootObject.currentTime - wrapMode: Text.WrapWord - rotation: vertical ? 90 : 0 + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + rotation: parent.vertical ? 90 : 0 transformOrigin: Item.Center } diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Spacer.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Spacer.qml index d46e486c..93556790 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Spacer.qml +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/Spacer.qml @@ -4,13 +4,12 @@ // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== -// This is the QML plugin that displays the OS status/system tray +// This is a tiny QML plugin for a basic Item which can be set to grow //=========================================== import QtQuick 2.2 import QtQuick.Layouts 1.3 Item{ - Layout.fillWidth: true - Layout.fillHeight: true + anchors.fill: parent } diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml index a2d49b35..f4063ed9 100644 --- a/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-qml/plugins/StatusTray.qml @@ -17,42 +17,47 @@ import "./status_tray" as QML Item { - property bool vertical - property int prefsize: vertical ? parent.width : parent.height + property int prefsize: parent.vertical ? parent.width : parent.height id: "status_tray" + anchors.fill: parent GridLayout{ anchors.fill: parent - flow: parent.vertical ? GridLayout.TopToBottom : GridLayout.LeftToRight - columns: vertical ? 2 : -1 - rows: vertical ? -1 : 2 - //columnSpacing: 2 - //rowSpacing: 2 + flow: status_tray.parent.vertical ? GridLayout.TopToBottom : GridLayout.LeftToRight + //columns: vertical ? 1 : -1 + //rows: vertical ? -1 : 1 + columnSpacing: 2 + rowSpacing: 2 //Volume Status QML.VolumeButton{ //Layout.preferredHeight: status_tray.prefsize //Layout.preferredWidth: status_tray.prefsize + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter } //Network Status QML.NetworkButton{ //Layout.preferredHeight: status_tray.prefsize //Layout.preferredWidth: status_tray.prefsize + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter } //Battery Status QML.BatteryButton{ //Layout.preferredHeight: status_tray.prefsize //Layout.preferredWidth: status_tray.prefsize + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter } //Update Status QML.UpdateButton{ //Layout.preferredHeight: status_tray.prefsize //Layout.preferredWidth: status_tray.prefsize + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter } //System Tray Menu Button ToolButton{ id: "trayButton" text: "Tray" + Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter //iconName: "view-more-vertical" visible: RootObject.hasTrayWindows onClicked: trayMenu.open() @@ -60,7 +65,7 @@ Item { id: "trayMenu" //MenuItem{ text: "sample" } //MenuItem{ text: "sample2" } - //Rectangle{ color: "blue"; width: 50; height: 50 } + Rectangle{ color: "blue"; width: 48; height: 48 } GridLayout{ columns: 4 Repeater{ |