Warning, /plasma/sddm-kcm/src/ui/DetailsDialog.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2013 Reza Fatahilah Shah <rshah0385@kireihana.com>
0003 SPDX-FileCopyrightText: 2019 Filip Fila <filipfila.kde@gmail.com>
0004 SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de>
0005
0006 SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008
0009 import QtQuick 2.15
0010 import QtQuick.Controls 2.15 as QQC2
0011 import QtQuick.Layouts 1.15
0012 import QtQuick.Window 2.15
0013 import Qt5Compat.GraphicalEffects
0014
0015 import org.kde.kirigami 2.14 as Kirigami
0016
0017 Kirigami.OverlaySheet {
0018 property string themeName: ""
0019 property string previewPath: ""
0020 property string authorName: ""
0021 property string description: ""
0022 property string license: ""
0023 property string email: ""
0024 property string website: ""
0025 property string version: ""
0026 title: i18nc("@title:window, %1 is the theme name, %2 the version", "%1 (%2)", themeName, version)
0027 ColumnLayout {
0028 id: layout
0029 Layout.preferredWidth: 0.75 * root.width
0030 spacing: Kirigami.Units.smallSpacing
0031
0032 Item {
0033 // we need this wrapper because of a limitation of Image where the implicitHeight is not adjusted when
0034 // the height has been set as the layout does
0035 Layout.fillWidth: true
0036 implicitHeight: previewImage.implicitHeight
0037 Image {
0038 id: previewImage
0039 source: previewPath
0040 width: layout.width
0041 sourceSize.width: width
0042 fillMode: Image.PreserveAspectFit
0043 smooth: true
0044 layer.enabled: true
0045 layer.effect: DropShadow {
0046 verticalOffset: 2
0047 radius: 10
0048 samples: 32
0049 cached: true
0050 color: Qt.rgba(0, 0, 0, 0.3)
0051 }
0052 }
0053 }
0054 Kirigami.PlaceholderMessage {
0055 visible: previewImage.status !== Image.Ready && previewImage.status !== Image.Loading
0056 icon.name: "view-preview"
0057 text: i18n("No preview available")
0058 }
0059 QQC2.Label {
0060 text: i18nc("%1 is a description of the theme, %2 are the authors, %3 is the license", "%1, by %2 (%3)", description, authorName, license)
0061 Layout.fillWidth: true
0062 wrapMode: Text.Wrap
0063 }
0064
0065 QQC2.Label {
0066 visible: website !== ""
0067 text:("<a href='"+website+"'>"+website+"</a>")
0068 onLinkActivated: link => Qt.openUrlExternally(link)
0069 font: Kirigami.Theme.smallFont
0070 Layout.fillWidth: true
0071 wrapMode: Text.Wrap
0072 }
0073
0074 QQC2.Label {
0075 visible: email !== ""
0076 text: ("<a href='"+email+"'>"+email+"</a>")
0077 onLinkActivated: Qt.openUrlExternally("mailto:"+email+"")
0078 font: Kirigami.Theme.smallFont
0079 Layout.fillWidth: true
0080 Layout.bottomMargin: Math.round(Kirigami.Units.smallSpacing * 1.5)
0081 wrapMode: Text.Wrap
0082 }
0083 }
0084 }