mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 21:56:26 +02:00
Avatarapp: base 'SquareLabel' on button from Uit
This commit is contained in:
parent
431cbf2694
commit
6e6eae2160
3 changed files with 36 additions and 26 deletions
|
@ -20,6 +20,7 @@ Original.Button {
|
||||||
property int color: 0
|
property int color: 0
|
||||||
property int colorScheme: hifi.colorSchemes.light
|
property int colorScheme: hifi.colorSchemes.light
|
||||||
property int fontSize: hifi.fontSizes.buttonLabel
|
property int fontSize: hifi.fontSizes.buttonLabel
|
||||||
|
property int radius: hifi.buttons.radius
|
||||||
property alias implicitTextWidth: buttonText.implicitWidth
|
property alias implicitTextWidth: buttonText.implicitWidth
|
||||||
property string buttonGlyph: "";
|
property string buttonGlyph: "";
|
||||||
property int fontCapitalization: Font.AllUppercase
|
property int fontCapitalization: Font.AllUppercase
|
||||||
|
@ -46,7 +47,7 @@ Original.Button {
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
radius: hifi.buttons.radius
|
radius: control.radius
|
||||||
|
|
||||||
border.width: (control.color === hifi.buttons.none ||
|
border.width: (control.color === hifi.buttons.none ||
|
||||||
(control.color === hifi.buttons.noneBorderless && control.hovered) ||
|
(control.color === hifi.buttons.noneBorderless && control.hovered) ||
|
||||||
|
|
|
@ -476,17 +476,13 @@ Rectangle {
|
||||||
anchors.verticalCenter: avatarNameLabel.verticalCenter
|
anchors.verticalCenter: avatarNameLabel.verticalCenter
|
||||||
glyphText: "."
|
glyphText: "."
|
||||||
glyphSize: 22
|
glyphSize: 22
|
||||||
|
onClicked: {
|
||||||
MouseArea {
|
popup.showSpecifyAvatarUrl(currentAvatar.avatarUrl, function() {
|
||||||
anchors.fill: parent
|
var url = popup.inputText.text;
|
||||||
onClicked: {
|
emitSendToScript({'method' : 'applyExternalAvatar', 'avatarURL' : url})
|
||||||
popup.showSpecifyAvatarUrl(currentAvatar.avatarUrl, function() {
|
}, function(link) {
|
||||||
var url = popup.inputText.text;
|
Qt.openUrlExternally(link);
|
||||||
emitSendToScript({'method' : 'applyExternalAvatar', 'avatarURL' : url})
|
});
|
||||||
}, function(link) {
|
|
||||||
Qt.openUrlExternally(link);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,12 +492,8 @@ Rectangle {
|
||||||
glyphText: "\ue02e"
|
glyphText: "\ue02e"
|
||||||
|
|
||||||
visible: avatarWearablesCount !== 0
|
visible: avatarWearablesCount !== 0
|
||||||
|
onClicked: {
|
||||||
MouseArea {
|
adjustWearables.open(currentAvatar);
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
adjustWearables.open(currentAvatar);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,42 @@
|
||||||
import "../../styles-uit"
|
import "../../styles-uit"
|
||||||
|
import "../../controls-uit" as HifiControlsUit
|
||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
ShadowRectangle {
|
Item {
|
||||||
|
id: root
|
||||||
width: 44
|
width: 44
|
||||||
height: 28
|
height: 28
|
||||||
AvatarAppStyle {
|
signal clicked();
|
||||||
id: style
|
|
||||||
|
HifiControlsUit.Button {
|
||||||
|
id: button
|
||||||
|
|
||||||
|
HifiConstants {
|
||||||
|
id: hifi
|
||||||
|
}
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
color: hifi.buttons.blue;
|
||||||
|
colorScheme: hifi.colorSchemes.light;
|
||||||
|
radius: 3
|
||||||
|
onClicked: root.clicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
gradient: Gradient {
|
DropShadow {
|
||||||
GradientStop { position: 0.0; color: style.colors.blueHighlight }
|
id: shadow
|
||||||
GradientStop { position: 1.0; color: style.colors.blueAccent }
|
anchors.fill: button
|
||||||
|
radius: 6
|
||||||
|
horizontalOffset: 0
|
||||||
|
verticalOffset: 3
|
||||||
|
color: Qt.rgba(0, 0, 0, 0.25)
|
||||||
|
source: button
|
||||||
}
|
}
|
||||||
|
|
||||||
property alias glyphText: glyph.text
|
property alias glyphText: glyph.text
|
||||||
property alias glyphRotation: glyph.rotation
|
property alias glyphRotation: glyph.rotation
|
||||||
property alias glyphSize: glyph.size
|
property alias glyphSize: glyph.size
|
||||||
|
|
||||||
radius: 3
|
|
||||||
|
|
||||||
HiFiGlyphs {
|
HiFiGlyphs {
|
||||||
id: glyph
|
id: glyph
|
||||||
color: 'white'
|
color: 'white'
|
||||||
|
|
Loading…
Reference in a new issue