1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 18:52:30 +01:00

Fix c++ enum type using string when using var

This broke the comparison because in js it was
still unsing c style int enum values...
This commit is contained in:
Elias Steurer 2021-02-19 10:42:49 +01:00
parent 199cf1429a
commit a1b8313e02
2 changed files with 30 additions and 11 deletions

View File

@ -1,4 +1,3 @@
function isWallpaper(type) {
return type === InstalledType.VideoWallpaper
|| type === InstalledType.HTMLWallpaper
@ -9,6 +8,18 @@ function isWallpaper(type) {
}
function isWidget(type) {
return type === InstalledType.HTMLWidget
|| type === InstalledType.QMLWidget
return type === InstalledType.HTMLWidget || type === InstalledType.QMLWidget
}
function isScene(type) {
return type === InstalledType.HTMLWallpaper
|| type === InstalledType.QMLWallpaper
|| type === InstalledType.WebsiteWallpaper
|| type === InstalledType.GodotWallpaper
}
function isVideo(type) {
return type === InstalledType.VideoWallpaper
|| type === InstalledType.GifWallpaper
}

View File

@ -16,7 +16,7 @@ Item {
property string customTitle
property string screenId
property url absoluteStoragePath
property var type: InstalledType.Unknown
property int type: InstalledType.Unknown
property var publishedFileID: 0
property int itemIndex
property bool isScrolling: false
@ -24,10 +24,17 @@ Item {
signal openContextMenu(point position)
onTypeChanged: {
if (JSUtil.isWallpaper()) {
if (JSUtil.isWidget(type)) {
icnType.source = "qrc:/assets/icons/icon_widgets.svg"
} else {
return
}
if (JSUtil.isScene(type)) {
icnType.source = "qrc:/assets/icons/icon_code.svg"
return
}
if (JSUtil.isVideo(type)) {
icnType.source = "qrc:/assets/icons/icon_movie.svg"
return
}
}
@ -126,6 +133,7 @@ Item {
text: root.customTitle
font.family: ScreenPlay.settings.font
font.pointSize: 16
visible: !screenPlayItemImage.visible
color: Material.primaryTextColor
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
@ -146,7 +154,7 @@ Item {
id: icnType
width: 20
height: 20
opacity: 0
opacity: 0.25
source: "qrc:/assets/icons/icon_movie.svg"
sourceSize: Qt.size(20, 20)
anchors {
@ -220,8 +228,8 @@ Item {
OpacityAnimator {
target: icnType
duration: 80
from: 0.5
to: 1
from: 0.25
to: .8
}
OpacityAnimator {
target: effect
@ -249,8 +257,8 @@ Item {
OpacityAnimator {
target: icnType
duration: 80
from: 1
to: 0.5
from: .8
to: 0.25
}
OpacityAnimator {
target: effect