forked from Public/monero-gui
Finishing up on the settings page for now and modified some QML components
This commit is contained in:
committed by
moneromooo-monero
parent
be9cb8931c
commit
f262ce5209
@@ -42,8 +42,10 @@ Item {
|
||||
property alias wrapMode: label.wrapMode
|
||||
property alias horizontalAlignment: label.horizontalAlignment
|
||||
signal linkActivated()
|
||||
width: icon.x + icon.width * scaleRatio
|
||||
height: icon.height * scaleRatio
|
||||
// width: icon.x + icon.width * scaleRatio
|
||||
// height: icon.height * scaleRatio
|
||||
height: label.height * scaleRatio
|
||||
width: label.width * scaleRatio
|
||||
Layout.topMargin: 10 * scaleRatio
|
||||
|
||||
Text {
|
||||
@@ -58,14 +60,15 @@ Item {
|
||||
onLinkActivated: item.linkActivated()
|
||||
}
|
||||
|
||||
Image {
|
||||
id: icon
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: label.right
|
||||
anchors.leftMargin: 5 * scaleRatio
|
||||
source: "../images/whatIsIcon.png"
|
||||
visible: appWindow.whatIsEnable
|
||||
}
|
||||
// @TODO: figure out significance of whatIsIcon.png, remove for now
|
||||
// Image {
|
||||
// id: icon
|
||||
// anchors.verticalCenter: parent.verticalCenter
|
||||
// anchors.left: label.right
|
||||
// anchors.leftMargin: 5 * scaleRatio
|
||||
// source: "../images/whatIsIcon.png"
|
||||
// visible: appWindow.whatIsEnable
|
||||
// }
|
||||
|
||||
// MouseArea {
|
||||
// anchors.fill: icon
|
||||
|
||||
45
components/LabelSubheader.qml
Normal file
45
components/LabelSubheader.qml
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright (c) 2014-2015, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// 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 "." 1.0
|
||||
|
||||
Label {
|
||||
id: item
|
||||
fontSize: 17 * scaleRatio
|
||||
|
||||
Rectangle {
|
||||
anchors.top: item.bottom
|
||||
anchors.topMargin: 4
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: 2
|
||||
color: Style.dividerColor
|
||||
opacity: Style.dividerOpacity
|
||||
}
|
||||
}
|
||||
@@ -53,12 +53,13 @@ Item {
|
||||
property bool labelFontBold: false
|
||||
property alias labelWrapMode: inputLabel.wrapMode
|
||||
property alias labelHorizontalAlignment: inputLabel.horizontalAlignment
|
||||
property bool showingHeader: inputLabel.text !== "" || copyButton
|
||||
signal labelLinkActivated(); // input label, rich text <a> signal
|
||||
signal editingFinished();
|
||||
signal accepted();
|
||||
signal textUpdated();
|
||||
|
||||
height: (inputLabel.height + inputItem.height + 2) * scaleRatio
|
||||
height: showingHeader ? (inputLabel.height + inputItem.height + 2) * scaleRatio : 42 * scaleRatio
|
||||
|
||||
onTextUpdated: {
|
||||
// check to remove placeholder text when there is content
|
||||
@@ -109,14 +110,14 @@ Item {
|
||||
appWindow.showStatusMessage(qsTr("Copied to clipboard"),3)
|
||||
}
|
||||
}
|
||||
visible: input.text && copyButton ? true : false
|
||||
visible: copyButton && input.text !== ""
|
||||
}
|
||||
|
||||
Item{
|
||||
id: inputItem
|
||||
height: 40 * scaleRatio
|
||||
anchors.top: inputLabel.bottom
|
||||
anchors.topMargin: 6 * scaleRatio
|
||||
anchors.top: showingHeader ? inputLabel.bottom : parent.top
|
||||
anchors.topMargin: showingHeader ? 6 * scaleRatio : 2
|
||||
width: parent.width
|
||||
|
||||
Text {
|
||||
|
||||
@@ -71,7 +71,7 @@ ColumnLayout {
|
||||
|
||||
LabelButton {
|
||||
id: copyButtonId
|
||||
visible: copyButton
|
||||
visible: copyButton && multiLine.text !== ""
|
||||
text: qsTr("Copy")
|
||||
anchors.right: labelButton.visible ? inputLabel.right : parent.right
|
||||
anchors.rightMargin: labelButton.visible? 4 : 0
|
||||
|
||||
@@ -32,15 +32,20 @@ import "." 1.0
|
||||
|
||||
Item {
|
||||
id: button
|
||||
height: 37 * scaleRatio
|
||||
property string icon: ""
|
||||
property string textColor: button.enabled? Style.buttonTextColor: Style.buttonTextColorDisabled
|
||||
property int fontSize: 16 * scaleRatio
|
||||
property bool small: false
|
||||
property alias text: label.text
|
||||
property int fontSize: {
|
||||
if(small) return 14 * scaleRatio;
|
||||
else return 16 * scaleRatio;
|
||||
}
|
||||
signal clicked()
|
||||
|
||||
// Dynamic label width
|
||||
// Dynamic height/width
|
||||
Layout.minimumWidth: (label.contentWidth > 50)? label.contentWidth + 22 : 60
|
||||
height: small ? 30 * scaleRatio : 36 * scaleRatio
|
||||
|
||||
|
||||
function doClick() {
|
||||
// Android workaround
|
||||
|
||||
Reference in New Issue
Block a user