forked from Public/monero-gui
Various QML development
This commit is contained in:
committed by
moneromooo-monero
parent
f48cd1b82b
commit
328eb32a24
@@ -28,10 +28,11 @@
|
|||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtQuick.Layouts 1.1
|
import QtQuick.Layouts 1.1
|
||||||
|
import "." 1.0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: inlineButton
|
id: inlineButton
|
||||||
height: 32 * scaleRatio
|
height: rect.height * scaleRatio
|
||||||
property string shadowPressedColor: "#B32D00"
|
property string shadowPressedColor: "#B32D00"
|
||||||
property string shadowReleasedColor: "#FF4304"
|
property string shadowReleasedColor: "#FF4304"
|
||||||
property string pressedColor: "#FF4304"
|
property string pressedColor: "#FF4304"
|
||||||
@@ -50,10 +51,10 @@ Item {
|
|||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id: rect
|
id: rect
|
||||||
color: rect.enabled ? "#808080" : "#3b3b3b"
|
color: Style.buttonBackgroundColorDisabled
|
||||||
border.color: "black"
|
border.color: "black"
|
||||||
height: 32
|
height: 28 * scaleRatio
|
||||||
width: inlineText.width + 22
|
width: inlineText.width + 22 * scaleRatio
|
||||||
radius: 4
|
radius: 4
|
||||||
|
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ Item {
|
|||||||
property alias inlineButton: inlineButtonId
|
property alias inlineButton: inlineButtonId
|
||||||
property alias inlineButtonText: inlineButtonId.text
|
property alias inlineButtonText: inlineButtonId.text
|
||||||
property alias inlineIcon: inlineIcon.visible
|
property alias inlineIcon: inlineIcon.visible
|
||||||
property alias copyButton: copyButton.visible
|
property bool copyButton: false
|
||||||
property int fontSize: 18 * scaleRatio
|
property int fontSize: 18 * scaleRatio
|
||||||
property bool showBorder: true
|
property bool showBorder: true
|
||||||
property bool error: false
|
property bool error: false
|
||||||
@@ -78,14 +78,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getColor(error) {
|
|
||||||
// @TODO: replace/remove this (implement as ternary?)
|
|
||||||
if (error)
|
|
||||||
return "transparent"
|
|
||||||
else
|
|
||||||
return "transparent"
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: inputLabel
|
id: inputLabel
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@@ -106,13 +98,13 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id: copyButton
|
id: copyButtonRect
|
||||||
color: "#808080"
|
color: "#808080"
|
||||||
radius: 3
|
radius: 3
|
||||||
height: 20
|
height: 20
|
||||||
width: 44
|
width: 44
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
visible: false
|
visible: copyButton && input.text !== "" ? true : false
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: copyButtonText
|
id: copyButtonText
|
||||||
@@ -137,19 +129,19 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
onEntered: {
|
onEntered: {
|
||||||
copyButton.color = "#707070";
|
copyButtonRect.color = "#707070";
|
||||||
copyButtonText.opacity = 0.8;
|
copyButtonText.opacity = 0.8;
|
||||||
}
|
}
|
||||||
onExited: {
|
onExited: {
|
||||||
|
copyButtonRect.color = "#808080";
|
||||||
copyButtonText.opacity = 1.0;
|
copyButtonText.opacity = 1.0;
|
||||||
copyButton.color = "#808080";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item{
|
Item{
|
||||||
id: inputItem
|
id: inputItem
|
||||||
height: 48 * scaleRatio
|
height: 40 * scaleRatio
|
||||||
anchors.top: inputLabel.bottom
|
anchors.top: inputLabel.bottom
|
||||||
anchors.topMargin: 6
|
anchors.topMargin: 6
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -161,9 +153,9 @@ Item {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: inlineIcon.visible ? 50 : 10
|
anchors.leftMargin: inlineIcon.visible ? 50 : 10
|
||||||
opacity: 0.25
|
opacity: 0.25
|
||||||
color: "#FFFFFF"
|
color: Style.defaultFontColor
|
||||||
font.family: Style.fontRegular.name
|
font.family: Style.fontRegular.name
|
||||||
font.pixelSize: 20 * scaleRatio
|
font.pixelSize: 18 * scaleRatio
|
||||||
text: ""
|
text: ""
|
||||||
z: 3
|
z: 3
|
||||||
}
|
}
|
||||||
@@ -171,24 +163,29 @@ Item {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.topMargin: 1 * scaleRatio
|
anchors.topMargin: 1 * scaleRatio
|
||||||
color: getColor(error)
|
color: "transparent"
|
||||||
//radius: 4
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: Qt.rgba(1, 1, 1, 0.25)
|
border.color: {
|
||||||
|
if(input.activeFocus){
|
||||||
|
return Qt.rgba(255, 255, 255, 0.35);
|
||||||
|
} else {
|
||||||
|
return Qt.rgba(255, 255, 255, 0.25);
|
||||||
|
}
|
||||||
|
}
|
||||||
radius: 4
|
radius: 4
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: inlineIcon
|
id: inlineIcon
|
||||||
width: 28 * scaleRatio
|
width: 26 * scaleRatio
|
||||||
height: 28 * scaleRatio
|
height: 26 * scaleRatio
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 10 * scaleRatio
|
anchors.topMargin: 8 * scaleRatio
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 12 * scaleRatio
|
anchors.leftMargin: 12 * scaleRatio
|
||||||
source: "../images/moneroIcon-28x28.png"
|
source: "../images/moneroIcon-28x28.png"
|
||||||
@@ -212,7 +209,7 @@ Item {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 8
|
anchors.rightMargin: 8
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 8
|
anchors.topMargin: 6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ Item {
|
|||||||
|
|
||||||
signal changed();
|
signal changed();
|
||||||
|
|
||||||
height: 48 * scaleRatio
|
height: 40 * scaleRatio
|
||||||
|
|
||||||
onExpandedChanged: if(expanded) appWindow.currentItem = dropdown
|
onExpandedChanged: if(expanded) appWindow.currentItem = dropdown
|
||||||
function hide() { dropdown.expanded = false }
|
function hide() { dropdown.expanded = false }
|
||||||
@@ -68,7 +68,7 @@ Item {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
height: 48 * scaleRatio
|
height: 40 * scaleRatio
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ QtObject {
|
|||||||
|
|
||||||
property string buttonBackgroundColor: "#FA6800"
|
property string buttonBackgroundColor: "#FA6800"
|
||||||
property string buttonBackgroundColorHover: "#E65E00"
|
property string buttonBackgroundColorHover: "#E65E00"
|
||||||
property string buttonBackgroundColorDisabled: "#3B3B3B"
|
property string buttonBackgroundColorDisabled: "#707070"
|
||||||
property string buttonBackgroundColorDisabledHover: "#4F4F4F"
|
property string buttonBackgroundColorDisabledHover: "#808080"
|
||||||
|
|
||||||
property string buttonTextColor: "white"
|
property string buttonTextColor: "white"
|
||||||
property string buttonTextColorDisabled: "black"
|
property string buttonTextColorDisabled: "black"
|
||||||
|
|||||||
Reference in New Issue
Block a user