diff --git a/plasmoid/contents/ui/SkillView.qml b/plasmoid/contents/ui/SkillView.qml new file mode 100644 --- /dev/null +++ b/plasmoid/contents/ui/SkillView.qml @@ -0,0 +1,115 @@ +/* Copyright 2016 Aditya Mehra + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) version 3, or any + later version accepted by the membership of KDE e.V. (or its + successor approved by the membership of KDE e.V.), which shall + act as a proxy defined in Section 6 of version 3 of the license. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library. If not, see . +*/ + +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.2 +import org.kde.plasma.core 2.0 as PlasmaCore +import org.kde.plasma.plasmoid 2.0 +import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.extras 2.0 as PlasmaExtras +import org.kde.private.mycroftplasmoid 1.0 as PlasmaLa + + +Rectangle { + id: tipscontent + Layout.fillWidth: true; + anchors { + left: parent.left; + leftMargin: 0.5; + right: parent.right + + } + height: units.gridUnit * 5 + border.width: 1 + border.color: Qt.darker(theme.linkColor, 1.2) + color: Qt.darker(theme.backgroundColor, 1.2) + + Image { + id: innerskImg + source: Pic + width: units.gridUnit * 1.2 + height: units.gridUnit * 1.2 + anchors.left: parent.left + anchors.leftMargin: units.gridUnit * 0.25 + anchors.verticalCenter: parent.verticalCenter + } + + PlasmaCore.SvgItem { + anchors { + left: innerskImg.right + leftMargin: 4 + top: parent.top + topMargin: 0 + bottom: parent.bottom + bottomMargin: 0 + } + + width: lineskillpgSvg.elementSize("vertical-line").width + z: 110 + elementId: "vertical-line" + + svg: PlasmaCore.Svg { + id: lineskillpgSvg; + imagePath: "widgets/line" + } + } + + Item { + id: skilltipsinner + anchors.left: innerskImg.right + anchors.leftMargin: 10 + anchors.right: parent.right + //color: theme.backgroundColor + anchors.top: tipscontent.top + anchors.bottom: parent.bottom + + PlasmaComponents.Label { + id: innerskllname + anchors.top: parent.top + anchors.topMargin: 2 + anchors.left: parent.left + anchors.right: parent.right + wrapMode: Text.WordWrap; + font.bold: true; + text: i18n(Skill) + } + + Rectangle { + id: sepratrln1 + height: 1 + anchors.top: innerskllname.bottom + anchors.topMargin: 2 + anchors.bottomMargin: 2 + anchors.left: parent.left + anchors.right: parent.right + color: Qt.darker(theme.linkColor, 1.2) + } + + Column{ + id: innerskillscolumn + anchors.top: sepratrln1.bottom + + PlasmaComponents.Label {wrapMode: Text.WordWrap; width: main.width; text: i18n('Command: ' + CommandList.get(0).Commands)} + PlasmaComponents.Label {wrapMode: Text.WordWrap; width: main.width; text: i18n('Command: ' + CommandList.get(1).Commands)} + } + } + } + + diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml old mode 100755 new mode 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -290,7 +290,7 @@ id: topbarLeftDividerline anchors { left: barAnim.right - leftMargin: units.gridUnit * 0.35 + leftMargin: units.gridUnit * 0.34 top: parent.top topMargin: 0 bottom: parent.bottom @@ -548,7 +548,7 @@ ColumnLayout { id: sidebar - Layout.fillHeight: true; + height: units.gridUnit * 6 width: units.gridUnit * 2 PlasmaComponents.TabBar { @@ -757,112 +757,15 @@ anchors.right: root.right anchors.bottom: root.bottom - - Rectangle { - anchors.top: mycroftSkillscolumntab.top - anchors.left: mycroftSkillscolumntab.left - anchors.right: mycroftSkillscolumntab.right - id: skillsrectmain - color: "#00000000" - - Component { - id: skillDelegate - Rectangle { - id: skillcontent - Layout.fillWidth: true; - anchors { left: parent.left; right: parent.right } - height: 80 - border.width: 0 - border.color: "lightsteelblue" - radius: 2 - color: theme.backgroundColor - z: -99 - - RowLayout { - id: skillTopRowLayout - spacing: 5 - anchors.fill: parent - - PlasmaComponents.Label { - id: innerskllname - anchors.top: parent.top - anchors.topMargin: 2 - anchors.left: parent.left - anchors.right: parent.right - wrapMode: Text.WordWrap; - font.bold: true; - text: i18n('Skill:' + Skill) - } - - Rectangle { - id: skilltipsimage - anchors.left: parent.left - anchors.top: innerskllname.bottom - anchors.bottom: parent.bottom - width: units.gridUnit * 1.2 - color: theme.backgroundColor - - Image { - id: innerskImg - source: Pic - width: units.gridUnit * 1.2 - height: units.gridUnit * 1.2 - anchors.centerIn: parent - } - - PlasmaCore.SvgItem { - anchors { - left: innerskImg.right - leftMargin: 4 - top: parent.top - topMargin: 0 - bottom: parent.bottom - bottomMargin: 0 - } - - width: lineskillpgSvg.elementSize("vertical-line").width - z: 110 - elementId: "vertical-line" - - svg: PlasmaCore.Svg { - id: lineskillpgSvg; - imagePath: "widgets/line" - } - } - - } - - Rectangle { - id: skilltipsinner - anchors.left: skilltipsimage.right - anchors.leftMargin: 10 - anchors.right: parent.right - color: theme.backgroundColor - anchors.top: innerskllname.bottom - anchors.bottom: parent.bottom - - Column{ - id: innerskillscolumn - spacing: 2 - - PlasmaComponents.Label {wrapMode: Text.WordWrap; width: main.width; text: i18n('Command: ' + CommandList.get(0).Commands)} - PlasmaComponents.Label {wrapMode: Text.WordWrap; width: main.width; text: i18n('Command: ' + CommandList.get(1).Commands)} - } - } - } - } - } - } - ListView { id: skillslistmodelview anchors.top: parent.top anchors.topMargin: 5 anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom model: SkillModel{} - delegate: skillDelegate + delegate: SkillView{} spacing: 4 focus: false interactive: true