From b0d773b5fbc323b9635297aaf2fc8701b43e42ff Mon Sep 17 00:00:00 2001 From: Alexandra Betouni <31625338+alexandraB99@users.noreply.github.com> Date: Wed, 30 Mar 2022 01:26:04 +0300 Subject: [PATCH] Revert "feat(StatusSeedPhraseInput): exposed keys on pressed signal (#599)" This reverts commit 2cec51ff8dfe0fcb67ef8362a1b46a4001482ecf. --- sandbox/controls/ListItems.qml | 19 -------- .../Components/StatusExpandableItem.qml | 7 ++- src/StatusQ/Components/StatusListItem.qml | 17 +------ src/StatusQ/Controls/StatusBaseInput.qml | 12 +---- src/StatusQ/Controls/StatusInput.qml | 8 ---- .../Controls/StatusSeedPhraseInput.qml | 48 ------------------- 6 files changed, 6 insertions(+), 105 deletions(-) diff --git a/sandbox/controls/ListItems.qml b/sandbox/controls/ListItems.qml index a68cec88..0a0516ba 100644 --- a/sandbox/controls/ListItems.qml +++ b/sandbox/controls/ListItems.qml @@ -4,7 +4,6 @@ import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 import StatusQ.Controls 0.1 import StatusQ.Components 0.1 -import StatusQ.Core.Utils 0.1 GridLayout { columns: 1 @@ -339,24 +338,6 @@ CExPynn1gWf9bx498P7/nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2I } } - StatusListItem { - title: "List Item with Inline Tags" - icon.isLetterIdenticon: true - tagsModel : 2 - tagsDelegate: StatusListItemTag { - color: "blue" - height: 24 - radius: 6 - closeButtonVisible: false - icon.emoji: "😁" - icon.emojiSize: Emoji.size.verySmall - icon.isLetterIdenticon: true - title: "helloworld.eth" - titleText.font.pixelSize: 12 - titleText.color: Theme.palette.indirectColor1 - } - } - StatusListItem { title: "List Item with Emoji" subTitle: "Emoji" diff --git a/src/StatusQ/Components/StatusExpandableItem.qml b/src/StatusQ/Components/StatusExpandableItem.qml index 53847760..68ec9395 100644 --- a/src/StatusQ/Components/StatusExpandableItem.qml +++ b/src/StatusQ/Components/StatusExpandableItem.qml @@ -12,7 +12,6 @@ Rectangle { property alias additionalText: additionalText.text property alias button: button property alias expandableComponent: expandableRegion.sourceComponent - property alias expandableItem: expandableRegion.item property int type: StatusExpandableItem.Type.Primary property bool expandable: true @@ -186,7 +185,7 @@ Rectangle { anchors.leftMargin: (statusExpandableItem.type === StatusExpandableItem.Type.Primary) ? 48 : 0 anchors.right: parent.right anchors.rightMargin: (statusExpandableItem.type === StatusExpandableItem.Type.Primary) ? 16 : 0 - visible: false + active: false } onExpandedChanged: { @@ -203,13 +202,13 @@ Rectangle { name: "EXPANDED" PropertyChanges {target: expandImage; icon: "chevron-up"} PropertyChanges {target: statusExpandableItem; height: 82 + expandableRegion.height + 22} - PropertyChanges {target: expandableRegion; visible: true} + PropertyChanges {target: expandableRegion; active: true} }, State { name: "COLLAPSED" PropertyChanges {target: expandImage; icon: "chevron-down"} PropertyChanges {target: statusExpandableItem; height: 82} - PropertyChanges {target: expandableRegion; visible: false} + PropertyChanges {target: expandableRegion; active: false} } ] diff --git a/src/StatusQ/Components/StatusListItem.qml b/src/StatusQ/Components/StatusListItem.qml index 1cd76b9b..877ccde4 100644 --- a/src/StatusQ/Components/StatusListItem.qml +++ b/src/StatusQ/Components/StatusListItem.qml @@ -25,8 +25,6 @@ Rectangle { property list components property var bottomModel: [] property Component bottomDelegate - property var tagsModel: [] - property Component tagsDelegate property StatusIconSettings icon: StatusIconSettings { height: isLetterIdenticon ? 40 : 20 @@ -73,7 +71,6 @@ Rectangle { property alias statusListItemTertiaryTitle: statusListItemTertiaryTitle property alias statusListItemComponentsSlot: statusListItemComponentsSlot property alias statusListItemTagsSlot: statusListItemTagsSlot - property alias statusListItemInlineTagsSlot: statusListItemTagsSlotInline signal clicked(string itemId) signal titleClicked(string titleId) @@ -250,19 +247,7 @@ Rectangle { width: contentItem.width implicitHeight: visible ? 22 : 0 } - - Row { - id: statusListItemTagsSlotInline - anchors.top: statusListItemTertiaryTitle.bottom - width: parent.width - spacing: 10 - clip: true - - Repeater { - model: tagsModel - delegate: tagsDelegate - } - } + } Row { diff --git a/src/StatusQ/Controls/StatusBaseInput.qml b/src/StatusQ/Controls/StatusBaseInput.qml index 1deec179..1dced1c6 100644 --- a/src/StatusQ/Controls/StatusBaseInput.qml +++ b/src/StatusQ/Controls/StatusBaseInput.qml @@ -41,7 +41,6 @@ Item { property real rightPadding: 16 property real topPadding: 12 property real bottomPadding: 12 - property var tabNavItem: null property real minimumHeight: 0 property real maximumHeight: 0 @@ -73,8 +72,6 @@ Item { property Component rightComponent signal iconClicked - signal keyPressed(var event) - signal editClicked() implicitWidth: 448 implicitHeight: multiline ? Math.min(Math.max( @@ -118,8 +115,8 @@ Item { cursorShape: Qt.IBeamCursor onClicked: { edit.forceActiveFocus() - root.editClicked() } + RowLayout { anchors { fill: parent @@ -189,12 +186,7 @@ Item { Keys.onReturnPressed: event.accepted = !multiline Keys.onEnterPressed: event.accepted = !multiline Keys.forwardTo: [root] - KeyNavigation.priority: !!root.tabNavItem ? KeyNavigation.BeforeItem : KeyNavigation.AfterItem - KeyNavigation.tab: root.tabNavItem - Keys.onPressed: { - edit.keyEvent = event.key - root.keyPressed(event); - } + Keys.onPressed: edit.keyEvent = event.key onCursorRectangleChanged: flick.ensureVisible(cursorRectangle) onActiveFocusChanged: if (root.pristine) root.pristine = false diff --git a/src/StatusQ/Controls/StatusInput.qml b/src/StatusQ/Controls/StatusInput.qml index 7b2cdfff..c5d2a913 100644 --- a/src/StatusQ/Controls/StatusInput.qml +++ b/src/StatusQ/Controls/StatusInput.qml @@ -107,8 +107,6 @@ Item { property var pendingValidators: [] signal iconClicked() - signal keyPressed(var event) - signal editClicked() /*! \qmltype ValidationMode @@ -292,12 +290,6 @@ Item { Keys.forwardTo: [root] onIconClicked: root.iconClicked() - onKeyPressed: { - root.keyPressed(event); - } - onEditChanged: { - root.editClicked(); - } } StatusBaseText { diff --git a/src/StatusQ/Controls/StatusSeedPhraseInput.qml b/src/StatusQ/Controls/StatusSeedPhraseInput.qml index 90059962..7d59a798 100644 --- a/src/StatusQ/Controls/StatusSeedPhraseInput.qml +++ b/src/StatusQ/Controls/StatusSeedPhraseInput.qml @@ -7,42 +7,6 @@ import StatusQ.Popups 0.1 import StatusQ.Core 0.1 import StatusQ.Core.Theme 0.1 -/*! - \qmltype StatusSeedPhraseInput - \inherits Item - \inqmlmodule StatusQ.Controls - \since StatusQ.Controls 0.1 - \brief Displays a text input with suggestions. Inherits \l{https://doc.qt.io/qt-5/qml-qtquick-item.html}{Item}. - - The \c StatusSeedPhraseInput item displays a text input with suggestions filtered based on the typed text. - For example: - - \qml - StatusSeedPhraseInput { - id: statusSeedInput - anchors.left: parent.left - anchors.right: parent.right - textEdit.input.anchors.leftMargin: 16 - textEdit.input.anchors.rightMargin: 16 - textEdit.input.anchors.topMargin: 11 - leftComponentText: "1" - inputList: ListModel { - ListElement { - seedWord: "panda" - } - ListElement { - seedWord: "posible" - } - ListElement { - seedWord: "wing" - } - } - } - \endqml - - For a list of components available see StatusQ. -*/ - Item { id: root width: 162 @@ -53,12 +17,6 @@ Item { property ListModel inputList: ListModel { } property ListModel filteredList: ListModel { } signal doneInsertingWord(string word) - /* - This signal is emitted when the user pressed a keyboard key and passes as a - parameter the event. The corresponding handler is \c onKeyPressed. - */ - signal keyPressed(var event) - signal editClicked() onActiveFocusChanged: { if (root.activeFocus) { @@ -99,12 +57,6 @@ Item { seedSuggestionsList.model = 0; } } - onKeyPressed: { - root.keyPressed(event); - } - onEditClicked: { - root.editClicked(); - } } Item {