mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 05:52:38 +02:00
Dock it!
This commit is contained in:
parent
314c04ab96
commit
112e13383b
5 changed files with 149 additions and 27 deletions
|
@ -71,7 +71,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
onInventoryResult: {
|
||||
inventoryModel.handlePage(result.status !== "success" && result.message, result);
|
||||
avatarAppInventoryModel.handlePage(result.status !== "success" && result.message, result);
|
||||
root.updatePreviewUrl();
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ Rectangle {
|
|||
}
|
||||
|
||||
HifiModels.PSFListModel {
|
||||
id: inventoryModel
|
||||
id: avatarAppInventoryModel
|
||||
itemsPerPage: 4
|
||||
listModelName: 'inventory'
|
||||
listView: inventoryContentsList
|
||||
|
@ -150,8 +150,8 @@ Rectangle {
|
|||
editionFilter,
|
||||
primaryFilter,
|
||||
titleFilter,
|
||||
inventoryModel.currentPageToRetrieve,
|
||||
inventoryModel.itemsPerPage
|
||||
avatarAppInventoryModel.currentPageToRetrieve,
|
||||
avatarAppInventoryModel.itemsPerPage
|
||||
);
|
||||
}
|
||||
processPage: function(data) {
|
||||
|
@ -181,10 +181,10 @@ Rectangle {
|
|||
|
||||
ListView {
|
||||
id: inventoryContentsList
|
||||
visible: inventoryModel.count !== 0
|
||||
visible: avatarAppInventoryModel.count !== 0
|
||||
interactive: contentItem.height > height
|
||||
clip: true
|
||||
model: inventoryModel
|
||||
model: avatarAppInventoryModel
|
||||
anchors.fill: parent
|
||||
width: parent.width
|
||||
delegate: AvatarAppComponents.AvatarAppListDelegate {
|
||||
|
@ -200,15 +200,15 @@ Rectangle {
|
|||
|
||||
|
||||
function getInventory() {
|
||||
inventoryModel.getFirstPage();
|
||||
avatarAppInventoryModel.getFirstPage();
|
||||
}
|
||||
|
||||
function updatePreviewUrl() {
|
||||
var previewUrl = "";
|
||||
var downloadUrl = "";
|
||||
for (var i = 0; i < inventoryModel.count; ++i) {
|
||||
downloadUrl = inventoryModel.get(i).download_url;
|
||||
previewUrl = inventoryModel.get(i).preview;
|
||||
for (var i = 0; i < avatarAppInventoryModel.count; ++i) {
|
||||
downloadUrl = avatarAppInventoryModel.get(i).download_url;
|
||||
previewUrl = avatarAppInventoryModel.get(i).preview;
|
||||
if (MyAvatar.skeletonModelURL === downloadUrl) {
|
||||
avatarPreviewUrl = previewUrl;
|
||||
return;
|
||||
|
|
|
@ -14,6 +14,7 @@ import "../inputDeviceButton" as InputDeviceButton
|
|||
import stylesUit 1.0 as HifiStylesUit
|
||||
import TabletScriptingInterface 1.0
|
||||
import QtGraphicalEffects 1.0
|
||||
import "qrc:////qml//hifi//models" as HifiModels // Absolute path so the same code works everywhere.
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
@ -23,7 +24,94 @@ Rectangle {
|
|||
}
|
||||
|
||||
color: simplifiedUI.colors.darkBackground
|
||||
anchors.fill: parent;
|
||||
anchors.fill: parent
|
||||
|
||||
property bool inventoryFullyReceived: false
|
||||
|
||||
Component.onCompleted: {
|
||||
Commerce.getLoginStatus();
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: MyAvatar
|
||||
|
||||
onSkeletonModelURLChanged: {
|
||||
root.updatePreviewUrl();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: Commerce
|
||||
|
||||
onLoginStatusResult: {
|
||||
if (inventoryFullyReceived) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isLoggedIn) {
|
||||
Commerce.getWalletStatus();
|
||||
} else {
|
||||
// Show some error to the user
|
||||
}
|
||||
}
|
||||
|
||||
onWalletStatusResult: {
|
||||
if (inventoryFullyReceived) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (walletStatus === 5) {
|
||||
topBarInventoryModel.getFirstPage();
|
||||
} else {
|
||||
// Show some error to the user
|
||||
}
|
||||
}
|
||||
|
||||
onInventoryResult: {
|
||||
if (inventoryFullyReceived) {
|
||||
return;
|
||||
}
|
||||
|
||||
topBarInventoryModel.handlePage(result.status !== "success" && result.message, result);
|
||||
root.updatePreviewUrl();
|
||||
|
||||
// I _should_ be able to do `if (currentPageToRetrieve > -1)` here, but the
|
||||
// inventory endpoint doesn't return `response.total_pages`, so the PSFListModel doesn't
|
||||
// know when to automatically stop fetching new pages.
|
||||
// This will result in fetching one extra page than is necessary, but that's not a big deal.
|
||||
if (result.data.assets.length > 0) {
|
||||
topBarInventoryModel.getNextPage();
|
||||
} else {
|
||||
inventoryFullyReceived = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HifiModels.PSFListModel {
|
||||
id: topBarInventoryModel
|
||||
itemsPerPage: 8
|
||||
listModelName: 'inventory'
|
||||
getPage: function () {
|
||||
var editionFilter = "";
|
||||
var primaryFilter = "avatar";
|
||||
var titleFilter = "";
|
||||
|
||||
Commerce.inventory(
|
||||
editionFilter,
|
||||
primaryFilter,
|
||||
titleFilter,
|
||||
topBarInventoryModel.currentPageToRetrieve,
|
||||
topBarInventoryModel.itemsPerPage
|
||||
);
|
||||
}
|
||||
processPage: function(data) {
|
||||
data.assets.forEach(function (item) {
|
||||
if (item.status.length > 1) { console.warn("Unrecognized inventory status", item); }
|
||||
item.status = item.status[0];
|
||||
});
|
||||
return data.assets;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Item {
|
||||
|
@ -34,9 +122,18 @@ Rectangle {
|
|||
anchors.leftMargin: 16
|
||||
width: height
|
||||
|
||||
AnimatedImage {
|
||||
visible: avatarButtonImage.source === ""
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 10
|
||||
height: width
|
||||
source: "../images/loading.gif"
|
||||
}
|
||||
|
||||
Image {
|
||||
id: avatarButtonImage
|
||||
source: "images/defaultAvatar.jpg"
|
||||
visible: source !== ""
|
||||
source: ""
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 10
|
||||
height: width
|
||||
|
@ -215,6 +312,20 @@ Rectangle {
|
|||
}
|
||||
|
||||
|
||||
function updatePreviewUrl() {
|
||||
var previewUrl = "";
|
||||
var downloadUrl = "";
|
||||
for (var i = 0; i < topBarInventoryModel.count; ++i) {
|
||||
downloadUrl = topBarInventoryModel.get(i).download_url;
|
||||
previewUrl = topBarInventoryModel.get(i).preview;
|
||||
if (MyAvatar.skeletonModelURL === downloadUrl) {
|
||||
avatarButtonImage.source = previewUrl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function fromScript(message) {
|
||||
if (message.source !== "simplifiedUI.js") {
|
||||
return;
|
||||
|
|
|
@ -3092,6 +3092,7 @@ void Application::initializeUi() {
|
|||
QUrl{ "hifi/tablet/TabletMenu.qml" },
|
||||
QUrl{ "hifi/commerce/marketplace/Marketplace.qml" },
|
||||
QUrl{ "hifi/simplifiedUI/avatarApp/AvatarApp.qml" },
|
||||
QUrl{ "hifi/simplifiedUI/topBar/SimplifiedTopBar.qml" },
|
||||
}, commerceCallback);
|
||||
|
||||
QmlContextCallback marketplaceCallback = [](QQmlContext* context) {
|
||||
|
|
|
@ -1,12 +1,22 @@
|
|||
<svg width="531" height="95" viewBox="0 0 531 95" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="64" width="353" height="95" rx="10" fill="white"/>
|
||||
<g clip-path="url(#clip0)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M115.081 28.5049L112.537 31.049C109.183 27.3485 104.442 24.92 99.007 24.92C93.8031 24.92 89.1775 27.2328 85.8239 30.7021L83.2798 28.158C87.2116 23.9949 92.878 21.3351 99.007 21.3351C105.367 21.3351 111.149 24.1105 115.081 28.5049ZM106.639 36.9481L109.184 34.404C106.755 31.513 103.055 29.6628 99.0072 29.6628C95.0754 29.6628 91.6062 31.3974 89.1777 34.0571L91.7218 36.6012C93.5721 34.6353 96.1162 33.2476 99.0072 33.2476C102.129 33.2476 104.905 34.6353 106.639 36.9481ZM103.348 42.2823V41.7164C103.348 39.4525 101.433 37.6414 99.1803 37.6414C96.9273 37.6414 95.0123 39.4525 95.0123 41.7164V49.5267L103.348 42.2823ZM95.8246 58.6522L92.4739 61.5966C94.0083 63.4173 96.4683 64.5816 99.1802 64.5816C103.799 64.5816 107.629 61.1858 107.629 56.9976V51.1116C107.629 49.9796 108.417 49.0741 109.544 49.0741C110.558 49.0741 111.571 49.8664 111.571 50.9984V56.9976C111.571 62.7705 107.066 67.5246 101.208 68.4301V72.2787H106.164C107.291 72.2787 108.192 73.1842 108.192 74.3162C108.192 75.4481 107.291 76.3536 106.164 76.3536H92.3086C91.1821 76.3536 90.281 75.4481 90.281 74.3162C90.281 73.1842 91.1821 72.2787 92.3086 72.2787H97.1525V68.4301C94.0724 68.0229 91.3422 66.4435 89.4655 64.2402L86.1129 67.1863C85.3244 67.8655 84.0852 67.7523 83.4093 66.9599L83.184 66.7335C82.5081 65.9412 82.6208 64.6961 83.4093 64.0169L112.022 38.6616C112.811 37.9825 114.05 38.0957 114.726 38.888L114.951 39.1144C115.627 40.0199 115.514 41.1519 114.838 41.9442L103.348 52.0408V56.2044C103.348 58.4682 101.433 60.2793 99.1803 60.2793C97.7776 60.2793 96.5729 59.6425 95.8246 58.6522ZM88.9292 49.0752C89.943 49.0752 90.7315 49.9808 90.7315 51.1127V53.3766L86.7888 56.8856V50.8863C86.9015 49.8676 87.8027 48.962 88.9292 49.0752Z" fill="#B20012"/>
|
||||
</g>
|
||||
<path d="M132.308 77H141.908V33.8L159.268 77H162.708L179.748 33.8V77H190.388V19.8H176.308L161.588 58.84L146.548 19.8H132.308V77ZM225.48 77.8C240.6 77.8 248.68 69.56 248.68 54.6V19.8H237.96V53.72C237.96 65.56 233.8 69.24 225.56 69.24C217.08 69.24 213.72 64.92 213.72 54.44V19.8H203V55.24C203 69.96 211.16 77.8 225.48 77.8ZM272.733 77H283.453V28.2H299.373V19.8H256.813V28.2H272.733V77ZM307.933 77H345.053V68.6H318.573V51.88H338.733V43.88H318.573V28.2H343.693V19.8H307.933V77ZM365.292 68.6V28.2H371.452C384.892 28.2 390.492 35.64 390.492 47.96V48.6C390.492 61.24 384.332 68.6 371.532 68.6H365.292ZM354.652 77H371.852C391.932 77 401.612 65.16 401.612 48.52V47.8C401.612 31.16 391.932 19.8 372.012 19.8H354.652V77Z" fill="#B20012"/>
|
||||
<defs>
|
||||
<clipPath id="clip0">
|
||||
<rect width="55.5084" height="55.5084" fill="white" transform="translate(70.5977 21.3351)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="353" height="95" fill="none" version="1.1" viewBox="0 0 353 95" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<metadata>
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title/>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<rect width="353" height="95" rx="10" fill="#fff"/>
|
||||
<g transform="translate(-64)" clip-path="url(#clip0)">
|
||||
<path d="m115.08 28.505-2.544 2.5441c-3.354-3.7005-8.095-6.129-13.53-6.129-5.2039 0-9.8295 2.3128-13.183 5.7821l-2.5441-2.5441c3.9318-4.1631 9.5982-6.8229 15.727-6.8229 6.36 0 12.142 2.7754 16.074 7.1698zm-8.442 8.4432 2.545-2.5441c-2.429-2.891-6.129-4.7412-10.177-4.7412-3.9318 0-7.401 1.7346-9.8295 4.3943l2.5441 2.5441c1.8503-1.9659 4.3944-3.3536 7.2854-3.3536 3.1218 0 5.8978 1.3877 7.6318 3.7005zm-3.291 5.3342v-0.5659c0-2.2639-1.915-4.075-4.1677-4.075-2.253 0-4.168 1.8111-4.168 4.075v7.8103zm-7.5234 16.37-3.3507 2.9444c1.5344 1.8207 3.9944 2.985 6.7063 2.985 4.6188 0 8.4488-3.3958 8.4488-7.584v-5.886c0-1.132 0.788-2.0375 1.915-2.0375 1.014 0 2.027 0.7923 2.027 1.9243v5.9992c0 5.7729-4.505 10.527-10.363 11.432v3.8486h4.956c1.127 0 2.028 0.9055 2.028 2.0375 0 1.1319-0.901 2.0374-2.028 2.0374h-13.855c-1.1265 0-2.0276-0.9055-2.0276-2.0374 0-1.132 0.9011-2.0375 2.0276-2.0375h4.8439v-3.8486c-3.0801-0.4072-5.8103-1.9866-7.687-4.1899l-3.3526 2.9461c-0.7885 0.6792-2.0277 0.566-2.7036-0.2264l-0.2253-0.2264c-0.6759-0.7923-0.5632-2.0374 0.2253-2.7166l28.613-25.355c0.789-0.6791 2.028-0.5659 2.704 0.2264l0.225 0.2264c0.676 0.9055 0.563 2.0375-0.113 2.8298l-11.49 10.097v4.1636c0 2.2638-1.915 4.0749-4.1677 4.0749-1.4027 0-2.6074-0.6368-3.3557-1.6271zm-6.8954-9.577c1.0138 0 1.8023 0.9056 1.8023 2.0375v2.2639l-3.9427 3.509v-5.9993c0.1127-1.0187 1.0139-1.9243 2.1404-1.8111z" clip-rule="evenodd" fill="#b20012" fill-rule="evenodd"/>
|
||||
</g>
|
||||
<path d="m68.308 77h9.6v-43.2l17.36 43.2h3.44l17.04-43.2v43.2h10.64v-57.2h-14.08l-14.72 39.04-15.04-39.04h-14.24zm93.172 0.8c15.12 0 23.2-8.24 23.2-23.2v-34.8h-10.72v33.92c0 11.84-4.16 15.52-12.4 15.52-8.48 0-11.84-4.32-11.84-14.8v-34.64h-10.72v35.44c0 14.72 8.16 22.56 22.48 22.56zm47.253-0.8h10.72v-48.8h15.92v-8.4h-42.56v8.4h15.92zm35.2 0h37.12v-8.4h-26.48v-16.72h20.16v-8h-20.16v-15.68h25.12v-8.4h-35.76zm57.359-8.4v-40.4h6.16c13.44 0 19.04 7.44 19.04 19.76v0.64c0 12.64-6.16 20-18.96 20zm-10.64 8.4h17.2c20.08 0 29.76-11.84 29.76-28.48v-0.72c0-16.64-9.68-28-29.6-28h-17.36z" fill="#b20012"/>
|
||||
<defs>
|
||||
<clipPath id="clip0">
|
||||
<rect transform="translate(70.598 21.335)" width="55.508" height="55.508" fill="#fff"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
@ -14,7 +14,7 @@
|
|||
|
||||
|
||||
// START CONFIG OPTIONS
|
||||
var DOCKED_QML_SUPPORTED = false;
|
||||
var DOCKED_QML_SUPPORTED = true;
|
||||
var REMOVE_EXISTING_UI = true;
|
||||
var TOOLBAR_NAME = "com.highfidelity.interface.toolbar.system";
|
||||
var DEFAULT_SCRIPTS_PATH_PREFIX = ScriptDiscoveryService.defaultScriptsPath + "/";
|
||||
|
@ -379,8 +379,8 @@ function getInputDeviceMutedOverlayTopY() {
|
|||
|
||||
|
||||
var inputDeviceMutedOverlay = false;
|
||||
var INPUT_DEVICE_MUTED_OVERLAY_DEFAULT_X_PX = 320;
|
||||
var INPUT_DEVICE_MUTED_OVERLAY_DEFAULT_Y_PX = 60;
|
||||
var INPUT_DEVICE_MUTED_OVERLAY_DEFAULT_X_PX = 353;
|
||||
var INPUT_DEVICE_MUTED_OVERLAY_DEFAULT_Y_PX = 95;
|
||||
var INPUT_DEVICE_MUTED_MARGIN_BOTTOM_PX = 20;
|
||||
function updateInputDeviceMutedOverlay(isMuted) {
|
||||
if (isMuted) {
|
||||
|
|
Loading…
Reference in a new issue