Compare commits
2 Commits
master
...
work/tobia
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d83a7d995 | ||
|
|
1bd39f282e |
@@ -39,16 +39,6 @@ SearchPage {
|
|||||||
connection: root.connection
|
connection: root.connection
|
||||||
}
|
}
|
||||||
|
|
||||||
listHeaderDelegate: Delegates.RoundedItemDelegate {
|
|
||||||
onClicked: _private.openManualUserDialog()
|
|
||||||
|
|
||||||
activeFocusOnTab: false // We handle moving to this item via up/down arrows, otherwise the tab order is wacky
|
|
||||||
text: i18n("Enter a user ID")
|
|
||||||
icon.name: "list-add-user"
|
|
||||||
icon.width: Kirigami.Units.gridUnit * 2
|
|
||||||
icon.height: Kirigami.Units.gridUnit * 2
|
|
||||||
}
|
|
||||||
|
|
||||||
modelDelegate: Delegates.RoundedItemDelegate {
|
modelDelegate: Delegates.RoundedItemDelegate {
|
||||||
id: userDelegate
|
id: userDelegate
|
||||||
required property string userId
|
required property string userId
|
||||||
@@ -92,6 +82,15 @@ SearchPage {
|
|||||||
noSearchPlaceholderMessage: i18n("Enter text to start searching for your friends")
|
noSearchPlaceholderMessage: i18n("Enter text to start searching for your friends")
|
||||||
noResultPlaceholderMessage: i18nc("@info:label", "No matches found")
|
noResultPlaceholderMessage: i18nc("@info:label", "No matches found")
|
||||||
|
|
||||||
|
noSearchHelpfulAction: noResultHelpfulAction
|
||||||
|
|
||||||
|
noResultHelpfulAction: Kirigami.Action {
|
||||||
|
icon.name: "list-add-user"
|
||||||
|
text: i18nc("@action:button", "Enter a user ID")
|
||||||
|
onTriggered: _private.openManualUserDialog()
|
||||||
|
tooltip: text
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: manualUserDialog
|
id: manualUserDialog
|
||||||
ManualUserDialog {}
|
ManualUserDialog {}
|
||||||
|
|||||||
@@ -56,6 +56,16 @@ SearchPage {
|
|||||||
Component.onCompleted: focusSearch()
|
Component.onCompleted: focusSearch()
|
||||||
|
|
||||||
headerTrailing: RowLayout {
|
headerTrailing: RowLayout {
|
||||||
|
QQC2.Button {
|
||||||
|
icon.name: "list-add"
|
||||||
|
text: i18nc("@action:button", "Enter room by address")
|
||||||
|
display: QQC2.Button.IconOnly
|
||||||
|
|
||||||
|
QQC2.ToolTip.text: text
|
||||||
|
QQC2.ToolTip.visible: hovered
|
||||||
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
||||||
|
onClicked: _private.openManualRoomDialog()
|
||||||
|
}
|
||||||
QQC2.Button {
|
QQC2.Button {
|
||||||
id: spacesOnlyButton
|
id: spacesOnlyButton
|
||||||
icon.name: "globe"
|
icon.name: "globe"
|
||||||
@@ -88,25 +98,6 @@ SearchPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
listHeaderDelegate: Delegates.RoundedItemDelegate {
|
|
||||||
id: delegate
|
|
||||||
|
|
||||||
onClicked: _private.openManualRoomDialog()
|
|
||||||
|
|
||||||
activeFocusOnTab: false // We handle moving to this item via up/down arrows, otherwise the tab order is wacky
|
|
||||||
text: i18n("Enter a Room Manually")
|
|
||||||
visible: publicRoomListModel.redirectedText.length === 0
|
|
||||||
icon.name: "compass"
|
|
||||||
icon.width: Kirigami.Units.gridUnit * 2
|
|
||||||
icon.height: Kirigami.Units.gridUnit * 2
|
|
||||||
|
|
||||||
contentItem: Kirigami.IconTitleSubtitle {
|
|
||||||
icon: icon.fromControlsIcon(delegate.icon)
|
|
||||||
title: delegate.text
|
|
||||||
subtitle: i18n("If you already know a room's address or alias, and it isn't shown here.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
listFooterDelegate: QQC2.ProgressBar {
|
listFooterDelegate: QQC2.ProgressBar {
|
||||||
width: ListView.view.width
|
width: ListView.view.width
|
||||||
leftInset: Kirigami.Units.largeSpacing
|
leftInset: Kirigami.Units.largeSpacing
|
||||||
|
|||||||
@@ -91,6 +91,16 @@ Kirigami.ScrollablePage {
|
|||||||
*/
|
*/
|
||||||
property string customPlaceholderIcon: ""
|
property string customPlaceholderIcon: ""
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Action to be shown in the "no search" placeholder
|
||||||
|
*/
|
||||||
|
property Kirigami.Action noSearchHelpfulAction
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Action to be shown in the "no result" placeholder
|
||||||
|
*/
|
||||||
|
property Kirigami.Action noResultHelpfulAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Force the search field to be focussed.
|
* @brief Force the search field to be focussed.
|
||||||
*/
|
*/
|
||||||
@@ -179,12 +189,14 @@ Kirigami.ScrollablePage {
|
|||||||
id: noSearchMessage
|
id: noSearchMessage
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
visible: searchField.text.length === 0 && listView.count === 0 && customPlaceholder.text.length === 0
|
visible: searchField.text.length === 0 && listView.count === 0 && customPlaceholder.text.length === 0
|
||||||
|
helpfulAction: root.noSearchHelpfulAction
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.PlaceholderMessage {
|
Kirigami.PlaceholderMessage {
|
||||||
id: noResultMessage
|
id: noResultMessage
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
visible: searchField.text.length > 0 && listView.count === 0 && !root.model.searching && customPlaceholder.text.length === 0
|
visible: searchField.text.length > 0 && listView.count === 0 && !root.model.searching && customPlaceholder.text.length === 0
|
||||||
|
helpfulAction: root.noResultHelpfulAction
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.PlaceholderMessage {
|
Kirigami.PlaceholderMessage {
|
||||||
|
|||||||
Reference in New Issue
Block a user