mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-23 11:15:00 +00:00
Restyling the dialog boxes a bit more
This commit is contained in:
parent
2d7ef434be
commit
28608e4ce0
3 changed files with 129 additions and 114 deletions
|
@ -26,8 +26,8 @@
|
|||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
@ -38,14 +38,6 @@ import "../components" as MoneroComponents
|
|||
Item {
|
||||
id: root
|
||||
visible: false
|
||||
Rectangle {
|
||||
id: bg
|
||||
z: parent.z + 1
|
||||
anchors.fill: parent
|
||||
color: "white"
|
||||
opacity: 0.9
|
||||
}
|
||||
|
||||
property alias labelText: label.text
|
||||
property alias inputText: input.text
|
||||
|
||||
|
@ -78,42 +70,45 @@ Item {
|
|||
|
||||
ColumnLayout {
|
||||
id: column
|
||||
//anchors {fill: parent; margins: 16 }
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.maximumWidth: 400 * scaleRatio
|
||||
|
||||
Label {
|
||||
id: label
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
// Layout.columnSpan: 2
|
||||
anchors.left: parent.left
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pixelSize: 18 * scaleRatio
|
||||
font.family: "Arial"
|
||||
color: "#555555"
|
||||
|
||||
font.pixelSize: 16 * scaleRatio
|
||||
font.family: Style.fontLight
|
||||
|
||||
color: Style.defaultFontColor
|
||||
}
|
||||
|
||||
TextField {
|
||||
id : input
|
||||
focus: true
|
||||
Layout.topMargin: 6
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
anchors.left: parent.left
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 32 * scaleRatio
|
||||
// echoMode: TextInput.Password
|
||||
font.family: Style.fontLight
|
||||
font.pixelSize: 24 * scaleRatio
|
||||
KeyNavigation.tab: okButton
|
||||
bottomPadding: 10
|
||||
leftPadding: 10
|
||||
topPadding: 10
|
||||
color: Style.defaultFontColor
|
||||
|
||||
style: TextFieldStyle {
|
||||
renderType: Text.NativeRendering
|
||||
textColor: "#35B05A"
|
||||
// passwordCharacter: "•"
|
||||
// no background
|
||||
background: Rectangle {
|
||||
radius: 0
|
||||
border.width: 0
|
||||
}
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
border.color: Qt.rgba(255, 255, 255, 0.35)
|
||||
border.width: 1
|
||||
color: "black"
|
||||
}
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
root.close()
|
||||
root.accepted()
|
||||
|
@ -123,51 +118,47 @@ Item {
|
|||
root.rejected()
|
||||
}
|
||||
}
|
||||
// underline
|
||||
Rectangle {
|
||||
height: 1
|
||||
color: "#DBDBDB"
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
anchors.bottomMargin: 3
|
||||
}
|
||||
// padding
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
height: 10
|
||||
opacity: 0
|
||||
color: "black"
|
||||
}
|
||||
}
|
||||
// Ok/Cancel buttons
|
||||
RowLayout {
|
||||
id: buttons
|
||||
spacing: 60
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
MoneroComponents.StandardButton {
|
||||
id: cancelButton
|
||||
width: 120
|
||||
fontSize: 14
|
||||
text: qsTr("Cancel") + translationManager.emptyString
|
||||
KeyNavigation.tab: input
|
||||
onClicked: {
|
||||
root.close()
|
||||
root.rejected()
|
||||
|
||||
// Ok/Cancel buttons
|
||||
RowLayout {
|
||||
id: buttons
|
||||
spacing: 16 * scaleRatio
|
||||
Layout.topMargin: 16
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
MoneroComponents.StandardButton {
|
||||
id: cancelButton
|
||||
small: true
|
||||
width: 120
|
||||
fontSize: 14
|
||||
text: qsTr("Cancel") + translationManager.emptyString
|
||||
KeyNavigation.tab: input
|
||||
onClicked: {
|
||||
root.close()
|
||||
root.rejected()
|
||||
}
|
||||
}
|
||||
}
|
||||
MoneroComponents.StandardButton {
|
||||
id: okButton
|
||||
width: 120
|
||||
fontSize: 14
|
||||
text: qsTr("Ok")
|
||||
KeyNavigation.tab: cancelButton
|
||||
onClicked: {
|
||||
root.close()
|
||||
root.accepted()
|
||||
MoneroComponents.StandardButton {
|
||||
id: okButton
|
||||
small: true
|
||||
width: 120
|
||||
fontSize: 14
|
||||
text: qsTr("Ok")
|
||||
KeyNavigation.tab: cancelButton
|
||||
onClicked: {
|
||||
root.close()
|
||||
root.accepted()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: bg
|
||||
z: parent.z + 1
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
opacity: 0.8
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
@ -93,42 +93,54 @@ Item {
|
|||
|
||||
ColumnLayout {
|
||||
id: column
|
||||
//anchors {fill: parent; margins: 16 }
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.maximumWidth: 400 * scaleRatio
|
||||
|
||||
Label {
|
||||
text: qsTr("Please enter new password")
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.columnSpan: 2
|
||||
anchors.left: parent.left
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pixelSize: 18 * scaleRatio
|
||||
|
||||
font.pixelSize: 16 * scaleRatio
|
||||
font.family: Style.fontLight
|
||||
|
||||
color: Style.defaultFontColor
|
||||
}
|
||||
|
||||
TextField {
|
||||
id : passwordInput1
|
||||
Layout.topMargin: 6
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.maximumWidth: 400 * scaleRatio
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
anchors.left: parent.left
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 32 * scaleRatio
|
||||
font.family: Style.fontLight
|
||||
font.pixelSize: 24 * scaleRatio
|
||||
echoMode: TextInput.Password
|
||||
bottomPadding: 10
|
||||
leftPadding: 10
|
||||
topPadding: 10
|
||||
color: Style.defaultFontColor
|
||||
KeyNavigation.tab: passwordInput2
|
||||
|
||||
style: TextFieldStyle {
|
||||
renderType: Text.NativeRendering
|
||||
textColor: "black"
|
||||
passwordCharacter: "•"
|
||||
// no background
|
||||
background: Rectangle {
|
||||
radius: 0
|
||||
border.width: 0
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
border.color: Qt.rgba(255, 255, 255, 0.35)
|
||||
border.width: 1
|
||||
color: "black"
|
||||
|
||||
Image {
|
||||
width: 12
|
||||
height: 16
|
||||
source: "../images/lockIcon.png"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 20
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onEscapePressed: {
|
||||
root.close()
|
||||
root.rejected()
|
||||
|
@ -146,37 +158,47 @@ Item {
|
|||
|
||||
Label {
|
||||
text: qsTr("Please confirm new password")
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.columnSpan: 2
|
||||
anchors.left: parent.left
|
||||
Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.pixelSize: 18 * scaleRatio
|
||||
|
||||
font.pixelSize: 16 * scaleRatio
|
||||
font.family: Style.fontLight
|
||||
|
||||
color: Style.defaultFontColor
|
||||
}
|
||||
|
||||
TextField {
|
||||
id : passwordInput2
|
||||
Layout.topMargin: 6
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.maximumWidth: 400 * scaleRatio
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
anchors.left: parent.left
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
font.family: "Arial"
|
||||
font.pixelSize: 32 * scaleRatio
|
||||
font.family: Style.fontLight
|
||||
font.pixelSize: 24 * scaleRatio
|
||||
echoMode: TextInput.Password
|
||||
KeyNavigation.tab: okButton
|
||||
bottomPadding: 10
|
||||
leftPadding: 10
|
||||
topPadding: 10
|
||||
color: Style.defaultFontColor
|
||||
|
||||
style: TextFieldStyle {
|
||||
renderType: Text.NativeRendering
|
||||
textColor: "black"
|
||||
passwordCharacter: "•"
|
||||
// no background
|
||||
background: Rectangle {
|
||||
radius: 0
|
||||
border.width: 0
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
border.color: Qt.rgba(255, 255, 255, 0.35)
|
||||
border.width: 1
|
||||
color: "black"
|
||||
|
||||
Image {
|
||||
width: 12
|
||||
height: 16
|
||||
source: "../images/lockIcon.png"
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 20
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
if (passwordInput1.text === passwordInput2.text) {
|
||||
root.close()
|
||||
|
@ -201,8 +223,9 @@ Item {
|
|||
// Ok/Cancel buttons
|
||||
RowLayout {
|
||||
id: buttons
|
||||
spacing: 60 * scaleRatio
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 16 * scaleRatio
|
||||
Layout.topMargin: 16
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
MoneroComponents.StandardButton {
|
||||
id: cancelButton
|
||||
|
|
|
@ -74,7 +74,7 @@ Item {
|
|||
|
||||
ColumnLayout {
|
||||
id: column
|
||||
//anchors {fill: parent; margins: 16 }
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.maximumWidth: 400 * scaleRatio
|
||||
|
@ -104,7 +104,8 @@ Item {
|
|||
bottomPadding: 10
|
||||
leftPadding: 10
|
||||
topPadding: 10
|
||||
color: "white"
|
||||
color: Style.defaultFontColor
|
||||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
border.color: Qt.rgba(255, 255, 255, 0.35)
|
||||
|
|
Loading…
Reference in a new issue