Skip to content

Commit

Permalink
Finishing up on the settings page for now and modified some QML compo…
Browse files Browse the repository at this point in the history
…nents
  • Loading branch information
sanderfoobar committed Dec 10, 2017
1 parent 6bda4a2 commit 6d29a63
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 133 deletions.
2 changes: 1 addition & 1 deletion MiddlePanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Rectangle {
}, State {
name: "Settings"
PropertyChanges { target: root; currentView: settingsView }
PropertyChanges { target: mainFlickable; contentHeight: 1200 * scaleRatio }
PropertyChanges { target: mainFlickable; contentHeight: 1400 * scaleRatio }
}, State {
name: "Mining"
PropertyChanges { target: root; currentView: miningView }
Expand Down
23 changes: 13 additions & 10 deletions components/Label.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down
45 changes: 45 additions & 0 deletions components/LabelSubheader.qml
Original file line number Diff line number Diff line change
@@ -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
}
}
9 changes: 5 additions & 4 deletions components/LineEdit.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,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
Expand Down Expand Up @@ -108,14 +109,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 {
Expand Down
2 changes: 1 addition & 1 deletion components/LineEditMulti.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions components/StandardButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,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
Expand Down
Loading

0 comments on commit 6d29a63

Please sign in to comment.