From 51728d14a725a1df2eba79b57ce682a4ba157c68 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 24 Mar 2016 21:17:36 +1300 Subject: [PATCH] Miscellaneous improvements to Attachments dialog --- .../resources/qml/controls-uit/SpinBox.qml | 1 - .../qml/hifi/dialogs/AttachmentsDialog.qml | 43 +++++++++++++------ .../hifi/dialogs/attachments/Attachment.qml | 41 ++++++++++-------- .../hifi/dialogs/attachments/Translation.qml | 2 +- 4 files changed, 55 insertions(+), 32 deletions(-) diff --git a/interface/resources/qml/controls-uit/SpinBox.qml b/interface/resources/qml/controls-uit/SpinBox.qml index be6dcdc7ee..ec7821851f 100755 --- a/interface/resources/qml/controls-uit/SpinBox.qml +++ b/interface/resources/qml/controls-uit/SpinBox.qml @@ -35,7 +35,6 @@ SpinBox { style: SpinBoxStyle { id: spinStyle background: Rectangle { - id: backgrondRec color: isLightColorScheme ? (spinBox.focus ? hifi.colors.white : hifi.colors.lightGray) : (spinBox.focus ? hifi.colors.black : hifi.colors.baseGrayShadow) diff --git a/interface/resources/qml/hifi/dialogs/AttachmentsDialog.qml b/interface/resources/qml/hifi/dialogs/AttachmentsDialog.qml index 8e5b377521..01be4ddbde 100755 --- a/interface/resources/qml/hifi/dialogs/AttachmentsDialog.qml +++ b/interface/resources/qml/hifi/dialogs/AttachmentsDialog.qml @@ -11,7 +11,7 @@ import "attachments" Window { id: root - title: "Attachments Dialog" + title: "Attachments" objectName: "AttachmentsDialog" width: 600 height: 600 @@ -55,11 +55,19 @@ Window { color: hifi.colors.baseGrayShadow radius: 4 - ScrollView{ + ScrollView { id: scrollView anchors.fill: parent anchors.margins: 4 + style: ScrollViewStyle { + + padding { + top: 0 + right: 0 + bottom: 0 + } + decrementControl: Item { visible: false } @@ -69,18 +77,29 @@ Window { scrollBarBackground: Rectangle{ implicitWidth: 14 color: hifi.colors.baseGray - anchors.left: attachmentDelegate.right - anchors.leftMargin: 5 - radius: 3 + radius: 4 + Rectangle { + // Make top left corner of scrollbar appear square + width: 8 + height: 4 + color: hifi.colors.baseGray + anchors.top: parent.top + anchors.horizontalCenter: parent.left + } + } handle: Rectangle { implicitWidth: 8 - anchors.left: parent.left - anchors.leftMargin: 3 - anchors.top: parent.top - anchors.bottom: parent.bottom - radius: 3 + anchors { + left: parent.left + leftMargin: 3 + top: parent.top + topMargin: 3 + bottom: parent.bottom + bottomMargin: 4 + } + radius: 4 color: hifi.colors.lightGrayText } } @@ -134,12 +153,12 @@ Window { spacing: 8 anchors { right: parent.right; bottom: parent.bottom; margins: 8 } HifiControls.Button { - action: cancelAction + action: okAction color: hifi.buttons.black colorScheme: hifi.colorSchemes.dark } HifiControls.Button { - action: okAction + action: cancelAction color: hifi.buttons.black colorScheme: hifi.colorSchemes.dark } diff --git a/interface/resources/qml/hifi/dialogs/attachments/Attachment.qml b/interface/resources/qml/hifi/dialogs/attachments/Attachment.qml index 0db6bb4875..1277c459ce 100755 --- a/interface/resources/qml/hifi/dialogs/attachments/Attachment.qml +++ b/interface/resources/qml/hifi/dialogs/attachments/Attachment.qml @@ -36,7 +36,7 @@ Item { Item { height: modelChooserButton.height + urlLabel.height + 4 anchors { left: parent.left; right: parent.right;} - HifiControls.Label { id: urlLabel; color: hifi.colors.lightGrayText; text: "Model URL:"; anchors.top: parent.top;} + HifiControls.Label { id: urlLabel; color: hifi.colors.lightGrayText; text: "Model URL"; anchors.top: parent.top;} HifiControls.TextField { id: modelUrl; height: jointChooser.height; @@ -57,12 +57,12 @@ Item { colorScheme: hifi.colorSchemes.dark anchors { right: parent.right; verticalCenter: modelUrl.verticalCenter } Component { - id: modelBrowserBuiler; + id: modelBrowserBuilder; ModelBrowserDialog {} } onClicked: { - var browser = modelBrowserBuiler.createObject(desktop); + var browser = modelBrowserBuilder.createObject(desktop); browser.selected.connect(function(newModelUrl){ modelUrl.text = newModelUrl; }) @@ -75,7 +75,7 @@ Item { anchors { left: parent.left; right: parent.right; } HifiControls.Label { id: jointLabel; - text: "Joint:"; + text: "Joint"; color: hifi.colors.lightGrayText; anchors.top: parent.top } @@ -97,7 +97,7 @@ Item { Item { height: translation.height + translationLabel.height + 4 anchors { left: parent.left; right: parent.right; } - HifiControls.Label { id: translationLabel; color: hifi.colors.lightGrayText; text: "Translation:"; anchors.top: parent.top; } + HifiControls.Label { id: translationLabel; color: hifi.colors.lightGrayText; text: "Translation"; anchors.top: parent.top; } Translation { id: translation; anchors { left: parent.left; right: parent.right; bottom: parent.bottom} @@ -114,7 +114,7 @@ Item { Item { height: rotation.height + rotationLabel.height + 4 anchors { left: parent.left; right: parent.right; } - HifiControls.Label { id: rotationLabel; color: hifi.colors.lightGrayText; text: "Rotation:"; anchors.top: parent.top; } + HifiControls.Label { id: rotationLabel; color: hifi.colors.lightGrayText; text: "Rotation"; anchors.top: parent.top; } Rotation { id: rotation; anchors { left: parent.left; right: parent.right; bottom: parent.bottom; } @@ -129,15 +129,15 @@ Item { } Item { - height: scaleItem.height - anchors {left: parent.left; right: parent.right;} + height: scaleItem.height + anchors { left: parent.left; right: parent.right; } Item { - id: scaleItem + id: scaleItem height: scaleSpinner.height + scaleLabel.height + 4 - width: parent.width - isSoftItem.width - anchors { left: isSoftItem.right; right: parent.right; } - HifiControls.Label { id: scaleLabel; color: hifi.colors.lightGrayText; text: "Scale:"; anchors.top: parent.top; } + width: parent.width / 3 - 8 + anchors { right: parent.right; } + HifiControls.Label { id: scaleLabel; color: hifi.colors.lightGrayText; text: "Scale"; anchors.top: parent.top; } HifiControls.SpinBox { id: scaleSpinner; anchors { left: parent.left; right: parent.right; bottom: parent.bottom; } @@ -158,13 +158,18 @@ Item { Item { id: isSoftItem - height: soft.height - width: parent.width * 0.2 - anchors { left: parent.left; bottom: parent.bottom } - HifiControls.Label { id: softLabel; color: hifi.colors.lightGrayText; text: "Is soft"; anchors.left: soft.right; anchors.leftMargin: 8; } + height: scaleSpinner.height + anchors { + left: parent.left + bottom: parent.bottom + } HifiControls.CheckBox { - id: soft; - anchors { left: parent.left; bottom: parent.bottom;} + id: soft + text: "Is soft" + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + } checked: attachment ? attachment.soft : false colorScheme: hifi.colorSchemes.dark onCheckedChanged: { diff --git a/interface/resources/qml/hifi/dialogs/attachments/Translation.qml b/interface/resources/qml/hifi/dialogs/attachments/Translation.qml index f3a90cdf94..39ac6da55a 100644 --- a/interface/resources/qml/hifi/dialogs/attachments/Translation.qml +++ b/interface/resources/qml/hifi/dialogs/attachments/Translation.qml @@ -1,7 +1,7 @@ import "." Vector3 { - decimals: 2; + decimals: 3; stepSize: 0.01; maximumValue: 10 minimumValue: -10