Skip to content

Commit

Permalink
Version 1.1.1: update style (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinfaury authored and jbouny committed Mar 7, 2018
1 parent b4216c8 commit 2d4981e
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 68 deletions.
39 changes: 0 additions & 39 deletions ButtonAutoLink.qml

This file was deleted.

48 changes: 36 additions & 12 deletions ButtonSendMaps.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,48 @@ import QtQuick.Controls.Styles 1.4

Button {
id: root
height: 30
width: 30
antialiasing: true
height: 32
width: 32
tooltip: "Send all materials to Integration"

property bool enableAutoLink: true

property string clientName: ""

style: ButtonStyle {
background: Rectangle {
color: (root.enabled && hovered)? AlgStyle.background.color.gray : "#141414"
}
label: Item {
Image {
height: parent.height
antialiasing: true
fillMode:Image.PreserveAspectFit
source: enabled ? (clientName == "Unreal4" ? "icons/ue4_connected.png" : "icons/unity_connected.png") : "icons/no_connection.png"
opacity: root.enabled? (hovered? 0.9 : 0.7) : 0.4
}
anchors.fill: root
color: root.hovered ?
"#262626" :
"transparent"
}
}

Image {
anchors.fill: parent
antialiasing: true
anchors.margins: 8
fillMode:Image.PreserveAspectFit
source: enabled ? (clientName == "Unreal4" ? "icons/Unreal_idle.svg" : "icons/Unity_idle.svg") : "icons/Livelink_idle.svg"
opacity: root.enabled ?
1.0:
0.3
sourceSize.width: root.width
sourceSize.height: root.height
}

Rectangle {
id: autoLinkButton
height: 5
width: height
x: 2
y: 2

radius: width

visible: root.enabled
color: root.enableAutoLink? "#2FB29C" : "#EF4E35"
}

}
14 changes: 9 additions & 5 deletions Settings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,15 @@ AlgWindow {
visible: false
minimumWidth: 300
maximumWidth: minimumWidth
minimumHeight: 150
minimumHeight: 170
maximumHeight: minimumHeight

Component.onCompleted: {
flags = flags | Qt.WindowStaysOnTopHint;
}

property int linkQuickInterval: 300 /*ms*/
property int linkDegradedResolution: 1024
property int linkHQTreshold: 2048
property int linkHQInterval: 4000 /*ms*/
property int initDelayOnProjectCreation: 5000 /*ms*/
property bool enableAutoLink: stream.checked
readonly property string settingsKeyPrefix: "live_link"

GridLayout {
Expand Down Expand Up @@ -71,6 +68,13 @@ AlgWindow {
component.currentIndex = log2(defaultValue) - log2(component.minResolution);
}

AlgCheckBox {
id: stream
text: "Enable streaming"
checked: true
height: 16
}

AlgSlider {
Layout.columnSpan: 2
Layout.fillWidth:true
Expand Down
1 change: 1 addition & 0 deletions icons/Livelink_hover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/Livelink_idle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/Unity_idle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions icons/Unreal_idle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icons/no_connection.png
Binary file not shown.
Binary file removed icons/ue4_connected.png
Binary file not shown.
Binary file removed icons/unity_connected.png
Binary file not shown.
17 changes: 9 additions & 8 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ PainterPlugin {
property bool isLinked: false
property var liveLinkConfig: null
property var sendMapsButton: null
property var autoLinkButton: null
readonly property string linkIdentifierKey: "live_link_identifier"
readonly property bool enableAutoLink: autoLinkButton != null ?
autoLinkButton.enableAutoLink : false
readonly property bool enableAutoLink: settings.enableAutoLink

state: "disconnected"
states: [
Expand All @@ -76,20 +74,23 @@ PainterPlugin {
]

Component.onCompleted: {
sendMapsButton = alg.ui.addToolBarWidget("ButtonSendMaps.qml");
sendMapsButton = alg.ui.addWidgetToPluginToolBar("ButtonSendMaps.qml");
sendMapsButton.clicked.connect(sendMaps);
sendMapsButton.enabled = Qt.binding(function() { return root.isLinked; });

autoLinkButton = alg.ui.addToolBarWidget("ButtonAutoLink.qml");
autoLinkButton.enabled = Qt.binding(function() { return root.isLinked; });
}

onConfigure: settings.visible = true;
onConfigure:
{
settings.open();
}

onEnableAutoLinkChanged: {
if (enableAutoLink) {
autoLink();
}
if (sendMapsButton) {
sendMapsButton.enableAutoLink = enableAutoLink
}
}

function disconnect() {
Expand Down
8 changes: 4 additions & 4 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "Link a supported game engine asset to a Substance Painter project",
"url": "https://github.com/jbouny/painter-plugin-dcc-live-link",
"version": "1.1.0",
"min_api_version": "1.0.6",
"license": "<a href=\"https://opensource.org/licenses/MIT\">MIT</a>"
"url": "https://www.allegorithmic.com",
"version": "1.1.1",
"min_api_version": "1.1.0",
"license": "<a href=\"https://www.allegorithmic.com/legal\">Allegorithmic</a>"
}

0 comments on commit 2d4981e

Please sign in to comment.