mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:49:12 +02:00
Tablet and desktop versions of attachment model browser dialog
This commit is contained in:
parent
d261e48b9d
commit
ffbb04d3bc
4 changed files with 179 additions and 80 deletions
36
interface/resources/qml/hifi/dialogs/ModelBrowserDialog.qml
Normal file
36
interface/resources/qml/hifi/dialogs/ModelBrowserDialog.qml
Normal file
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// ModelBrowserDialog.qml
|
||||
//
|
||||
// Created by David Rowe on 11 Mar 2017.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import "../../windows"
|
||||
import "content"
|
||||
|
||||
ScrollingWindow {
|
||||
id: root
|
||||
objectName: "ModelBrowserDialog"
|
||||
title: "Attachment Model"
|
||||
resizable: true
|
||||
width: 600
|
||||
height: 480
|
||||
closable: false
|
||||
|
||||
//HifiConstants { id: hifi }
|
||||
|
||||
property var result
|
||||
|
||||
signal selected(var modelUrl)
|
||||
signal canceled()
|
||||
|
||||
ModelBrowserContent {
|
||||
id: modelBrowserContent
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import Qt.labs.settings 1.0
|
|||
|
||||
import "."
|
||||
import ".."
|
||||
import "../../tablet"
|
||||
import "../../../styles-uit"
|
||||
import "../../../controls-uit" as HifiControls
|
||||
import "../../../windows"
|
||||
|
@ -76,12 +77,24 @@ Item {
|
|||
id: modelBrowserBuilder;
|
||||
ModelBrowserDialog {}
|
||||
}
|
||||
Component {
|
||||
id: tabletModelBrowserBuilder;
|
||||
TabletModelBrowserDialog {}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
var browser = modelBrowserBuilder.createObject(desktop);
|
||||
var browser;
|
||||
if (typeof desktop !== "undefined") {
|
||||
browser = modelBrowserBuilder.createObject(desktop);
|
||||
browser.selected.connect(function(newModelUrl){
|
||||
modelUrl.text = newModelUrl;
|
||||
})
|
||||
});
|
||||
} else {
|
||||
browser = tabletModelBrowserBuilder.createObject(tabletRoot);
|
||||
browser.selected.connect(function(newModelUrl){
|
||||
modelUrl.text = newModelUrl;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,29 +1,7 @@
|
|||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.XmlListModel 2.0
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
import "../../windows"
|
||||
import "../../js/Utils.js" as Utils
|
||||
import "../models"
|
||||
|
||||
import "../../styles-uit"
|
||||
import "../../controls-uit" as HifiControls
|
||||
import "../../windows"
|
||||
|
||||
ScrollingWindow {
|
||||
id: root
|
||||
resizable: true
|
||||
width: 600
|
||||
height: 480
|
||||
closable: false
|
||||
|
||||
property var result;
|
||||
|
||||
signal selected(var modelUrl);
|
||||
signal canceled();
|
||||
|
||||
HifiConstants {id: hifi}
|
||||
import "../../../controls-uit" as HifiControls
|
||||
|
||||
Column {
|
||||
width: pane.contentWidth
|
||||
|
@ -31,7 +9,6 @@ ScrollingWindow {
|
|||
Rectangle {
|
||||
width: parent.width
|
||||
height: root.height - (keyboardEnabled && keyboardRaised ? 200 : 0)
|
||||
radius: 4
|
||||
color: hifi.colors.baseGray
|
||||
|
||||
HifiControls.TextField {
|
||||
|
@ -85,8 +62,3 @@ ScrollingWindow {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
//
|
||||
// TabletModelBrowserDialog.qml
|
||||
//
|
||||
// Created by David Rowe on 11 Mar 2017.
|
||||
// Copyright 2017 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import "../../styles-uit"
|
||||
import "../dialogs/content"
|
||||
|
||||
Item {
|
||||
id: root
|
||||
objectName: "ModelBrowserDialog"
|
||||
|
||||
property string title: "Attachment Model"
|
||||
|
||||
property var result
|
||||
|
||||
signal selected(var modelUrl)
|
||||
signal canceled()
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle {
|
||||
id: pane // Surrogate for ScrollingWindow's pane.
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
anchors.topMargin: 90 // Space for header.
|
||||
|
||||
// FIXME: Refactor with other tablet headers.
|
||||
Rectangle {
|
||||
id: header
|
||||
height: 90
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.top
|
||||
}
|
||||
z: 100
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "#2b2b2b"
|
||||
}
|
||||
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: "#1e1e1e"
|
||||
}
|
||||
}
|
||||
|
||||
RalewayBold {
|
||||
text: title
|
||||
size: 26
|
||||
color: "#34a2c7"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: hifi.dimensions.contentMargin.x
|
||||
}
|
||||
}
|
||||
|
||||
ModelBrowserContent {
|
||||
anchors {
|
||||
top: header.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.top
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue