Warning, /plasma-mobile/mycroft-plasmoid-mobile/plasmoid/contents/ui/StackObjDelegate.qml is written in an unsupported language. File is not indexed.
0001 /* Copyright 2016 Aditya Mehra <aix.m@outlook.com>
0002
0003 This library is free software; you can redistribute it and/or
0004 modify it under the terms of the GNU Lesser General Public
0005 License as published by the Free Software Foundation; either
0006 version 2.1 of the License, or (at your option) version 3, or any
0007 later version accepted by the membership of KDE e.V. (or its
0008 successor approved by the membership of KDE e.V.), which shall
0009 act as a proxy defined in Section 6 of version 3 of the license.
0010
0011 This library is distributed in the hope that it will be useful,
0012 but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0014 Lesser General Public License for more details.
0015
0016 You should have received a copy of the GNU Lesser General Public
0017 License along with this library. If not, see <http://www.gnu.org/licenses/>.
0018 */
0019
0020 import QtQuick 2.9
0021 import QtQml.Models 2.2
0022 import QtQuick.Controls 2.2
0023 import QtQuick.Layouts 1.3
0024 import org.kde.plasma.core 2.0 as PlasmaCore
0025 import org.kde.plasma.plasmoid 2.0
0026 import org.kde.plasma.components 2.0 as PlasmaComponents
0027 import QtGraphicalEffects 1.0
0028
0029 Item {
0030 id: stackObjDelegateItm
0031 height: skillTopRowLayout.height + stackObjInner.height + stackObjFooterArea.height + units.gridUnit * 0.5
0032 width: cbwidth
0033
0034 Rectangle {
0035 id: contentdlgtitem
0036 width: parent.width
0037 height: parent.height
0038 color: Qt.darker(theme.backgroundColor, 1.2)
0039 border.width: 0.75
0040 border.color: theme.linkColor
0041
0042 Item {
0043 id: skillTopRowLayout
0044 anchors.top: parent.top
0045 anchors.left: parent.left
0046 anchors.right: parent.right
0047 anchors.margins: units.gridUnit * 0.25
0048 implicitHeight: stackObjHeaderTitle.implicitHeight + units.gridUnit * 0.5
0049
0050 Text {
0051 id: stackObjHeaderTitle
0052 anchors.left: parent.left
0053 anchors.verticalCenter: parent.verticalCenter
0054 width: parent.width
0055 wrapMode: Text.Wrap;
0056 font.bold: true;
0057 text: model.sQuestion
0058 color: theme.textColor
0059 }
0060 }
0061
0062 Item {
0063 id: stackObjInner
0064 anchors.left: parent.left
0065 anchors.right: parent.right
0066 anchors.top: skillTopRowLayout.bottom
0067 anchors.margins: units.gridUnit * 0.25
0068 implicitHeight: stackObjLink.height
0069 Layout.minimumHeight: units.gridUnit * 2.5
0070
0071 Text {
0072 id: stackObjLink
0073 wrapMode: Text.Wrap;
0074 width: parent.width
0075 color: theme.textColor
0076 font.pointSize: 9
0077 text: i18n("<i>%1</i>", model.sLink)
0078 }
0079 }
0080
0081 Item {
0082 id: stackObjFooterArea
0083 anchors.left: parent.left
0084 anchors.right: parent.right
0085 anchors.bottom: parent.bottom
0086 implicitHeight: stackObjLink.height
0087 Layout.minimumHeight: units.gridUnit * 2
0088
0089 Rectangle {
0090 id: stackObjAnswerAvailableBg
0091 color: theme.linkColor
0092 width: parent.width / 3
0093 anchors.left: parent.left
0094 height: parent.height
0095 border.width: 0.75
0096 border.color: theme.backgroundColor
0097
0098 Text {
0099 id: stackObjAnswerAvailableLabel
0100 anchors.centerIn: parent
0101 font.pointSize: 9
0102 color: theme.textColor
0103
0104 Component.onCompleted:{
0105 if (sIsAnswered) {
0106 stackObjAnswerAvailableLabel.text = i18n("Answered")
0107 }
0108 else {
0109 stackObjAnswerAvailableLabel.text = i18n("Unanswered")
0110 }
0111 }
0112 }
0113 }
0114
0115 Rectangle {
0116 id: stackObjAnswerCountBg
0117 color: theme.linkColor
0118 width: parent.width / 3
0119 anchors.left: stackObjAnswerAvailableBg.right
0120 height: parent.height
0121 border.width: 0.75
0122 border.color: theme.backgroundColor
0123
0124 Text {
0125 id: stackObjAnswerCountLabel
0126 anchors.centerIn: parent
0127 text: i18n("Replies: %1", sAnswerCount)
0128 font.pointSize: 9
0129 color: theme.textColor
0130 }
0131 }
0132
0133 Rectangle {
0134 id: stackObjAuthorBg
0135 color: theme.linkColor
0136 width: parent.width / 3
0137 anchors.left: stackObjAnswerCountBg.right
0138 height: parent.height
0139 border.width: 0.75
0140 border.color: theme.backgroundColor
0141
0142 Text {
0143 id: stackObjAuthorLabel
0144 anchors.centerIn: parent
0145 text: sAuthor
0146 font.pointSize: 9
0147 color: theme.textColor
0148 }
0149 }
0150 }
0151
0152 MouseArea {
0153 anchors.fill: parent
0154 onClicked: {
0155 Qt.openUrlExternally(sLink)
0156 }
0157 }
0158 }
0159 }