Merge remote-tracking branch 'origin/qds/dev'
Change-Id: I74bf2bfb1eacb60675640c47eb41ce51dd6eb99f
5
dist/installer/mac/qmldesigner_qt.conf
vendored
@@ -1,5 +0,0 @@
|
||||
[Paths]
|
||||
Prefix = ../../..
|
||||
Imports = Imports/qtquick1
|
||||
Qml2Imports = Imports/qtquick2
|
||||
Plugins = PlugIns
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@@ -9,7 +9,7 @@
|
||||
\title Exporting Designs from Adobe Illustrator
|
||||
|
||||
Even though \QDS does not provide a specific export bridge for Adobe
|
||||
Illustrator, you can desing UIs in it and export your designs to \QDS in
|
||||
Illustrator, you can design UIs in it and export your designs to \QDS in
|
||||
the following ways:
|
||||
|
||||
\list
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
you specified. This might take a little while depending on the complexity of
|
||||
your project.
|
||||
|
||||
You can now create a project in \QDS and import the .atbrige archive to it, as
|
||||
You can now create a project in \QDS and import the .qtbridge archive to it, as
|
||||
described in \l {Creating Projects} and \l{Importing Designs}.
|
||||
|
||||
\section1 Specifying Export Path and Asset Format
|
||||
|
||||
@@ -36,8 +36,9 @@
|
||||
\QB is available for the following design tools:
|
||||
|
||||
\list
|
||||
\li Adobe Photoshop version 22.3.1
|
||||
\li Figma version 97.x
|
||||
\li Sketch version 72.2
|
||||
\li Adobe Photoshop version 24.0
|
||||
\li Adobe XD version 55.0.12
|
||||
\li Figma version 116.4
|
||||
\li Sketch version 90.0
|
||||
\endlist
|
||||
*/
|
||||
|
||||
@@ -180,7 +180,7 @@
|
||||
|
||||
Each state group has its own property changes and transitions.
|
||||
|
||||
By default, there is one root state group.
|
||||
By default, there is one default state group.
|
||||
|
||||
\section1 Extending States
|
||||
|
||||
|
||||
@@ -74,12 +74,6 @@ if [ ! -f "$libexec_path/ios/qt.conf" ]; then
|
||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/ios_qt.conf" "$libexec_path/ios/qt.conf" || exit 1
|
||||
fi
|
||||
|
||||
# copy qml2puppet's qt.conf
|
||||
if [ ! -f "$libexec_path/qmldesigner/qt.conf" ]; then
|
||||
echo "- Copying libexec/qmldesigner/qt.conf"
|
||||
cp -f "$(dirname "${BASH_SOURCE[0]}")/../dist/installer/mac/qmldesigner_qt.conf" "$libexec_path/qmldesigner/qt.conf" || exit 1
|
||||
fi
|
||||
|
||||
# copy Qt translations
|
||||
# check for known existing translation to avoid copying multiple times
|
||||
if [ ! -f "$resource_path/translations/qt_de.qm" ]; then
|
||||
@@ -114,10 +108,7 @@ fi
|
||||
|
||||
if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then
|
||||
|
||||
qml2puppetapp="$libexec_path/qmldesigner/qml2puppet"
|
||||
if [ -f "$qml2puppetapp" ]; then
|
||||
qml2puppetArgument="-executable=$qml2puppetapp"
|
||||
fi
|
||||
echo "- Running macdeployqt ($bin_src/macdeployqt)"
|
||||
|
||||
qbsapp="$app_path/Contents/MacOS/qbs"
|
||||
if [ -f "$qbsapp" ]; then
|
||||
@@ -131,7 +122,10 @@ if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then
|
||||
"-executable=$libexec_path/qbs_processlauncher")
|
||||
fi
|
||||
|
||||
echo "- Running macdeployqt ($bin_src/macdeployqt)"
|
||||
qml2puppetapp="$libexec_path/qml2puppet"
|
||||
if [ -f "$qml2puppetapp" ]; then
|
||||
qml2puppetArgument="-executable=$qml2puppetapp"
|
||||
fi
|
||||
|
||||
"$bin_src/macdeployqt" "$app_path" \
|
||||
"-executable=$app_path/Contents/MacOS/qtdiag" \
|
||||
|
||||
@@ -4,7 +4,6 @@ set(resource_directories
|
||||
glsl
|
||||
indexer_preincludes
|
||||
modeleditor
|
||||
qml
|
||||
qmldesigner
|
||||
qmlicons
|
||||
qml-type-descriptions
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
INCLUDEPATH += $$PWD $$PWD/../interfaces
|
||||
|
||||
HEADERS += $$PWD/synchronizecommand.h \ \
|
||||
$$PWD/captureddatacommand.h \
|
||||
$$PWD/changepreviewimagesizecommand.h \
|
||||
$$PWD/changelanguagecommand.h \
|
||||
$$PWD//debugoutputcommand.h \
|
||||
$$PWD/endpuppetcommand.h \
|
||||
$$PWD/scenecreatedcommand.h \
|
||||
$$PWD/tokencommand.h \
|
||||
$$PWD/componentcompletedcommand.h \
|
||||
$$PWD/completecomponentcommand.h \
|
||||
$$PWD/statepreviewimagechangedcommand.h \
|
||||
$$PWD/childrenchangedcommand.h \
|
||||
$$PWD/changebindingscommand.h \
|
||||
$$PWD/changefileurlcommand.h \
|
||||
$$PWD/changeidscommand.h \
|
||||
$$PWD/changenodesourcecommand.h \
|
||||
$$PWD/changestatecommand.h \
|
||||
$$PWD/changevaluescommand.h \
|
||||
$$PWD/createscenecommand.h \
|
||||
$$PWD/clearscenecommand.h \
|
||||
$$PWD/createinstancescommand.h \
|
||||
$$PWD/informationchangedcommand.h \
|
||||
$$PWD/nanotracecommand.h \
|
||||
$$PWD/pixmapchangedcommand.h \
|
||||
$$PWD/removeinstancescommand.h \
|
||||
$$PWD/removepropertiescommand.h \
|
||||
$$PWD/reparentinstancescommand.h \
|
||||
$$PWD/valueschangedcommand.h \
|
||||
$$PWD/changeauxiliarycommand.h \
|
||||
$$PWD/removesharedmemorycommand.h \
|
||||
$$PWD/puppetalivecommand.h \
|
||||
$$PWD/changeselectioncommand.h \
|
||||
$$PWD/update3dviewstatecommand.h \
|
||||
$$PWD/puppettocreatorcommand.h \
|
||||
$$PWD/inputeventcommand.h \
|
||||
$$PWD/view3dactioncommand.h \
|
||||
$$PWD/requestmodelnodepreviewimagecommand.h
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/changepreviewimagesizecommand.cpp \
|
||||
$$PWD/changelanguagecommand.cpp \
|
||||
$$PWD/debugoutputcommand.cpp \
|
||||
$$PWD/endpuppetcommand.cpp \
|
||||
$$PWD/tokencommand.cpp \
|
||||
$$PWD/componentcompletedcommand.cpp \
|
||||
$$PWD/completecomponentcommand.cpp \
|
||||
$$PWD/statepreviewimagechangedcommand.cpp \
|
||||
$$PWD/childrenchangedcommand.cpp \
|
||||
$$PWD/changebindingscommand.cpp \
|
||||
$$PWD/changefileurlcommand.cpp \
|
||||
$$PWD/changeidscommand.cpp \
|
||||
$$PWD/changenodesourcecommand.cpp \
|
||||
$$PWD/changestatecommand.cpp \
|
||||
$$PWD/changevaluescommand.cpp \
|
||||
$$PWD/informationchangedcommand.cpp \
|
||||
$$PWD/nanotracecommand.cpp \
|
||||
$$PWD/removeinstancescommand.cpp \
|
||||
$$PWD/removepropertiescommand.cpp \
|
||||
$$PWD/reparentinstancescommand.cpp \
|
||||
$$PWD/valueschangedcommand.cpp \
|
||||
$$PWD/clearscenecommand.cpp \
|
||||
$$PWD/createinstancescommand.cpp \
|
||||
$$PWD/createscenecommand.cpp \
|
||||
$$PWD/pixmapchangedcommand.cpp \
|
||||
$$PWD/changeauxiliarycommand.cpp \
|
||||
$$PWD/removesharedmemorycommand.cpp \
|
||||
$$PWD/puppetalivecommand.cpp \
|
||||
$$PWD/changeselectioncommand.cpp \
|
||||
$$PWD/update3dviewstatecommand.cpp \
|
||||
$$PWD/puppettocreatorcommand.cpp \
|
||||
$$PWD/inputeventcommand.cpp \
|
||||
$$PWD/view3dactioncommand.cpp \
|
||||
$$PWD/requestmodelnodepreviewimagecommand.cpp
|
||||
@@ -1,26 +0,0 @@
|
||||
INCLUDEPATH += $$PWD/
|
||||
|
||||
HEADERS += $$PWD/addimportcontainer.h
|
||||
HEADERS += $$PWD/mockuptypecontainer.h
|
||||
HEADERS += $$PWD/sharedmemory.h
|
||||
HEADERS += $$PWD/imagecontainer.h
|
||||
HEADERS += $$PWD/idcontainer.h
|
||||
HEADERS += $$PWD/informationcontainer.h
|
||||
HEADERS += $$PWD/instancecontainer.h
|
||||
HEADERS += $$PWD/reparentcontainer.h
|
||||
HEADERS += $$PWD/propertyabstractcontainer.h
|
||||
HEADERS += $$PWD/propertybindingcontainer.h
|
||||
HEADERS += $$PWD/propertyvaluecontainer.h
|
||||
|
||||
SOURCES += $$PWD/addimportcontainer.cpp
|
||||
SOURCES += $$PWD/mockuptypecontainer.cpp
|
||||
unix:SOURCES += $$PWD/sharedmemory_unix.cpp
|
||||
!unix:SOURCES += $$PWD/sharedmemory_qt.cpp
|
||||
SOURCES += $$PWD/imagecontainer.cpp
|
||||
SOURCES += $$PWD/idcontainer.cpp
|
||||
SOURCES += $$PWD/informationcontainer.cpp
|
||||
SOURCES += $$PWD/instancecontainer.cpp
|
||||
SOURCES += $$PWD/reparentcontainer.cpp
|
||||
SOURCES += $$PWD/propertyabstractcontainer.cpp
|
||||
SOURCES += $$PWD/propertybindingcontainer.cpp
|
||||
SOURCES += $$PWD/propertyvaluecontainer.cpp
|
||||
@@ -1,8 +0,0 @@
|
||||
INCLUDEPATH += $$PWD/
|
||||
|
||||
HEADERS += $$PWD/nodeinstanceclientinterface.h
|
||||
HEADERS += $$PWD/nodeinstanceglobal.h
|
||||
HEADERS += $$PWD/nodeinstanceserverinterface.h
|
||||
HEADERS += $$PWD/commondefines.h
|
||||
|
||||
SOURCES += $$PWD/nodeinstanceserverinterface.cpp
|
||||
@@ -1,46 +0,0 @@
|
||||
QT += core gui widgets qml quick network
|
||||
QT += core-private qml-private quick-private gui-private
|
||||
|
||||
CONFIG += c++17
|
||||
win32:!mingw: QMAKE_CXXFLAGS += /std:c++17
|
||||
|
||||
DEFINES -= QT_CREATOR
|
||||
|
||||
# This .pri file contains classes to enable a special multilanguage translator
|
||||
MULTILANGUAGE_SUPPORT_PRI=$$(MULTILANGUAGE_SUPPORT_PRI)
|
||||
!isEmpty(MULTILANGUAGE_SUPPORT_PRI) {
|
||||
exists($$(MULTILANGUAGE_SUPPORT_PRI)): message(including \"$$(MULTILANGUAGE_SUPPORT_PRI)\")
|
||||
else: error("MULTILANGUAGE_SUPPORT_PRI: \"$$(MULTILANGUAGE_SUPPORT_PRI)\" does not exist.")
|
||||
include($$(MULTILANGUAGE_SUPPORT_PRI))
|
||||
DEFINES += MULTILANGUAGE_TRANSLATIONPROVIDER
|
||||
}
|
||||
|
||||
include (editor3d/editor3d.pri)
|
||||
include (../instances/instances.pri)
|
||||
include (instances/instances.pri)
|
||||
include (../commands/commands.pri)
|
||||
include (../container/container.pri)
|
||||
include (../interfaces/interfaces.pri)
|
||||
include (../types/types.pri)
|
||||
include (../qmlprivategate/qmlprivategate.pri)
|
||||
include (iconrenderer/iconrenderer.pri)
|
||||
include (import3d/import3d.pri)
|
||||
|
||||
SOURCES += $$PWD/qml2puppetmain.cpp
|
||||
RESOURCES += $$PWD/../qmlpuppet.qrc
|
||||
|
||||
versionAtLeast(QT_VERSION, 6.0.0): RESOURCES += $$PWD/../editor3d_qt6.qrc
|
||||
else: RESOURCES += $$PWD/../editor3d_qt5.qrc
|
||||
|
||||
DISTFILES += Info.plist
|
||||
|
||||
unix:!openbsd:!osx: LIBS += -lrt # posix shared memory
|
||||
|
||||
osx {
|
||||
CONFIG -= app_bundle
|
||||
QMAKE_LFLAGS += -Wl,-sectcreate,__TEXT,__info_plist,$$system_quote($$PWD/Info.plist)
|
||||
}
|
||||
|
||||
osx: target.path = $$INSTALL_LIBEXEC_PATH/qmldesigner
|
||||
else: target.path = $$INSTALL_LIBEXEC_PATH
|
||||
INSTALLS += target
|
||||
@@ -1,11 +0,0 @@
|
||||
TARGET = qml2puppet
|
||||
|
||||
TEMPLATE = app
|
||||
CONFIG += console
|
||||
|
||||
build_all:!build_pass {
|
||||
CONFIG -= build_all
|
||||
CONFIG += release
|
||||
}
|
||||
|
||||
include(qml2puppet.pri)
|
||||
@@ -1,31 +0,0 @@
|
||||
# Try to find location of Qt private headers (see README)
|
||||
isEmpty(QT_PRIVATE_HEADERS) {
|
||||
QT_PRIVATE_HEADERS = $$[QT_INSTALL_HEADERS]
|
||||
} else {
|
||||
INCLUDEPATH += \
|
||||
$${QT_PRIVATE_HEADERS} \
|
||||
$${QT_PRIVATE_HEADERS}/QtCore \
|
||||
$${QT_PRIVATE_HEADERS}/QtGui \
|
||||
$${QT_PRIVATE_HEADERS}/QtScript \
|
||||
$${QT_PRIVATE_HEADERS}/QtDeclarative
|
||||
}
|
||||
|
||||
defineTest(minQtVersion) {
|
||||
maj = $$1
|
||||
min = $$2
|
||||
patch = $$3
|
||||
isEqual(QT_MAJOR_VERSION, $$maj) {
|
||||
isEqual(QT_MINOR_VERSION, $$min) {
|
||||
isEqual(QT_PATCH_VERSION, $$patch) {
|
||||
return(true)
|
||||
}
|
||||
greaterThan(QT_PATCH_VERSION, $$patch) {
|
||||
return(true)
|
||||
}
|
||||
}
|
||||
greaterThan(QT_MINOR_VERSION, $$min) {
|
||||
return(true)
|
||||
}
|
||||
}
|
||||
return(false)
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
INCLUDEPATH += $$PWD/
|
||||
|
||||
HEADERS += $$PWD/enumeration.h
|
||||
@@ -0,0 +1,121 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuickDesignerTheme
|
||||
import HelperWidgets as HelperWidgets
|
||||
import StudioControls as StudioControls
|
||||
import StudioTheme as StudioTheme
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
// Called also from C++ to close context menu on focus out
|
||||
function closeContextMenu()
|
||||
{
|
||||
materialsView.closeContextMenu()
|
||||
texturesView.closeContextMenu()
|
||||
environmentsView.closeContextMenu()
|
||||
}
|
||||
|
||||
// Called from C++
|
||||
function clearSearchFilter()
|
||||
{
|
||||
searchBox.clear();
|
||||
}
|
||||
|
||||
Column {
|
||||
id: col
|
||||
y: 5
|
||||
spacing: 5
|
||||
|
||||
StudioControls.SearchBox {
|
||||
id: searchBox
|
||||
|
||||
width: root.width
|
||||
enabled: !materialsModel.hasMaterialRoot && materialsModel.hasQuick3DImport
|
||||
|
||||
onSearchChanged: (searchText) => {
|
||||
rootView.handleSearchFilterChanged(searchText)
|
||||
|
||||
// make sure categories with matches are expanded
|
||||
materialsView.expandVisibleSections()
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
// TODO: only disable the materials section, textures should be available
|
||||
text: {
|
||||
if (materialsModel.hasMaterialRoot)
|
||||
qsTr("<b>Content Library</b> is disabled inside a material component.")
|
||||
else if (!materialsModel.hasQuick3DImport)
|
||||
qsTr("To use <b>Content Library</b>, first add the QtQuick3D module in the <b>Components</b> view.")
|
||||
else
|
||||
""
|
||||
}
|
||||
|
||||
textFormat: Text.RichText
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
font.pixelSize: StudioTheme.Values.mediumFontSize
|
||||
topPadding: 30
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.WordWrap
|
||||
width: root.width
|
||||
visible: text !== ""
|
||||
}
|
||||
|
||||
UnimportBundleMaterialDialog {
|
||||
id: confirmUnimportDialog
|
||||
}
|
||||
|
||||
ContentLibraryTabBar {
|
||||
id: tabBar
|
||||
|
||||
visible: materialsModel.hasQuick3DImport
|
||||
// TODO: update icons
|
||||
tabsModel: [{name: qsTr("Materials"), icon: StudioTheme.Constants.gradient},
|
||||
{name: qsTr("Textures"), icon: StudioTheme.Constants.materialPreviewEnvironment},
|
||||
{name: qsTr("Environments"), icon: StudioTheme.Constants.translationSelectLanguages}]
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
width: root.width
|
||||
height: root.height - y
|
||||
currentIndex: tabBar.currIndex
|
||||
visible: materialsModel.hasQuick3DImport
|
||||
|
||||
ContentLibraryMaterialsView {
|
||||
id: materialsView
|
||||
|
||||
width: root.width
|
||||
|
||||
searchBox: searchBox
|
||||
|
||||
onUnimport: (bundleMat) => {
|
||||
unimportBundleMaterialDialog.targetBundleMaterial = bundleMat
|
||||
unimportBundleMaterialDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
ContentLibraryTexturesView {
|
||||
id: texturesView
|
||||
|
||||
width: root.width
|
||||
model: texturesModel
|
||||
|
||||
searchBox: searchBox
|
||||
}
|
||||
|
||||
ContentLibraryTexturesView {
|
||||
id: environmentsView
|
||||
|
||||
width: root.width
|
||||
model: environmentsModel
|
||||
|
||||
searchBox: searchBox
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,5 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
@@ -45,8 +23,8 @@ Item {
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onPressed: (mouse) => {
|
||||
if (mouse.button === Qt.LeftButton && !materialBrowserBundleModel.importerRunning)
|
||||
rootView.startDragBundleMaterial(modelData, mapToGlobal(mouse.x, mouse.y))
|
||||
if (mouse.button === Qt.LeftButton && !materialsModel.importerRunning)
|
||||
rootView.startDragMaterial(modelData, mapToGlobal(mouse.x, mouse.y))
|
||||
else if (mouse.button === Qt.RightButton)
|
||||
root.showContextMenu()
|
||||
}
|
||||
@@ -102,10 +80,10 @@ Item {
|
||||
pressColor: Qt.hsla(c.hslHue, c.hslSaturation, c.hslLightness, .4)
|
||||
anchors.right: img.right
|
||||
anchors.bottom: img.bottom
|
||||
enabled: !materialBrowserBundleModel.importerRunning
|
||||
enabled: !materialsModel.importerRunning
|
||||
|
||||
onClicked: {
|
||||
materialBrowserBundleModel.addToProject(modelData)
|
||||
materialsModel.addToProject(modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick 2.15
|
||||
import HelperWidgets 2.0
|
||||
import StudioControls 1.0 as StudioControls
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
|
||||
StudioControls.Menu {
|
||||
id: root
|
||||
|
||||
property var targetMaterial: null
|
||||
signal unimport(var bundleMat);
|
||||
|
||||
function popupMenu(targetMaterial = null)
|
||||
{
|
||||
this.targetMaterial = targetMaterial
|
||||
popup()
|
||||
}
|
||||
|
||||
closePolicy: StudioControls.Menu.CloseOnEscape | StudioControls.Menu.CloseOnPressOutside
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("Apply to selected (replace)")
|
||||
enabled: root.targetMaterial && materialsModel.hasModelSelection
|
||||
onTriggered: materialsModel.applyToSelected(root.targetMaterial, false)
|
||||
}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("Apply to selected (add)")
|
||||
enabled: root.targetMaterial && materialsModel.hasModelSelection
|
||||
onTriggered: materialsModel.applyToSelected(root.targetMaterial, true)
|
||||
}
|
||||
|
||||
StudioControls.MenuSeparator {}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
enabled: !materialsModel.importerRunning
|
||||
text: qsTr("Add an instance to project")
|
||||
|
||||
onTriggered: {
|
||||
materialsModel.addToProject(root.targetMaterial)
|
||||
}
|
||||
}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
enabled: !materialsModel.importerRunning && root.targetMaterial && root.targetMaterial.bundleMaterialImported
|
||||
text: qsTr("Remove from project")
|
||||
|
||||
onTriggered: root.unimport(root.targetMaterial);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick
|
||||
import HelperWidgets as HelperWidgets
|
||||
import StudioControls as StudioControls
|
||||
import StudioTheme as StudioTheme
|
||||
|
||||
HelperWidgets.ScrollView {
|
||||
id: root
|
||||
|
||||
clip: true
|
||||
|
||||
readonly property int cellWidth: 100
|
||||
readonly property int cellHeight: 120
|
||||
|
||||
property var currMaterialItem: null
|
||||
property var rootItem: null
|
||||
|
||||
required property var searchBox
|
||||
|
||||
signal unimport(var bundleMat);
|
||||
|
||||
function closeContextMenu()
|
||||
{
|
||||
ctxMenu.close()
|
||||
}
|
||||
|
||||
function expandVisibleSections()
|
||||
{
|
||||
for (let i = 0; i < categoryRepeater.count; ++i) {
|
||||
let cat = categoryRepeater.itemAt(i)
|
||||
if (cat.visible && !cat.expanded)
|
||||
cat.expanded = true
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
ContentLibraryMaterialContextMenu {
|
||||
id: ctxMenu
|
||||
|
||||
onUnimport: (bundleMat) => root.unimport(bundleMat)
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: categoryRepeater
|
||||
|
||||
model: materialsModel
|
||||
|
||||
delegate: HelperWidgets.Section {
|
||||
width: root.width
|
||||
caption: bundleCategoryName
|
||||
addTopPadding: false
|
||||
sectionBackgroundColor: "transparent"
|
||||
visible: bundleCategoryVisible
|
||||
expanded: bundleCategoryExpanded
|
||||
expandOnClick: false
|
||||
onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
|
||||
|
||||
Grid {
|
||||
width: root.width
|
||||
leftPadding: 5
|
||||
rightPadding: 5
|
||||
bottomPadding: 5
|
||||
columns: root.width / root.cellWidth
|
||||
|
||||
Repeater {
|
||||
model: bundleCategoryMaterials
|
||||
|
||||
delegate: ContentLibraryMaterial {
|
||||
width: root.cellWidth
|
||||
height: root.cellHeight
|
||||
|
||||
onShowContextMenu: ctxMenu.popupMenu(modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: noMatchText
|
||||
text: qsTr("No match found.");
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
font.pixelSize: StudioTheme.Values.baseFontSize
|
||||
topPadding: 10
|
||||
leftPadding: 10
|
||||
visible: materialsModel.isEmpty && !searchBox.isEmpty() && !materialsModel.hasMaterialRoot
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick
|
||||
import StudioTheme as StudioTheme
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
width: parent.width
|
||||
height: 50
|
||||
color: StudioTheme.Values.themeSectionHeadBackground
|
||||
|
||||
property int currIndex: 0
|
||||
property alias tabsModel: repeater.model
|
||||
|
||||
Row {
|
||||
spacing: 1
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
|
||||
ContentLibraryTabButton {
|
||||
height: root.height
|
||||
|
||||
name: modelData.name
|
||||
icon: modelData.icon
|
||||
selected: root.currIndex === index
|
||||
onClicked: root.currIndex = index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick
|
||||
import StudioTheme as StudioTheme
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
signal clicked()
|
||||
|
||||
property alias icon: icon.text
|
||||
property alias name: name.text
|
||||
property bool selected: false
|
||||
|
||||
width: 100
|
||||
height: 100
|
||||
color: root.selected ? StudioTheme.Values.themePanelBackground
|
||||
: mouseArea.containsMouse ? Qt.lighter(StudioTheme.Values.themeSectionHeadBackground, 1.3)
|
||||
: StudioTheme.Values.themeSectionHeadBackground
|
||||
|
||||
Text {
|
||||
id: icon
|
||||
|
||||
color: root.selected ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor
|
||||
|
||||
font.family: StudioTheme.Constants.iconFont.family
|
||||
font.pixelSize: StudioTheme.Values.mediumIconFontSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
y: 8
|
||||
}
|
||||
|
||||
Text {
|
||||
id: name
|
||||
|
||||
font.weight: Font.DemiBold
|
||||
font.pixelSize: StudioTheme.Values.baseFontSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 6
|
||||
|
||||
color: root.selected ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor
|
||||
}
|
||||
|
||||
Rectangle { // strip
|
||||
width: root.width
|
||||
height: 4
|
||||
color: root.selected ? StudioTheme.Values.themeInteraction : "transparent"
|
||||
anchors.bottom: parent.bottom
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: root.clicked()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuickDesignerTheme 1.0
|
||||
import HelperWidgets 2.0
|
||||
import QtQuick.Controls
|
||||
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
|
||||
Image {
|
||||
id: root
|
||||
|
||||
source: modelData.textureIcon
|
||||
visible: modelData.textureVisible
|
||||
cache: false
|
||||
|
||||
signal showContextMenu()
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onPressed: (mouse) => {
|
||||
if (mouse.button === Qt.LeftButton)
|
||||
rootView.startDragTexture(modelData, mapToGlobal(mouse.x, mouse.y))
|
||||
else if (mouse.button === Qt.RightButton)
|
||||
root.showContextMenu()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick 2.15
|
||||
import HelperWidgets 2.0
|
||||
import StudioControls 1.0 as StudioControls
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
|
||||
StudioControls.Menu {
|
||||
id: root
|
||||
|
||||
property var targetTexture: null
|
||||
property bool hasSceneEnv: false
|
||||
|
||||
function popupMenu(targetTexture = null)
|
||||
{
|
||||
this.targetTexture = targetTexture
|
||||
popup()
|
||||
}
|
||||
|
||||
closePolicy: StudioControls.Menu.CloseOnEscape | StudioControls.Menu.CloseOnPressOutside
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("Add image")
|
||||
enabled: root.targetTexture
|
||||
onTriggered: rootView.addImage(root.targetTexture)
|
||||
}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("Add texture")
|
||||
enabled: root.targetTexture
|
||||
onTriggered: rootView.addTexture(root.targetTexture)
|
||||
}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("Add light probe")
|
||||
enabled: root.hasSceneEnv && root.targetTexture
|
||||
onTriggered: rootView.addLightProbe(root.targetTexture)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick
|
||||
import HelperWidgets as HelperWidgets
|
||||
import StudioControls as StudioControls
|
||||
import StudioTheme as StudioTheme
|
||||
|
||||
HelperWidgets.ScrollView {
|
||||
id: root
|
||||
|
||||
clip: true
|
||||
|
||||
readonly property int cellWidth: 100
|
||||
readonly property int cellHeight: 100
|
||||
|
||||
property var currMaterialItem: null
|
||||
property var rootItem: null
|
||||
|
||||
required property var searchBox
|
||||
required property var model
|
||||
|
||||
signal unimport(var bundleMat);
|
||||
|
||||
function closeContextMenu()
|
||||
{
|
||||
ctxMenu.close()
|
||||
}
|
||||
|
||||
function expandVisibleSections()
|
||||
{
|
||||
for (let i = 0; i < categoryRepeater.count; ++i) {
|
||||
let cat = categoryRepeater.itemAt(i)
|
||||
if (cat.visible && !cat.expanded)
|
||||
cat.expanded = true
|
||||
}
|
||||
}
|
||||
Column {
|
||||
ContentLibraryTextureContextMenu {
|
||||
id: ctxMenu
|
||||
|
||||
hasSceneEnv: root.model.hasSceneEnv
|
||||
}
|
||||
|
||||
Repeater {
|
||||
id: categoryRepeater
|
||||
|
||||
model: root.model
|
||||
|
||||
delegate: HelperWidgets.Section {
|
||||
width: root.width
|
||||
caption: bundleCategoryName
|
||||
addTopPadding: false
|
||||
sectionBackgroundColor: "transparent"
|
||||
visible: bundleCategoryVisible
|
||||
expanded: bundleCategoryExpanded
|
||||
expandOnClick: false
|
||||
onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
|
||||
|
||||
Grid {
|
||||
width: root.width
|
||||
leftPadding: 5
|
||||
rightPadding: 5
|
||||
bottomPadding: 5
|
||||
spacing: 5
|
||||
columns: root.width / root.cellWidth
|
||||
|
||||
Repeater {
|
||||
model: bundleCategoryTextures
|
||||
|
||||
delegate: ContentLibraryTexture {
|
||||
width: root.cellWidth
|
||||
height: root.cellHeight
|
||||
|
||||
onShowContextMenu: ctxMenu.popupMenu(modelData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: noMatchText
|
||||
text: qsTr("No match found.");
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
font.pixelSize: StudioTheme.Values.baseFontSize
|
||||
topPadding: 10
|
||||
leftPadding: 10
|
||||
visible: root.model.isEmpty && !searchBox.isEmpty() && !root.model.hasMaterialRoot
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,5 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
@@ -69,7 +47,7 @@ Dialog {
|
||||
text: qsTr("Remove")
|
||||
|
||||
onClicked: {
|
||||
materialBrowserBundleModel.removeFromProject(root.targetBundleMaterial)
|
||||
materialsModel.removeFromProject(root.targetBundleMaterial)
|
||||
root.accept()
|
||||
}
|
||||
}
|
||||
@@ -19,13 +19,12 @@ Item {
|
||||
function closeContextMenu()
|
||||
{
|
||||
ctxMenu.close()
|
||||
ctxMenuBundle.close()
|
||||
}
|
||||
|
||||
// Called from C++ to refresh a preview material after it changes
|
||||
function refreshPreview(idx)
|
||||
{
|
||||
var item = gridRepeater.itemAt(idx);
|
||||
var item = materialRepeater.itemAt(idx);
|
||||
if (item)
|
||||
item.refreshPreview();
|
||||
}
|
||||
@@ -36,6 +35,17 @@ Item {
|
||||
searchBox.clear();
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: focusGrabber
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onPressed: (mouse) => {
|
||||
forceActiveFocus() // Steal focus from name edit
|
||||
mouse.accepted = false
|
||||
}
|
||||
z: 1
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: rootMouseArea
|
||||
|
||||
@@ -44,12 +54,14 @@ Item {
|
||||
acceptedButtons: Qt.RightButton
|
||||
|
||||
onClicked: (mouse) => {
|
||||
// root context-menu works only for user materials
|
||||
var userMatsSecBottom = mapFromItem(userMaterialsSection, 0, userMaterialsSection.y).y
|
||||
+ userMaterialsSection.height;
|
||||
if (materialBrowserModel.hasMaterialRoot || !materialBrowserModel.hasQuick3DImport)
|
||||
return;
|
||||
|
||||
var matsSecBottom = mapFromItem(materialsSection, 0, materialsSection.y).y
|
||||
+ materialsSection.height;
|
||||
|
||||
if (!materialBrowserModel.hasMaterialRoot && materialBrowserModel.hasQuick3DImport
|
||||
&& (!materialBrowserBundleModel.matBundleExists || mouse.y < userMatsSecBottom)) {
|
||||
&& mouse.y < matsSecBottom) {
|
||||
ctxMenu.popupMenu()
|
||||
}
|
||||
}
|
||||
@@ -63,7 +75,7 @@ Item {
|
||||
if (root.currMaterialItem)
|
||||
root.currMaterialItem.commitRename();
|
||||
|
||||
root.currMaterialItem = gridRepeater.itemAt(materialBrowserModel.selectedIndex);
|
||||
root.currMaterialItem = materialRepeater.itemAt(materialBrowserModel.selectedIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,19 +83,6 @@ Item {
|
||||
id: ctxMenu
|
||||
}
|
||||
|
||||
MaterialBundleContextMenu {
|
||||
id: ctxMenuBundle
|
||||
|
||||
onUnimport: (bundleMat) => {
|
||||
unimportBundleMaterialDialog.targetBundleMaterial = bundleMat
|
||||
unimportBundleMaterialDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
UnimportBundleMaterialDialog {
|
||||
id: unimportBundleMaterialDialog
|
||||
}
|
||||
|
||||
Column {
|
||||
id: col
|
||||
y: 5
|
||||
@@ -100,19 +99,6 @@ Item {
|
||||
|
||||
onSearchChanged: (searchText) => {
|
||||
rootView.handleSearchFilterChanged(searchText)
|
||||
|
||||
// make sure searched categories that have matches are expanded
|
||||
if (!materialBrowserModel.isEmpty && !userMaterialsSection.expanded)
|
||||
userMaterialsSection.expanded = true
|
||||
|
||||
if (!materialBrowserBundleModel.isEmpty && !bundleMaterialsSection.expanded)
|
||||
bundleMaterialsSection.expanded = true
|
||||
|
||||
for (let i = 0; i < bundleMaterialsSectionRepeater.count; ++i) {
|
||||
let sec = bundleMaterialsSectionRepeater.itemAt(i)
|
||||
if (sec.visible && !sec.expanded)
|
||||
sec.expanded = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,29 +142,28 @@ Item {
|
||||
height: root.height - searchBox.height
|
||||
clip: true
|
||||
visible: materialBrowserModel.hasQuick3DImport && !materialBrowserModel.hasMaterialRoot
|
||||
interactive: !ctxMenu.opened && !ctxMenuBundle.opened
|
||||
interactive: !ctxMenu.opened
|
||||
|
||||
Column {
|
||||
Section {
|
||||
id: userMaterialsSection
|
||||
id: materialsSection
|
||||
|
||||
width: root.width
|
||||
caption: qsTr("Materials")
|
||||
hideHeader: !materialBrowserBundleModel.matBundleExists
|
||||
dropEnabled: true
|
||||
|
||||
onDropEnter: (drag) => {
|
||||
drag.accepted = rootView.draggedBundleMaterial
|
||||
userMaterialsSection.highlight = rootView.draggedBundleMaterial
|
||||
drag.accepted = drag.formats[0] === "application/vnd.qtdesignstudio.bundlematerial"
|
||||
materialsSection.highlight = drag.accepted
|
||||
}
|
||||
|
||||
onDropExit: {
|
||||
userMaterialsSection.highlight = false
|
||||
materialsSection.highlight = false
|
||||
}
|
||||
|
||||
onDrop: {
|
||||
userMaterialsSection.highlight = false
|
||||
materialBrowserBundleModel.addToProject(rootView.draggedBundleMaterial)
|
||||
materialsSection.highlight = false
|
||||
rootView.acceptBundleMaterialDrop()
|
||||
}
|
||||
|
||||
Grid {
|
||||
@@ -191,7 +176,7 @@ Item {
|
||||
columns: root.width / root.cellWidth
|
||||
|
||||
Repeater {
|
||||
id: gridRepeater
|
||||
id: materialRepeater
|
||||
|
||||
model: materialBrowserModel
|
||||
delegate: MaterialItem {
|
||||
@@ -226,30 +211,10 @@ Item {
|
||||
}
|
||||
|
||||
Section {
|
||||
id: bundleMaterialsSection
|
||||
id: texturesSection
|
||||
|
||||
width: root.width
|
||||
caption: qsTr("Material Library")
|
||||
addTopPadding: noMatchText.visible
|
||||
visible: materialBrowserBundleModel.matBundleExists
|
||||
|
||||
Column {
|
||||
Repeater {
|
||||
id: bundleMaterialsSectionRepeater
|
||||
|
||||
model: materialBrowserBundleModel
|
||||
|
||||
delegate: Section {
|
||||
width: root.width
|
||||
caption: bundleCategoryName
|
||||
addTopPadding: false
|
||||
sectionBackgroundColor: "transparent"
|
||||
visible: bundleCategoryVisible
|
||||
expanded: bundleCategoryExpanded
|
||||
expandOnClick: false
|
||||
onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
|
||||
onExpand: bundleCategoryExpanded = true
|
||||
onCollapse: bundleCategoryExpanded = false
|
||||
caption: qsTr("Textures")
|
||||
|
||||
Grid {
|
||||
width: scrollView.width
|
||||
@@ -259,29 +224,37 @@ Item {
|
||||
columns: root.width / root.cellWidth
|
||||
|
||||
Repeater {
|
||||
model: bundleCategoryMaterials
|
||||
id: texturesRepeater
|
||||
|
||||
delegate: BundleMaterialItem {
|
||||
model: materialBrowserTexturesModel
|
||||
delegate: TextureItem {
|
||||
width: root.cellWidth
|
||||
height: root.cellHeight
|
||||
height: root.cellWidth
|
||||
|
||||
onShowContextMenu: {
|
||||
ctxMenuBundle.popupMenu(modelData)
|
||||
}
|
||||
}
|
||||
// ctxMenuTexture.popupMenu(this, model) // TODO: implement textures context menu
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: noMatchText
|
||||
text: qsTr("No match found.");
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
font.pixelSize: StudioTheme.Values.baseFontSize
|
||||
leftPadding: 10
|
||||
visible: materialBrowserBundleModel.isEmpty && !searchBox.isEmpty() && !materialBrowserModel.hasMaterialRoot
|
||||
visible: materialBrowserModel.isEmpty && !searchBox.isEmpty() && !materialBrowserModel.hasMaterialRoot
|
||||
}
|
||||
|
||||
Text {
|
||||
text:qsTr("There are no texture in this project.")
|
||||
visible: materialBrowserTexturesModel.isEmpty && searchBox.isEmpty()
|
||||
textFormat: Text.RichText
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
font.pixelSize: StudioTheme.Values.mediumFontSize
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
wrapMode: Text.WordWrap
|
||||
width: root.width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,27 +1,5 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick
|
||||
import HelperWidgets
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Creator.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.15
|
||||
import HelperWidgets 2.0
|
||||
import StudioControls 1.0 as StudioControls
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
|
||||
StudioControls.Menu {
|
||||
id: root
|
||||
|
||||
property var targetMaterial: null
|
||||
signal unimport(var bundleMat);
|
||||
|
||||
function popupMenu(targetMaterial = null)
|
||||
{
|
||||
this.targetMaterial = targetMaterial
|
||||
popup()
|
||||
}
|
||||
|
||||
closePolicy: StudioControls.Menu.CloseOnEscape | StudioControls.Menu.CloseOnPressOutside
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("Apply to selected (replace)")
|
||||
enabled: root.targetMaterial && materialBrowserModel.hasModelSelection
|
||||
onTriggered: materialBrowserBundleModel.applyToSelected(root.targetMaterial, false)
|
||||
}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
text: qsTr("Apply to selected (add)")
|
||||
enabled: root.targetMaterial && materialBrowserModel.hasModelSelection
|
||||
onTriggered: materialBrowserBundleModel.applyToSelected(root.targetMaterial, true)
|
||||
}
|
||||
|
||||
StudioControls.MenuSeparator {}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
enabled: !materialBrowserBundleModel.importerRunning
|
||||
text: qsTr("Add an instance to project")
|
||||
|
||||
onTriggered: {
|
||||
materialBrowserBundleModel.addToProject(root.targetMaterial)
|
||||
}
|
||||
}
|
||||
|
||||
StudioControls.MenuItem {
|
||||
enabled: !materialBrowserBundleModel.importerRunning && root.targetMaterial.bundleMaterialImported
|
||||
text: qsTr("Remove from project")
|
||||
|
||||
onTriggered: root.unimport(root.targetMaterial);
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ Rectangle {
|
||||
matName.readOnly = false
|
||||
matName.selectAll()
|
||||
matName.forceActiveFocus()
|
||||
matName.ensureVisible(matName.text.length)
|
||||
nameMouseArea.enabled = false
|
||||
}
|
||||
|
||||
@@ -31,10 +32,8 @@ Rectangle {
|
||||
if (matName.readOnly)
|
||||
return;
|
||||
|
||||
matName.readOnly = true
|
||||
nameMouseArea.enabled = true
|
||||
|
||||
materialBrowserModel.renameMaterial(index, matName.text);
|
||||
mouseArea.forceActiveFocus()
|
||||
}
|
||||
|
||||
border.width: materialBrowserModel.selectedIndex === index ? 1 : 0
|
||||
@@ -102,6 +101,16 @@ Rectangle {
|
||||
|
||||
onEditingFinished: root.commitRename()
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if (!activeFocus) {
|
||||
matName.readOnly = true
|
||||
nameMouseArea.enabled = true
|
||||
ensureVisible(0)
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: ensureVisible(0)
|
||||
|
||||
MouseArea {
|
||||
id: nameMouseArea
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuickDesignerTheme
|
||||
import HelperWidgets
|
||||
import StudioTheme as StudioTheme
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
visible: textureVisible
|
||||
|
||||
color: "transparent"
|
||||
border.width: materialBrowserTexturesModel.selectedIndex === index ? 1 : 0
|
||||
border.color: materialBrowserTexturesModel.selectedIndex === index
|
||||
? StudioTheme.Values.themeControlOutlineInteraction
|
||||
: "transparent"
|
||||
|
||||
signal showContextMenu()
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onPressed: (mouse) => {
|
||||
materialBrowserTexturesModel.selectTexture(index)
|
||||
|
||||
if (mouse.button === Qt.LeftButton)
|
||||
rootView.startDragTexture(index, mapToGlobal(mouse.x, mouse.y))
|
||||
else if (mouse.button === Qt.RightButton)
|
||||
root.showContextMenu()
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
source: textureSource
|
||||
sourceSize.width: root.width - 10
|
||||
sourceSize.height: root.height - 10
|
||||
anchors.centerIn: parent
|
||||
cache: false
|
||||
}
|
||||
}
|
||||
@@ -85,10 +85,11 @@ Column {
|
||||
CheckBox {
|
||||
text: backendValues.indeterminate.valueToString
|
||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||
+ StudioTheme.Values.actionIndicatorWidt
|
||||
+ StudioTheme.Values.actionIndicatorWidth
|
||||
backendValue: backendValues.indeterminate
|
||||
enabled: backendValue.isAvailable
|
||||
}
|
||||
ExpandingSpacer {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ T.CheckBox {
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: StudioTheme.Values.checkBoxSpacing
|
||||
spacing: checkBoxLabel.visible ? StudioTheme.Values.checkBoxSpacing : 0
|
||||
hoverEnabled: true
|
||||
activeFocusOnTab: false
|
||||
|
||||
@@ -85,7 +85,7 @@ T.CheckBox {
|
||||
text: myCheckBox.text
|
||||
font: myCheckBox.font
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
visible: text !== ""
|
||||
visible: checkBoxLabel.text !== ""
|
||||
}
|
||||
|
||||
states: [
|
||||
|
||||
@@ -19,10 +19,14 @@ T.SpinBox {
|
||||
|
||||
property bool edit: spinBoxInput.activeFocus
|
||||
// This property is used to indicate the global hover state
|
||||
property bool hover: (mySpinBox.hovered || actionIndicator.hover) && mySpinBox.enabled
|
||||
property bool hover: (spinBoxInput.hover || actionIndicator.hover || spinBoxIndicatorUp.hover
|
||||
|| spinBoxIndicatorDown.hover || sliderIndicator.hover)
|
||||
&& mySpinBox.enabled
|
||||
property bool drag: false
|
||||
property bool sliderDrag: sliderPopup.drag
|
||||
|
||||
property bool dirty: false // user modification flag
|
||||
|
||||
property alias actionIndicatorVisible: actionIndicator.visible
|
||||
property real __actionIndicatorWidth: StudioTheme.Values.actionIndicatorWidth
|
||||
property real __actionIndicatorHeight: StudioTheme.Values.actionIndicatorHeight
|
||||
@@ -35,12 +39,22 @@ T.SpinBox {
|
||||
property real __sliderIndicatorWidth: StudioTheme.Values.sliderIndicatorWidth
|
||||
property real __sliderIndicatorHeight: StudioTheme.Values.sliderIndicatorHeight
|
||||
|
||||
property alias __devicePixelRatio: spinBoxInput.devicePixelRatio
|
||||
property alias pixelsPerUnit: spinBoxInput.pixelsPerUnit
|
||||
|
||||
property alias compressedValueTimer: myTimer
|
||||
|
||||
property string preFocusText: ""
|
||||
|
||||
signal compressedValueModified
|
||||
signal dragStarted
|
||||
signal dragEnded
|
||||
signal dragging
|
||||
|
||||
// Use custom wheel handling due to bugs
|
||||
property bool __wheelEnabled: false
|
||||
wheelEnabled: false
|
||||
hoverEnabled: true // TODO
|
||||
hoverEnabled: true
|
||||
|
||||
width: StudioTheme.Values.defaultControlWidth
|
||||
height: StudioTheme.Values.defaultControlHeight
|
||||
@@ -82,12 +96,11 @@ T.SpinBox {
|
||||
myControl: mySpinBox
|
||||
iconFlip: -1
|
||||
visible: mySpinBox.spinBoxIndicatorVisible
|
||||
//hover: mySpinBox.up.hovered // TODO QTBUG-74688
|
||||
pressed: mySpinBox.up.pressed
|
||||
x: actionIndicator.width + StudioTheme.Values.border
|
||||
y: StudioTheme.Values.border
|
||||
width: spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorWidth : 0
|
||||
height: spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorHeight : 0
|
||||
width: mySpinBox.spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorWidth : 0
|
||||
height: mySpinBox.spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorHeight : 0
|
||||
|
||||
enabled: (mySpinBox.from < mySpinBox.to) ? mySpinBox.value < mySpinBox.to
|
||||
: mySpinBox.value > mySpinBox.to
|
||||
@@ -97,12 +110,11 @@ T.SpinBox {
|
||||
id: spinBoxIndicatorDown
|
||||
myControl: mySpinBox
|
||||
visible: mySpinBox.spinBoxIndicatorVisible
|
||||
//hover: mySpinBox.down.hovered // TODO QTBUG-74688
|
||||
pressed: mySpinBox.down.pressed
|
||||
x: actionIndicator.width + StudioTheme.Values.border
|
||||
y: spinBoxIndicatorUp.y + spinBoxIndicatorUp.height
|
||||
width: spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorWidth : 0
|
||||
height: spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorHeight : 0
|
||||
width: mySpinBox.spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorWidth : 0
|
||||
height: mySpinBox.spinBoxIndicatorVisible ? mySpinBox.__spinBoxIndicatorHeight : 0
|
||||
|
||||
enabled: (mySpinBox.from < mySpinBox.to) ? mySpinBox.value > mySpinBox.from
|
||||
: mySpinBox.value < mySpinBox.from
|
||||
@@ -111,6 +123,23 @@ T.SpinBox {
|
||||
contentItem: SpinBoxInput {
|
||||
id: spinBoxInput
|
||||
myControl: mySpinBox
|
||||
|
||||
function handleEditingFinished() {
|
||||
mySpinBox.focus = false
|
||||
|
||||
// Keep the dirty state before calling setValueFromInput(),
|
||||
// it will be set to false (cleared) internally
|
||||
var valueModified = mySpinBox.dirty
|
||||
|
||||
mySpinBox.setValueFromInput()
|
||||
myTimer.stop()
|
||||
|
||||
// Only trigger the signal, if the value was modified
|
||||
if (valueModified)
|
||||
mySpinBox.compressedValueModified()
|
||||
}
|
||||
|
||||
onEditingFinished: spinBoxInput.handleEditingFinished()
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
@@ -216,7 +245,7 @@ T.SpinBox {
|
||||
id: myTimer
|
||||
repeat: false
|
||||
running: false
|
||||
interval: 100
|
||||
interval: 400
|
||||
onTriggered: mySpinBox.compressedValueModified()
|
||||
}
|
||||
|
||||
@@ -224,9 +253,10 @@ T.SpinBox {
|
||||
onFocusChanged: mySpinBox.setValueFromInput()
|
||||
onDisplayTextChanged: spinBoxInput.text = mySpinBox.displayText
|
||||
onActiveFocusChanged: {
|
||||
if (mySpinBox.activeFocus)
|
||||
// QTBUG-75862 && mySpinBox.focusReason === Qt.TabFocusReason)
|
||||
if (mySpinBox.activeFocus) { // QTBUG-75862 && mySpinBox.focusReason === Qt.TabFocusReason)
|
||||
mySpinBox.preFocusText = spinBoxInput.text
|
||||
spinBoxInput.selectAll()
|
||||
}
|
||||
|
||||
if (sliderPopup.opened && !mySpinBox.activeFocus)
|
||||
sliderPopup.close()
|
||||
@@ -265,8 +295,11 @@ T.SpinBox {
|
||||
mySpinBox.stepSize = currStepSize
|
||||
}
|
||||
|
||||
if (event.key === Qt.Key_Escape)
|
||||
mySpinBox.focus = false
|
||||
if (event.key === Qt.Key_Escape) {
|
||||
spinBoxInput.text = mySpinBox.preFocusText
|
||||
mySpinBox.dirty = true
|
||||
spinBoxInput.handleEditingFinished()
|
||||
}
|
||||
|
||||
// FIX: This is a temporary fix for QTBUG-74239
|
||||
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
|
||||
@@ -274,13 +307,13 @@ T.SpinBox {
|
||||
}
|
||||
|
||||
function clamp(v, lo, hi) {
|
||||
if (v < lo || v > hi)
|
||||
return Math.min(Math.max(lo, v), hi)
|
||||
|
||||
return v
|
||||
return (v < lo || v > hi) ? Math.min(Math.max(lo, v), hi) : v
|
||||
}
|
||||
|
||||
function setValueFromInput() {
|
||||
if (!mySpinBox.dirty)
|
||||
return
|
||||
|
||||
// FIX: This is a temporary fix for QTBUG-74239
|
||||
var currValue = mySpinBox.value
|
||||
|
||||
@@ -298,5 +331,7 @@ T.SpinBox {
|
||||
|
||||
if (mySpinBox.value !== currValue)
|
||||
mySpinBox.valueModified()
|
||||
|
||||
mySpinBox.dirty = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ TextInput {
|
||||
property bool drag: false
|
||||
property bool hover: mouseArea.containsMouse && textInput.enabled
|
||||
|
||||
property int devicePixelRatio: 1
|
||||
property int pixelsPerUnit: 10
|
||||
|
||||
z: 2
|
||||
font: myControl.font
|
||||
color: StudioTheme.Values.themeTextColor
|
||||
@@ -75,38 +78,197 @@ TextInput {
|
||||
}
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
id: tapHandler
|
||||
acceptedDevices: PointerDevice.Mouse
|
||||
enabled: true
|
||||
onTapped: {
|
||||
textInput.forceActiveFocus()
|
||||
textInput.deselect() // QTBUG-75862
|
||||
Item {
|
||||
id: dragModifierWorkaround
|
||||
Keys.onPressed: function(event) {
|
||||
event.accepted = true
|
||||
|
||||
if (event.modifiers & Qt.ControlModifier) {
|
||||
mouseArea.stepSize = myControl.minStepSize
|
||||
mouseArea.calcValue()
|
||||
}
|
||||
|
||||
if (event.modifiers & Qt.ShiftModifier) {
|
||||
mouseArea.stepSize = myControl.maxStepSize
|
||||
mouseArea.calcValue()
|
||||
}
|
||||
}
|
||||
Keys.onReleased: function(event) {
|
||||
event.accepted = true
|
||||
mouseArea.stepSize = myControl.realStepSize
|
||||
mouseArea.calcValue()
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that we get Up and Down key press events first
|
||||
Keys.onShortcutOverride: function(event) {
|
||||
event.accepted = (event.key === Qt.Key_Up || event.key === Qt.Key_Down)
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
property real stepSize: myControl.stepSize
|
||||
|
||||
// Properties to store the state of a drag operation
|
||||
property bool dragging: false
|
||||
property bool hasDragged: false
|
||||
property bool potentialDragStart: false
|
||||
|
||||
property int initialValue: myControl.value // value on drag operation starts
|
||||
|
||||
property int pressStartX: 0
|
||||
property int dragStartX: 0
|
||||
property int translationX: 0
|
||||
|
||||
property int dragDirection: 0
|
||||
property int totalUnits: 0 // total number of units dragged
|
||||
property int units: 0
|
||||
|
||||
property real __pixelsPerUnit: textInput.devicePixelRatio * textInput.pixelsPerUnit
|
||||
|
||||
anchors.fill: parent
|
||||
enabled: true
|
||||
hoverEnabled: true
|
||||
propagateComposedEvents: true
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onPressed: function(mouse) { mouse.accepted = false }
|
||||
onWheel: function(wheel) {
|
||||
if (!myControl.__wheelEnabled)
|
||||
preventStealing: true
|
||||
|
||||
onPositionChanged: function(mouse) {
|
||||
if (!mouseArea.dragging
|
||||
&& !myControl.edit
|
||||
&& Math.abs(mouseArea.pressStartX - mouse.x) > StudioTheme.Values.dragThreshold
|
||||
&& mouse.buttons === Qt.LeftButton
|
||||
&& mouseArea.potentialDragStart) {
|
||||
mouseArea.dragging = true
|
||||
mouseArea.potentialDragStart = false
|
||||
mouseArea.initialValue = myControl.value
|
||||
mouseArea.cursorShape = Qt.ClosedHandCursor
|
||||
mouseArea.dragStartX = mouse.x
|
||||
|
||||
myControl.drag = true
|
||||
myControl.dragStarted()
|
||||
// Force focus on the non visible component to receive key events
|
||||
dragModifierWorkaround.forceActiveFocus()
|
||||
textInput.deselect()
|
||||
}
|
||||
|
||||
if (!mouseArea.dragging)
|
||||
return
|
||||
|
||||
mouse.accepted = true
|
||||
|
||||
var translationX = mouse.x - mouseArea.dragStartX
|
||||
|
||||
// Early return if mouse didn't move along x-axis
|
||||
if (translationX === 0)
|
||||
return
|
||||
|
||||
var currentDragDirection = Math.sign(translationX)
|
||||
|
||||
// Has drag direction changed
|
||||
if (currentDragDirection !== mouseArea.dragDirection) {
|
||||
mouseArea.translationX = 0
|
||||
mouseArea.dragDirection = currentDragDirection
|
||||
mouseArea.totalUnits = mouseArea.units
|
||||
}
|
||||
|
||||
mouseArea.translationX += translationX
|
||||
mouseArea.calcValue()
|
||||
//myControl.realValueModified()
|
||||
}
|
||||
|
||||
onClicked: function(mouse) {
|
||||
if (textInput.edit)
|
||||
mouse.accepted = false
|
||||
|
||||
if (mouseArea.hasDragged) {
|
||||
mouseArea.hasDragged = false
|
||||
return
|
||||
}
|
||||
|
||||
textInput.forceActiveFocus()
|
||||
textInput.deselect() // QTBUG-75862
|
||||
}
|
||||
|
||||
onPressed: function(mouse) {
|
||||
if (textInput.edit)
|
||||
mouse.accepted = false
|
||||
|
||||
mouseArea.potentialDragStart = true
|
||||
mouseArea.pressStartX = mouse.x
|
||||
}
|
||||
|
||||
onReleased: function(mouse) {
|
||||
if (textInput.edit)
|
||||
mouse.accepted = false
|
||||
|
||||
mouseArea.endDrag()
|
||||
}
|
||||
|
||||
function endDrag() {
|
||||
if (!mouseArea.dragging)
|
||||
return
|
||||
|
||||
mouseArea.dragging = false
|
||||
mouseArea.hasDragged = true
|
||||
|
||||
if (myControl.compressedValueTimer.running) {
|
||||
myControl.compressedValueTimer.stop()
|
||||
mouseArea.calcValue()
|
||||
myControl.compressedValueModified()
|
||||
}
|
||||
mouseArea.cursorShape = Qt.PointingHandCursor
|
||||
myControl.drag = false
|
||||
myControl.dragEnded()
|
||||
// Avoid active focus on the component after dragging
|
||||
dragModifierWorkaround.focus = false
|
||||
textInput.focus = false
|
||||
myControl.focus = false
|
||||
|
||||
mouseArea.translationX = 0
|
||||
mouseArea.units = 0
|
||||
mouseArea.totalUnits = 0
|
||||
}
|
||||
|
||||
function calcValue() {
|
||||
var minUnit = (myControl.from - mouseArea.initialValue) / mouseArea.stepSize
|
||||
var maxUnit = (myControl.to - mouseArea.initialValue) / mouseArea.stepSize
|
||||
|
||||
var units = Math.trunc(mouseArea.translationX / mouseArea.__pixelsPerUnit)
|
||||
mouseArea.units = Math.min(Math.max(mouseArea.totalUnits + units, minUnit), maxUnit)
|
||||
myControl.value = mouseArea.initialValue + (mouseArea.units * mouseArea.stepSize)
|
||||
|
||||
if (mouseArea.dragging)
|
||||
myControl.dragging()
|
||||
}
|
||||
|
||||
onWheel: function(wheel) {
|
||||
if (!myControl.__wheelEnabled) {
|
||||
wheel.accepted = false
|
||||
return
|
||||
}
|
||||
|
||||
// Set stepSize according to used modifier key
|
||||
if (wheel.modifiers & Qt.ControlModifier)
|
||||
mouseArea.stepSize = myControl.minStepSize
|
||||
|
||||
if (wheel.modifiers & Qt.ShiftModifier)
|
||||
mouseArea.stepSize = myControl.maxStepSize
|
||||
|
||||
var val = myControl.valueFromText(textInput.text, myControl.locale)
|
||||
if (myControl.value !== val)
|
||||
myControl.value = val
|
||||
|
||||
var currValue = myControl.value
|
||||
myControl.value += wheel.angleDelta.y / 120
|
||||
myControl.value += (wheel.angleDelta.y / 120 * mouseArea.stepSize)
|
||||
|
||||
if (currValue !== myControl.value)
|
||||
myControl.valueModified()
|
||||
|
||||
// Reset stepSize
|
||||
mouseArea.stepSize = myControl.stepSize
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,14 +281,6 @@ TextInput {
|
||||
target: textInputBackground
|
||||
color: StudioTheme.Values.themeControlBackground
|
||||
}
|
||||
PropertyChanges {
|
||||
target: dragHandler
|
||||
enabled: true
|
||||
}
|
||||
PropertyChanges {
|
||||
target: tapHandler
|
||||
enabled: true
|
||||
}
|
||||
PropertyChanges {
|
||||
target: mouseArea
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
@@ -156,14 +310,6 @@ TextInput {
|
||||
target: textInputBackground
|
||||
color: StudioTheme.Values.themeControlBackgroundInteraction
|
||||
}
|
||||
PropertyChanges {
|
||||
target: dragHandler
|
||||
enabled: false
|
||||
}
|
||||
PropertyChanges {
|
||||
target: tapHandler
|
||||
enabled: false
|
||||
}
|
||||
PropertyChanges {
|
||||
target: mouseArea
|
||||
cursorShape: Qt.IBeamCursor
|
||||
|
||||
@@ -13,6 +13,7 @@ QtObject {
|
||||
property real mediumFont: 14
|
||||
property real bigFont: 16
|
||||
property real baseIconFont: 12
|
||||
property real mediumIconFont: 18
|
||||
property real bigIconFont: 26
|
||||
|
||||
property real scaleFactor: 1.0
|
||||
@@ -24,6 +25,7 @@ QtObject {
|
||||
property real bigFontSize: Math.round(values.bigFont * values.scaleFactor)
|
||||
property real baseIconFontSize: Math.round(values.baseIconFont * values.scaleFactor)
|
||||
property real myIconFontSize: values.baseIconFontSize; // TODO: rename all refs to myIconFontSize -> baseIconFontSize then remove myIconFontSize
|
||||
property real mediumIconFontSize: Math.round(values.mediumIconFont * values.scaleFactor)
|
||||
property real bigIconFontSize: Math.round(values.bigIconFont * values.scaleFactor)
|
||||
|
||||
property real squareComponentWidth: values.height
|
||||
|
||||
23352
src/libs/3rdparty/json/json.hpp
vendored
@@ -15,6 +15,7 @@ add_subdirectory(glsl)
|
||||
add_subdirectory(languageserverprotocol)
|
||||
add_subdirectory(sqlite)
|
||||
add_subdirectory(tracing)
|
||||
add_subdirectory(qmlpuppetcommunication)
|
||||
|
||||
add_subdirectory(qtcreatorcdbext)
|
||||
|
||||
|
||||
1
src/libs/qmlpuppetcommunication/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
include(QmlPuppetCommunication.cmake)
|
||||
87
src/libs/qmlpuppetcommunication/QmlPuppetCommunication.cmake
Normal file
@@ -0,0 +1,87 @@
|
||||
add_qtc_library(QmlPuppetCommunication STATIC
|
||||
PROPERTIES AUTOUIC OFF
|
||||
DEPENDS Qt5::Core Qt5::CorePrivate Qt5::Gui
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlPuppetCommunication
|
||||
CONDITION TARGET Nanotrace
|
||||
PUBLIC_DEPENDS Nanotrace
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlPuppetCommunication
|
||||
PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR}/types
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/types
|
||||
SOURCES
|
||||
enumeration.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlPuppetCommunication
|
||||
PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR}/interfaces
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/interfaces
|
||||
SOURCES
|
||||
commondefines.h
|
||||
nodeinstanceclientinterface.h
|
||||
nodeinstanceserverinterface.cpp nodeinstanceserverinterface.h
|
||||
nodeinstanceglobal.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlPuppetCommunication
|
||||
PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR}/container
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/container
|
||||
SOURCES
|
||||
addimportcontainer.cpp addimportcontainer.h
|
||||
idcontainer.cpp idcontainer.h
|
||||
imagecontainer.cpp imagecontainer.h
|
||||
informationcontainer.cpp informationcontainer.h
|
||||
instancecontainer.cpp instancecontainer.h
|
||||
mockuptypecontainer.cpp mockuptypecontainer.h
|
||||
propertyabstractcontainer.cpp propertyabstractcontainer.h
|
||||
propertybindingcontainer.cpp propertybindingcontainer.h
|
||||
propertyvaluecontainer.cpp propertyvaluecontainer.h
|
||||
reparentcontainer.cpp reparentcontainer.h
|
||||
sharedmemory.h
|
||||
$<IF:$<BOOL:${UNIX}>,sharedmemory_unix.cpp,sharedmemory_qt.cpp>
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlPuppetCommunication
|
||||
PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR}/commands
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/commands
|
||||
SOURCES
|
||||
captureddatacommand.h
|
||||
changeauxiliarycommand.cpp changeauxiliarycommand.h
|
||||
changebindingscommand.cpp changebindingscommand.h
|
||||
changefileurlcommand.cpp changefileurlcommand.h
|
||||
changeidscommand.cpp changeidscommand.h
|
||||
changelanguagecommand.cpp changelanguagecommand.h
|
||||
changenodesourcecommand.cpp changenodesourcecommand.h
|
||||
changepreviewimagesizecommand.cpp changepreviewimagesizecommand.h
|
||||
changeselectioncommand.cpp changeselectioncommand.h
|
||||
changestatecommand.cpp changestatecommand.h
|
||||
changevaluescommand.cpp changevaluescommand.h
|
||||
childrenchangedcommand.cpp childrenchangedcommand.h
|
||||
clearscenecommand.cpp clearscenecommand.h
|
||||
completecomponentcommand.cpp completecomponentcommand.h
|
||||
componentcompletedcommand.cpp componentcompletedcommand.h
|
||||
createinstancescommand.cpp createinstancescommand.h
|
||||
createscenecommand.cpp createscenecommand.h
|
||||
debugoutputcommand.cpp debugoutputcommand.h
|
||||
endpuppetcommand.cpp endpuppetcommand.h
|
||||
informationchangedcommand.cpp informationchangedcommand.h
|
||||
inputeventcommand.cpp inputeventcommand.h
|
||||
nanotracecommand.cpp nanotracecommand.h
|
||||
pixmapchangedcommand.cpp pixmapchangedcommand.h
|
||||
puppetalivecommand.cpp puppetalivecommand.h
|
||||
puppettocreatorcommand.cpp puppettocreatorcommand.h
|
||||
removeinstancescommand.cpp removeinstancescommand.h
|
||||
removepropertiescommand.cpp removepropertiescommand.h
|
||||
removesharedmemorycommand.cpp removesharedmemorycommand.h
|
||||
reparentinstancescommand.cpp reparentinstancescommand.h
|
||||
requestmodelnodepreviewimagecommand.cpp requestmodelnodepreviewimagecommand.h
|
||||
scenecreatedcommand.h
|
||||
statepreviewimagechangedcommand.cpp statepreviewimagechangedcommand.h
|
||||
synchronizecommand.h
|
||||
tokencommand.cpp tokencommand.h
|
||||
update3dviewstatecommand.cpp update3dviewstatecommand.h
|
||||
valueschangedcommand.cpp valueschangedcommand.h
|
||||
view3dactioncommand.cpp view3dactioncommand.h
|
||||
)
|
||||