diff options
Diffstat (limited to 'components')
| -rw-r--r-- | components/AdvancedOptionsItem.qml | 11 | ||||
| -rw-r--r-- | components/ContextMenu.qml | 46 | ||||
| -rw-r--r-- | components/ContextMenuItem.qml | 20 | ||||
| -rw-r--r-- | components/InlineButton.qml | 6 | ||||
| -rw-r--r-- | components/Input.qml | 9 | ||||
| -rw-r--r-- | components/InputMulti.qml | 9 | ||||
| -rw-r--r-- | components/LabelSubheader.qml | 1 | ||||
| -rw-r--r-- | components/StandardButton.qml | 21 | ||||
| -rw-r--r-- | components/Style.qml | 19 | ||||
| -rw-r--r-- | components/Tooltip.qml | 5 |
10 files changed, 112 insertions, 35 deletions
diff --git a/components/AdvancedOptionsItem.qml b/components/AdvancedOptionsItem.qml index 2f3c095a..d43944e8 100644 --- a/components/AdvancedOptionsItem.qml +++ b/components/AdvancedOptionsItem.qml @@ -37,27 +37,30 @@ RowLayout { Layout.fillWidth: false Layout.alignment: Qt.AlignTop | Qt.AlignLeft spacing: 4 - + RowLayout { Layout.fillWidth: false spacing: 12 Layout.alignment: Qt.AlignTop | Qt.AlignLeft - + StandardButton { id: button1 small: true + primary: false visible: button1.text } - + StandardButton { id: button2 small: true + primary: false visible: button2.text } - + StandardButton { id: button3 small: true + primary: false visible: button3.text } } diff --git a/components/ContextMenu.qml b/components/ContextMenu.qml index a4ca3209..efbd38ab 100644 --- a/components/ContextMenu.qml +++ b/components/ContextMenu.qml @@ -5,14 +5,21 @@ import FontAwesome 1.0 import "../components" as MoneroComponents MouseArea { + signal cut() + signal copy() signal paste() + signal remove() + signal selectAll() id: root acceptedButtons: Qt.RightButton anchors.fill: parent onClicked: { - if (mouse.button === Qt.RightButton) + if (mouse.button === Qt.RightButton) { + root.parent.persistentSelection = true; contextMenu.open() + root.parent.cursorVisible = true; + } } Menu { @@ -22,19 +29,50 @@ MouseArea { border.color: MoneroComponents.Style.buttonBackgroundColorDisabledHover border.width: 1 radius: 2 - color: MoneroComponents.Style.buttonBackgroundColorDisabled + color: MoneroComponents.Style.blackTheme ? MoneroComponents.Style.buttonBackgroundColorDisabled : "#E5E5E5" } padding: 1 - width: 100 + width: 110 x: root.mouseX y: root.mouseY + onClosed: { + if (!root.parent.activeFocus) { + root.parent.cursorVisible = false; + } + root.parent.persistentSelection = false; + root.parent.forceActiveFocus() + } + + MoneroComponents.ContextMenuItem { + enabled: root.parent.selectedText != "" && !root.parent.readOnly + onTriggered: root.cut() + text: qsTr("Cut") + translationManager.emptyString + } + + MoneroComponents.ContextMenuItem { + enabled: root.parent.selectedText != "" + onTriggered: root.copy() + text: qsTr("Copy") + translationManager.emptyString + } + MoneroComponents.ContextMenuItem { enabled: root.parent.canPaste === true - glyphIcon: FontAwesome.paste onTriggered: root.paste() text: qsTr("Paste") + translationManager.emptyString } + + MoneroComponents.ContextMenuItem { + enabled: root.parent.selectedText != "" && !root.parent.readOnly + onTriggered: root.remove() + text: qsTr("Delete") + translationManager.emptyString + } + + MoneroComponents.ContextMenuItem { + enabled: root.parent.text != "" + onTriggered: root.selectAll() + text: qsTr("Select All") + translationManager.emptyString + } } } diff --git a/components/ContextMenuItem.qml b/components/ContextMenuItem.qml index de2d54ad..c4e0f395 100644 --- a/components/ContextMenuItem.qml +++ b/components/ContextMenuItem.qml @@ -13,21 +13,31 @@ MenuItem { background: Rectangle { color: MoneroComponents.Style.buttonBackgroundColorDisabledHover - opacity: mouse.containsMouse ? 1 : 0 + opacity: 0 MouseArea { id: mouse anchors.fill: parent hoverEnabled: true - onClicked: menuItem.triggered() - visible: menuItem.enabled + onEntered: { + parent.opacity = 1; + } + onExited: { + parent.opacity = 0; + } + onClicked: { + if (menuItem.enabled) { + menuItem.triggered(); + parent.opacity = 0; + } + } } } contentItem: RowLayout { anchors.fill: parent - anchors.leftMargin: 10 + anchors.leftMargin: 20 anchors.rightMargin: 10 opacity: menuItem.enabled ? 1 : 0.4 spacing: 8 @@ -42,7 +52,7 @@ MenuItem { } Text { - color: MoneroComponents.Style.buttonTextColor + color: MoneroComponents.Style.blackTheme ? MoneroComponents.Style.buttonTextColor : MoneroComponents.Style.defaultFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 14 Layout.fillWidth: true diff --git a/components/InlineButton.qml b/components/InlineButton.qml index 09d3aadf..1983f29b 100644 --- a/components/InlineButton.qml +++ b/components/InlineButton.qml @@ -64,7 +64,7 @@ Item { Rectangle{ id: rect anchors.fill: parent - color: MoneroComponents.Style.buttonInlineBackgroundColor + color: buttonArea.containsMouse ? MoneroComponents.Style.buttonInlineBackgroundColorHover : MoneroComponents.Style.buttonInlineBackgroundColor radius: 4 @@ -101,13 +101,9 @@ Item { } onEntered: { tooltip.text ? tooltip.tooltipPopup.open() : "" - rect.color = buttonColor ? buttonColor : "#707070"; - rect.opacity = 0.8; } onExited: { tooltip.text ? tooltip.tooltipPopup.close() : "" - rect.opacity = 1.0; - rect.color = buttonColor ? buttonColor : "#808080"; } } } diff --git a/components/Input.qml b/components/Input.qml index 33601d88..b33a821e 100644 --- a/components/Input.qml +++ b/components/Input.qml @@ -48,9 +48,16 @@ TextField { MoneroComponents.ContextMenu { cursorShape: Qt.IBeamCursor + onCut: textField.cut(); + onCopy: textField.copy(); onPaste: { - textField.clear(); + var previoustextFieldLength = textField.length + var previousCursorPosition = textField.cursorPosition; textField.paste(); + textField.forceActiveFocus() + textField.cursorPosition = previousCursorPosition + (textField.length - previoustextFieldLength); } + onRemove: textField.remove(selectionStart, selectionEnd); + onSelectAll: textField.selectAll(); } } diff --git a/components/InputMulti.qml b/components/InputMulti.qml index ddbd5552..5d530b1d 100644 --- a/components/InputMulti.qml +++ b/components/InputMulti.qml @@ -71,9 +71,16 @@ TextArea { MoneroComponents.ContextMenu { cursorShape: Qt.IBeamCursor + onCut: textArea.cut(); + onCopy: textArea.copy(); onPaste: { - textArea.clear(); + var previoustextFieldLength = textArea.length + var previousCursorPosition = textArea.cursorPosition; textArea.paste(); + textArea.forceActiveFocus() + textArea.cursorPosition = previousCursorPosition + (textArea.length - previoustextFieldLength); } + onRemove: textArea.remove(selectionStart, selectionEnd); + onSelectAll: textArea.selectAll(); } } diff --git a/components/LabelSubheader.qml b/components/LabelSubheader.qml index 585d0027..0e93daa4 100644 --- a/components/LabelSubheader.qml +++ b/components/LabelSubheader.qml @@ -34,6 +34,7 @@ import "../components/effects/" as MoneroEffects Label { id: item fontSize: 18 + tooltipIconVisible: true Rectangle { anchors.top: item.bottom diff --git a/components/StandardButton.qml b/components/StandardButton.qml index b52b3a00..00fe0c89 100644 --- a/components/StandardButton.qml +++ b/components/StandardButton.qml @@ -39,16 +39,12 @@ Item { property bool primary: true property string rightIcon: "" property string rightIconInactive: "" - property color textColor: !button.enabled - ? MoneroComponents.Style.buttonTextColorDisabled - : primary - ? MoneroComponents.Style.buttonTextColor - : MoneroComponents.Style.buttonSecondaryTextColor; + property color textColor: primary ? MoneroComponents.Style.buttonTextColor : MoneroComponents.Style.buttonSecondaryTextColor; property bool small: false property alias text: label.text property alias fontBold: label.font.bold property int fontSize: { - if(small) return 14; + if(small) return 13.5; else return 16; } property alias label: label @@ -72,6 +68,7 @@ Item { anchors.fill: parent radius: 3 border.width: parent.focus && parent.enabled ? 1 : 0 + opacity: 1 state: button.enabled ? "active" : "disabled" Component.onCompleted: state = state @@ -102,7 +99,14 @@ Item { when: !button.enabled PropertyChanges { target: buttonRect - color: MoneroComponents.Style.buttonBackgroundColorDisabled + opacity: 0.5 + color: primary + ? MoneroComponents.Style.buttonBackgroundColor + : MoneroComponents.Style.buttonSecondaryBackgroundColor + } + PropertyChanges { + target: label + opacity: 0.5 } } ] @@ -122,7 +126,7 @@ Item { MoneroComponents.TextPlain { id: label font.family: MoneroComponents.Style.fontBold.name - font.bold: true + font.bold: button.primary ? true : false font.pixelSize: button.fontSize color: !buttonArea.pressed ? button.textColor : "transparent" visible: text !== "" @@ -145,6 +149,7 @@ Item { Layout.alignment: Qt.AlignVCenter | Qt.AlignRight width: button.small ? 16 : 20 height: button.small ? 16 : 20 + opacity: buttonRect.opacity source: { if (fontAwesomeIcon) return ""; if(button.rightIconInactive !== "" && !button.enabled) { diff --git a/components/Style.qml b/components/Style.qml index 2edd555e..da739477 100644 --- a/components/Style.qml +++ b/components/Style.qml @@ -42,11 +42,12 @@ QtObject { property string buttonBackgroundColorDisabled: blackTheme ? _b_buttonBackgroundColorDisabled : _w_buttonBackgroundColorDisabled property string buttonBackgroundColorDisabledHover: blackTheme ? _b_buttonBackgroundColorDisabledHover : _w_buttonBackgroundColorDisabledHover property string buttonInlineBackgroundColor: blackTheme ? _b_buttonInlineBackgroundColor : _w_buttonInlineBackgroundColor + property string buttonInlineBackgroundColorHover: blackTheme ? _b_buttonInlineBackgroundColorHover : _w_buttonInlineBackgroundColorHover property string buttonTextColor: blackTheme ? _b_buttonTextColor : _w_buttonTextColor property string buttonTextColorDisabled: blackTheme ? _b_buttonTextColorDisabled : _w_buttonTextColorDisabled - property string buttonSecondaryBackgroundColor: "#d9d9d9" - property string buttonSecondaryBackgroundColorHover: "#a6a6a6" - property string buttonSecondaryTextColor: "#4d4d4d" + property string buttonSecondaryBackgroundColor: blackTheme ? _b_buttonSecondaryBackgroundColor : _w_buttonSecondaryBackgroundColor + property string buttonSecondaryBackgroundColorHover: blackTheme ? _b_buttonSecondaryBackgroundColorHover : _w_buttonSecondaryBackgroundColorHover + property string buttonSecondaryTextColor: blackTheme ? _b_buttonSecondaryTextColor : _w_buttonSecondaryTextColor property string dividerColor: blackTheme ? _b_dividerColor : _w_dividerColor property real dividerOpacity: blackTheme ? _b_dividerOpacity : _w_dividerOpacity @@ -102,8 +103,12 @@ QtObject { property string _b_buttonBackgroundColorDisabled: "#707070" property string _b_buttonBackgroundColorDisabledHover: "#808080" property string _b_buttonInlineBackgroundColor: "#707070" + property string _b_buttonInlineBackgroundColorHover: "#808080" property string _b_buttonTextColor: "white" property string _b_buttonTextColorDisabled: "black" + property string _b_buttonSecondaryBackgroundColor: "#707070" + property string _b_buttonSecondaryBackgroundColorHover: "#808080" + property string _b_buttonSecondaryTextColor: "white" property string _b_dividerColor: "white" property real _b_dividerOpacity: 0.20 @@ -158,9 +163,13 @@ QtObject { property string _w_buttonBackgroundColorHover: "#E65E00" property string _w_buttonBackgroundColorDisabled: "#bbbbbb" property string _w_buttonBackgroundColorDisabledHover: "#D1D1D1" - property string _w_buttonInlineBackgroundColor: "#bbbbbb" + property string _w_buttonInlineBackgroundColor: "#d9d9d9" + property string _w_buttonInlineBackgroundColorHover: "#C8C8C8" property string _w_buttonTextColor: "white" property string _w_buttonTextColorDisabled: "black" + property string _w_buttonSecondaryBackgroundColor: "#d9d9d9" + property string _w_buttonSecondaryBackgroundColorHover: "#C8C8C8" + property string _w_buttonSecondaryTextColor: "#4d4d4d" property string _w_dividerColor: "black" property real _w_dividerOpacity: 0.20 @@ -185,7 +194,7 @@ QtObject { property string _w_menuButtonImageRightColorActive: "#FA6800" property string _w_menuButtonImageRightColor: "#808080" property string _w_menuButtonImageDotArrowSource: "qrc:///images/arrow-right-medium-white.png" - property string _w_inlineButtonTextColor: "black" + property string _w_inlineButtonTextColor: "#4d4d4d" property string _w_inlineButtonBorderColor: "transparent" property string _w_appWindowBackgroundColor: "black" property string _w_appWindowBorderColor: "#dedede" diff --git a/components/Tooltip.qml b/components/Tooltip.qml index 4709837e..c19d05e2 100644 --- a/components/Tooltip.qml +++ b/components/Tooltip.qml @@ -48,7 +48,7 @@ Rectangle { Text { id: icon visible: tooltipIconVisible - color: MoneroComponents.Style.orange + color: MoneroComponents.Style.defaultFontColor font.family: FontAwesome.fontFamily font.pixelSize: 10 font.styleName: "Regular" @@ -95,11 +95,12 @@ Rectangle { delay: 200 RowLayout { - Layout.maximumWidth: 350 + Layout.maximumWidth: 370 Text { id: tooltip width: contentWidth + Layout.maximumWidth: 370 color: MoneroComponents.Style.defaultFontColor font.family: MoneroComponents.Style.fontRegular.name font.pixelSize: 12 |
