mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #3 from huffman/feat/avatarTools/avatarPackager
Fix AvatarPackager QML size
This commit is contained in:
commit
ceb3b6385d
3 changed files with 30 additions and 26 deletions
|
@ -21,9 +21,11 @@ Windows.ScrollingWindow {
|
||||||
implicitWidth: 384; implicitHeight: 640
|
implicitWidth: 384; implicitHeight: 640
|
||||||
minSize: Qt.vector2d(200, 300)
|
minSize: Qt.vector2d(200, 300)
|
||||||
|
|
||||||
|
|
||||||
//HifiConstants { id: hifi }
|
//HifiConstants { id: hifi }
|
||||||
Rectangle {
|
Item {
|
||||||
anchors.fill: parent
|
height: pane.height
|
||||||
|
width: pane.width
|
||||||
|
|
||||||
AvatarProject {
|
AvatarProject {
|
||||||
id: avatarProject
|
id: avatarProject
|
||||||
|
@ -32,7 +34,7 @@ Windows.ScrollingWindow {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
id: avatarPackagerMain
|
id: avatarPackagerMain
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
|
@ -6,18 +6,17 @@ import QtGraphicalEffects 1.0
|
||||||
import "../../controlsUit" 1.0 as HifiControls
|
import "../../controlsUit" 1.0 as HifiControls
|
||||||
import "../../stylesUit" 1.0
|
import "../../stylesUit" 1.0
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
property int colorScheme;
|
property int colorScheme;
|
||||||
|
|
||||||
color: "blue"
|
|
||||||
|
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.margins: 10
|
||||||
|
|
||||||
RalewaySemiBold {
|
RalewaySemiBold {
|
||||||
id: avatarProjectLabel
|
id: avatarProjectLabel
|
||||||
|
@ -26,11 +25,13 @@ Rectangle {
|
||||||
anchors.topMargin: 25
|
anchors.topMargin: 25
|
||||||
anchors.bottomMargin: 25
|
anchors.bottomMargin: 25
|
||||||
text: 'Avatar Project'
|
text: 'Avatar Project'
|
||||||
|
color: "white"
|
||||||
}
|
}
|
||||||
HifiControls.Button {
|
HifiControls.Button {
|
||||||
id: openFolderButton
|
id: openFolderButton
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.top: avatarProjectLabel.bottom
|
anchors.top: avatarProjectLabel.bottom
|
||||||
|
anchors.topMargin: 10
|
||||||
text: qsTr("Open Project Folder")
|
text: qsTr("Open Project Folder")
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
height: 30
|
height: 30
|
||||||
|
@ -38,28 +39,15 @@ Rectangle {
|
||||||
fileDialogHelper.openDirectory(AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
fileDialogHelper.openDirectory(AvatarPackagerCore.currentAvatarProject.projectFolderPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HifiControls.Button {
|
|
||||||
id: uploadButton
|
|
||||||
width: parent.width
|
|
||||||
anchors.top: openFolderButton.bottom
|
|
||||||
text: qsTr("Upload")
|
|
||||||
color: hifi.buttons.blue
|
|
||||||
colorScheme: root.colorScheme
|
|
||||||
height: 30
|
|
||||||
onClicked: function() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
id: modelText
|
|
||||||
anchors.top: uploadButton.bottom
|
|
||||||
height: 30
|
|
||||||
text: parent.height
|
|
||||||
}
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: 'white'
|
color: 'white'
|
||||||
visible: AvatarPackagerCore.currentAvatarProject !== null
|
visible: AvatarPackagerCore.currentAvatarProject !== null
|
||||||
width: parent.width
|
anchors.top: openFolderButton.bottom
|
||||||
anchors.top: modelText.bottom
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: uploadButton.top
|
||||||
|
anchors.topMargin: 10
|
||||||
|
anchors.bottomMargin: 10
|
||||||
height: 1000
|
height: 1000
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
@ -68,4 +56,15 @@ Rectangle {
|
||||||
delegate: Text { text: '<b>File:</b> ' + modelData }
|
delegate: Text { text: '<b>File:</b> ' + modelData }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
HifiControls.Button {
|
||||||
|
id: uploadButton
|
||||||
|
width: parent.width
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
text: qsTr("Upload")
|
||||||
|
color: hifi.buttons.blue
|
||||||
|
colorScheme: root.colorScheme
|
||||||
|
height: 30
|
||||||
|
onClicked: function() {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QQmlEngine>
|
||||||
|
|
||||||
AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
|
AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
|
||||||
const auto pathToLower = path.toLower();
|
const auto pathToLower = path.toLower();
|
||||||
|
@ -25,7 +26,9 @@ AvatarProject* AvatarProject::openAvatarProject(const QString& path) {
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new AvatarProject(path, file.readAll());
|
auto project = new AvatarProject(path, file.readAll());
|
||||||
|
QQmlEngine::setObjectOwnership(project, QQmlEngine::CppOwnership);
|
||||||
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathToLower.endsWith(".fbx")) {
|
if (pathToLower.endsWith(".fbx")) {
|
||||||
|
|
Loading…
Reference in a new issue