mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Add workshop plugin detection
This commit is contained in:
parent
4f304de0e2
commit
60e3049e77
@ -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>
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
|
6
ScreenPlay/qml/Workshop/WorkshopAvailableTest.qml
Normal file
6
ScreenPlay/qml/Workshop/WorkshopAvailableTest.qml
Normal file
@ -0,0 +1,6 @@
|
||||
import QtQuick 2.0
|
||||
import net.aimber.workshop 1.0
|
||||
|
||||
Item {
|
||||
|
||||
}
|
25
ScreenPlay/qml/Workshop/WorkshopLoader.qml
Normal file
25
ScreenPlay/qml/Workshop/WorkshopLoader.qml
Normal 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}
|
||||
}
|
||||
##^##*/
|
Loading…
Reference in New Issue
Block a user