1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Add workshop plugin detection

This commit is contained in:
Elias 2018-12-17 20:54:04 +01:00
parent 4f304de0e2
commit 60e3049e77
5 changed files with 48 additions and 0 deletions

View File

@ -123,5 +123,7 @@
<file>qml/Screen/Screen.qml</file>
<file>assets/icons/icon_screen.svg</file>
<file>qml/Background.qml</file>
<file>qml/Workshop/WorkshopAvailableTest.qml</file>
<file>qml/Workshop/WorkshopLoader.qml</file>
</qresource>
</RCC>

View File

@ -2,6 +2,8 @@ import QtQuick 2.9
import QtQuick.Controls 2.3
import QtGraphicalEffects 1.0
import "Workshop"
Rectangle {
id: navigation
height: 60
@ -52,6 +54,10 @@ Rectangle {
}
}
WorkshopLoader {
id:wl
}
Row {
id: row
anchors.fill: parent
@ -72,6 +78,7 @@ Rectangle {
id: navWorkshop
state: "inactive"
name: "Workshop"
enabled: wl.available
iconSource: "qrc:/assets/icons/icon_steam.svg"
onPageClicked: navigation.onPageChanged(name)
}

View File

@ -9,6 +9,14 @@ Item {
clip: true
property string name: "value"
property bool enabled: true
onEnabledChanged: {
if(!enabled){
navigationItem.width = 0
navigationItem.opacity = 0
}
}
onNameChanged: {
txt.text = name
textMetrics.text = name

View File

@ -0,0 +1,6 @@
import QtQuick 2.0
import net.aimber.workshop 1.0
Item {
}

View File

@ -0,0 +1,25 @@
import QtQuick 2.9
Item {
id: workshopLoader
property bool available: true
Loader {
id: wsLoader
source: "qrc:/qml/Workshop/WorkshopAvailableTest.qml"
onStatusChanged: {
if (status == Loader.Ready) {
available = true
} else if (status == Loader.Error) {
available = false
}
print(available)
}
}
}
/*##^## Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/