mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-29 15:57:03 +00:00
feat(StatusTagSelector): Added property showSortedListOnlyWhenText
and make dynamic the implicitHeight
Added property `showSortedListOnlyWhenText` and make dynamic the `implicitHeight` calculation.
This commit is contained in:
parent
7f04c90494
commit
c7a2f6b479
@ -59,10 +59,6 @@ import StatusQ.Core.Theme 0.1
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
implicitWidth: 448
|
|
||||||
implicitHeight: (104 + contactsLabel.height + contactsLabel.anchors.topMargin + (userListView.model.count * 64)) > root.maxHeight ? root.maxHeight :
|
|
||||||
(104 + contactsLabel.height + contactsLabel.anchors.topMargin + (userListView.model.count * 64))
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\qmlproperty real StatusTagSelector::maxHeight
|
\qmlproperty real StatusTagSelector::maxHeight
|
||||||
This property holds the maximum height of the component.
|
This property holds the maximum height of the component.
|
||||||
@ -123,6 +119,12 @@ Item {
|
|||||||
This property holds the asorted names model.
|
This property holds the asorted names model.
|
||||||
*/
|
*/
|
||||||
property ListModel namesModel: ListModel { }
|
property ListModel namesModel: ListModel { }
|
||||||
|
/*!
|
||||||
|
\qmlproperty bool StatusTagSelector::showSortedListOnlyWhenText
|
||||||
|
This property will decide if the sorted list view info is displayed before entering some text in the input or after.
|
||||||
|
By default is set to false.
|
||||||
|
*/
|
||||||
|
property bool showSortedListOnlyWhenText: false
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\qmlmethod
|
\qmlmethod
|
||||||
@ -181,6 +183,19 @@ Item {
|
|||||||
*/
|
*/
|
||||||
signal removeMember(string memberId)
|
signal removeMember(string memberId)
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: d
|
||||||
|
|
||||||
|
property real suggestionContainerHeight: suggestionsContainer.visible ? contactsLabel.height + contactsLabel.anchors.topMargin +
|
||||||
|
suggestionsContainer.anchors.topMargin + suggestionsContainer.anchors.bottomMargin +
|
||||||
|
2 * bgRect.anchors.margins +
|
||||||
|
userListView.anchors.topMargin + userListView.anchors.bottomMargin +
|
||||||
|
(userListView.model.count * 64): 0
|
||||||
|
}
|
||||||
|
|
||||||
|
implicitWidth: 448
|
||||||
|
implicitHeight: (tagSelectorRect.height + d.suggestionContainerHeight) > root.maxHeight ? root.maxHeight : (tagSelectorRect.height + d.suggestionContainerHeight)
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: tagSelectorRect
|
id: tagSelectorRect
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -317,7 +332,8 @@ Item {
|
|||||||
bottomMargin: 16//Style.current.padding
|
bottomMargin: 16//Style.current.padding
|
||||||
}
|
}
|
||||||
clip: true
|
clip: true
|
||||||
visible: ((edit.text === "") || (root.sortedList.count > 0))
|
visible: (!root.showSortedListOnlyWhenText && ((root.sortedList.count > 0) || (edit.text === ""))) ||
|
||||||
|
((edit.text !== "") && (root.sortedList.count > 0))
|
||||||
x: ((root.namesModel.count > 0) && (root.sortedList.count > 0) && ((edit.x + 8) <= (root.width - suggestionsContainer.width)))
|
x: ((root.namesModel.count > 0) && (root.sortedList.count > 0) && ((edit.x + 8) <= (root.width - suggestionsContainer.width)))
|
||||||
? (edit.x + 8) : 0
|
? (edit.x + 8) : 0
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user