From a93e1591d6e56369b30f3cfbaae103cd533916a2 Mon Sep 17 00:00:00 2001
From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com>
Date: Sat, 27 Jul 2024 21:12:58 -0400
Subject: [PATCH] Add Paste Url button to UI
This adds "Paste" buttons in "Create Model", "Create Material" and "Create Voxels" to help pasting url (which was totally disfunctional in VR)
---
.../system/create/qml/NewMaterialDialog.qml | 22 ++++++-
scripts/system/create/qml/NewModelDialog.qml | 22 +++++--
.../system/create/qml/NewPolyVoxDialog.qml | 59 ++++++++++++++++---
3 files changed, 88 insertions(+), 15 deletions(-)
diff --git a/scripts/system/create/qml/NewMaterialDialog.qml b/scripts/system/create/qml/NewMaterialDialog.qml
index e08ca868b66..4378077ee1e 100644
--- a/scripts/system/create/qml/NewMaterialDialog.qml
+++ b/scripts/system/create/qml/NewMaterialDialog.qml
@@ -2,9 +2,10 @@
// NewMaterialDialog.qml
// qml/hifi
//
-// Created by Sam Gondelman on 1/17/18
+// Created by Sam Gondelman on January 17th, 2018
// Copyright 2018 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors
+// Copyright 2024 Overte e.V.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -55,17 +56,32 @@ Rectangle {
Text {
id: text1
- text: qsTr("Material URL (Optional)")
+ text: qsTr("Material URL (Optional) ")
color: "#ffffff"
font.pixelSize: 12
}
+ Button {
+ id: pasteBtn
+ text: "Paste"
+ font.pixelSize: 11
+ height: 16
+ width: 40
+ radius: 4
+ anchors.top: text1.top
+ anchors.left: text1.right
+ anchors.bottom: text1.bottom
+ onClicked: {
+ materialURL.paste()
+ }
+ }
+
TextInput {
id: materialURL
height: 20
text: qsTr("")
color: "white"
- anchors.top: text1.bottom
+ anchors.top: pasteBtn.bottom
anchors.topMargin: 5
anchors.left: parent.left
anchors.leftMargin: 0
diff --git a/scripts/system/create/qml/NewModelDialog.qml b/scripts/system/create/qml/NewModelDialog.qml
index c03e7c1c353..07c46280afb 100644
--- a/scripts/system/create/qml/NewModelDialog.qml
+++ b/scripts/system/create/qml/NewModelDialog.qml
@@ -2,9 +2,10 @@
// NewModelDialog.qml
// qml/hifi
//
-// Created by Seth Alves on 2017-2-10
+// Created by Seth Alves on February 10th, 2017
// Copyright 2017 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors
+// Copyright 2024 Overte e.V.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -55,17 +56,30 @@ Rectangle {
Text {
id: text1
- text: qsTr("Model URL (.fbx, .fst, .glb, .gltf, .obj, .gz)")
+ text: qsTr("Model URL (.fbx, .fst, .glb, .gltf, .obj, .gz) ")
color: "#ffffff"
font.pixelSize: 12
}
-
+ Button {
+ id: pasteBtn
+ text: "Paste"
+ font.pixelSize: 11
+ height: 16
+ width: 40
+ radius: 4
+ anchors.top: text1.top + 10
+ anchors.left: text1.right
+ anchors.bottom: text1.bottom
+ onClicked: {
+ modelURL.paste()
+ }
+ }
TextInput {
id: modelURL
height: 20
text: qsTr("")
color: "white"
- anchors.top: text1.bottom
+ anchors.top: pasteBtn.bottom
anchors.topMargin: 5
anchors.left: parent.left
anchors.leftMargin: 0
diff --git a/scripts/system/create/qml/NewPolyVoxDialog.qml b/scripts/system/create/qml/NewPolyVoxDialog.qml
index 0f8ab5541da..67c0a76bf77 100644
--- a/scripts/system/create/qml/NewPolyVoxDialog.qml
+++ b/scripts/system/create/qml/NewPolyVoxDialog.qml
@@ -1,12 +1,12 @@
//
// NewPolyVoxDialog.qml
-// Created by dr Karol Suprynowicz on 2022.05.17.
+// Created by dr Karol Suprynowicz on May 17th, 2022
// based on NewModelDialog.qml
// qml/hifi
//
// Copyright 2017 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors
-// Copyright 2022 Overte e.V.
+// Copyright 2022-2024 Overte e.V.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@@ -117,17 +117,32 @@ Rectangle {
id: text1
anchors.top: texturePreset.bottom
anchors.topMargin: 5
- text: qsTr("X Texture URL")
+ text: qsTr("X Texture URL ")
color: "#ffffff"
font.pixelSize: 12
}
+ Button {
+ id: pasteBtn1
+ text: "Paste"
+ font.pixelSize: 11
+ height: 16
+ width: 40
+ radius: 4
+ anchors.top: text1.top
+ anchors.left: text1.right
+ anchors.bottom: text1.bottom
+ onClicked: {
+ xTextureURL.paste()
+ }
+ }
+
TextInput {
id: xTextureURL
height: 20
text: qsTr("")
color: "white"
- anchors.top: text1.bottom
+ anchors.top: pasteBtn1.bottom
anchors.topMargin: 5
anchors.left: parent.left
anchors.leftMargin: 0
@@ -167,19 +182,33 @@ Rectangle {
Text {
id: text2
- text: qsTr("Y Texture URL")
+ text: qsTr("Y Texture URL ")
color: "#ffffff"
font.pixelSize: 12
anchors.top: textInputBox1.bottom
anchors.topMargin: 5
}
+ Button {
+ id: pasteBtn2
+ text: "Paste"
+ font.pixelSize: 11
+ height: 16
+ width: 40
+ radius: 4
+ anchors.top: text2.top
+ anchors.left: text2.right
+ anchors.bottom: text2.bottom
+ onClicked: {
+ yTextureURL.paste()
+ }
+ }
TextInput {
id: yTextureURL
height: 20
text: qsTr("")
color: "white"
- anchors.top: text2.bottom
+ anchors.top: pasteBtn2.bottom
anchors.topMargin: 5
anchors.left: parent.left
anchors.leftMargin: 0
@@ -219,19 +248,33 @@ Rectangle {
Text {
id: text3
- text: qsTr("Z Texture URL")
+ text: qsTr("Z Texture URL ")
color: "#ffffff"
font.pixelSize: 12
anchors.top: textInputBox2.bottom
anchors.topMargin: 5
}
+ Button {
+ id: pasteBtn3
+ text: "Paste"
+ font.pixelSize: 11
+ height: 16
+ width: 40
+ radius: 4
+ anchors.top: text3.top
+ anchors.left: text3.right
+ anchors.bottom: text3.bottom
+ onClicked: {
+ zTextureURL.paste()
+ }
+ }
TextInput {
id: zTextureURL
height: 20
text: qsTr("")
color: "white"
- anchors.top: text3.bottom
+ anchors.top: pasteBtn3.bottom
anchors.topMargin: 5
anchors.left: parent.left
anchors.leftMargin: 0