diff --git a/src/qml/main.qml b/src/qml/main.qml
--- a/src/qml/main.qml
+++ b/src/qml/main.qml
@@ -14,15 +14,17 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-import QtQuick 2.1
-import QtQuick.Layouts 1.1
+import QtQuick 2.4
+import QtQuick.Layouts 1.12
+import QtQuick.Controls 2.4
+import org.kde.kirigami 2.4 as Kirigami
+import QtGraphicalEffects 1.0
Rectangle {
id: root
- SystemPalette { id: palette; colorGroup: SystemPalette.Active }
- color: palette.base
- width: 360
- height:320
+ //WORKAROUND: makes the rectangle's color match the background color
+ color: Qt.tint(Kirigami.Theme.backgroundColor, Qt.rgba(Kirigami.Theme.viewBackgroundColor.r, Kirigami.Theme.viewBackgroundColor.g, Kirigami.Theme.viewBackgroundColor.b, 0.3))
+ height: Math.round(Kirigami.Units.gridUnit * 24)
property string themeName: ""
property string previewPath: ""
@@ -36,73 +38,93 @@
Image {
id: previewImage
- width: root.paintedWidth
- height: 210
source: previewPath
anchors {
- top: parent.top
- topMargin: 25
- horizontalCenter: parent.horizontalCenter
+ top: root.top
+ left: root.left
+ right: root.right
+ margins: Math.round(units.smallSpacing * 1.5)
}
-
fillMode: Image.PreserveAspectFit
}
- Rectangle { // rounded corners for img
- id: border
- width: previewImage.paintedWidth + 2
- height: previewImage.paintedHeight + 2
- color: "transparent"
- border.color: "#bb000000" // color of background
- border.width: 2
- radius: 2
- anchors.centerIn: previewImage
+ DropShadow {
+ source: previewImage
+ anchors.fill: previewImage
+ verticalOffset: 2
+ radius: 7
+ samples: 16
+ color: "black"
}
- GridLayout {
- id: texttable
- width: previewImage.paintedWidth
- anchors {
- top: previewImage.bottom
- left: previewImage.left
- right: previewImage.right
- }
- columns: 2
+ ColumnLayout {
+ id: column
+ width: previewImage.paintedWidth
+ spacing: units.smallSpacing
+ anchors {
+ top: previewImage.bottom
+ left: previewImage.left
+ right: previewImage.right
+ topMargin: units.smallSpacing
+ }
+
+ Kirigami.Heading {
+ text: themeName + " (" + version + ")"
+ font.bold: true
+ font.weight: Font.Bold
+ Layout.fillWidth: true
+ elide: Text.ElideRight
+ maximumLineCount: 2
+ wrapMode: Text.Wrap
+ }
+
+ Label {
+ text: description
+ font.italic: true
+ Layout.fillWidth: true
+ elide: Text.ElideRight
+ maximumLineCount: 2
+ wrapMode: Text.Wrap
+ }
+
+ Label {
+ text: authorName
+ Layout.fillWidth: true
+ elide: Text.ElideRight
+ maximumLineCount: 2
+ wrapMode: Text.Wrap
+ }
+
+ Label {
+ text: license
+ font.pointSize: theme.smallestFont.pointSize
+ Layout.fillWidth: true
+ elide: Text.ElideRight
+ maximumLineCount: 2
+ wrapMode: Text.Wrap
+ }
- Text {
- color: palette.text
- text: description
- font.bold: true
- font.pointSize: 13
- }
- Text {
- color: palette.text
- text: version
- font.bold: true
- font.pointSize: 10
- Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
- }
- Text {
- color: palette.text
- text: authorName
- font.pointSize: 10
- }
- Text {
- color: palette.text
- text: license
- font.pointSize: 7
- Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
- }
- Text {
- color: palette.text
- text: website
- font.pointSize: 7
- }
- Text {
- color: palette.text
- text: email
- font.pointSize: 7
- Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
- }
+ Label {
+ id: url
+ text:(""+website+"")
+ onLinkActivated: Qt.openUrlExternally(link)
+ font.pointSize: theme.smallestFont.pointSize
+ Layout.fillWidth: true
+ elide: Text.ElideRight
+ maximumLineCount: 2
+ wrapMode: Text.Wrap
}
+
+ Label {
+ id: mail
+ text: (""+email+"")
+ onLinkActivated: Qt.openUrlExternally("mailto:"+email+"")
+ font.pointSize: theme.smallestFont.pointSize
+ Layout.fillWidth: true
+ Layout.bottomMargin: Math.round(units.smallSpacing * 1.5)
+ elide: Text.ElideRight
+ maximumLineCount: 2
+ wrapMode: Text.Wrap
+ }
+ }
}