Commit 46e9c13b authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Main/Home): add tooltips, disable `how to use linphone` component

parent 70631b9d
...@@ -698,6 +698,21 @@ Server url not configured.</translation> ...@@ -698,6 +698,21 @@ Server url not configured.</translation>
<source>autoAnswerStatus</source> <source>autoAnswerStatus</source>
<translation>auto</translation> <translation>auto</translation>
</message> </message>
<message>
<source>menuTooltip</source>
<translation>Access to your contact list and add new contacts.</translation>
</message>
<message>
<source>smartSearchBarTooltip</source>
<translation>Use the search bar to directly start audio and video
calls, start a chat or add a new contact. Just enter
your friend&apos;s SIP address or username.</translation>
</message>
<message>
<source>timelineTooltip</source>
<translation>Click on one of your last exchange
to chat or see the conversation history.</translation>
</message>
</context> </context>
<context> <context>
<name>MainWindowMenuBar</name> <name>MainWindowMenuBar</name>
......
...@@ -698,6 +698,20 @@ Url du serveur non configurée.</translation> ...@@ -698,6 +698,20 @@ Url du serveur non configurée.</translation>
<source>autoAnswerStatus</source> <source>autoAnswerStatus</source>
<translation>auto</translation> <translation>auto</translation>
</message> </message>
<message>
<source>menuTooltip</source>
<translation>Accéder à votre liste de contacts, en ajouter...</translation>
</message>
<message>
<source>smartSearchBarTooltip</source>
<translation>Utiliser la barre de recherche intelligente pour lancer des appels audio et vidéo,
un chat ou ajouter un contact.</translation>
</message>
<message>
<source>timelineTooltip</source>
<translation>Cliquer sur une entrée pour voir vos derniers échanges,
chatter ou voir l&apos;historique de conversation.</translation>
</message>
</context> </context>
<context> <context>
<name>MainWindowMenuBar</name> <name>MainWindowMenuBar</name>
......
...@@ -15,6 +15,7 @@ Item { ...@@ -15,6 +15,7 @@ Item {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
readonly property alias filter: searchField.text readonly property alias filter: searchField.text
readonly property alias isOpen: searchBox._isOpen
property alias delegate: list.delegate property alias delegate: list.delegate
property alias header: list.header property alias header: list.header
......
...@@ -4,7 +4,8 @@ import QtQuick 2.7 ...@@ -4,7 +4,8 @@ import QtQuick 2.7
MouseArea { MouseArea {
property alias text: tooltip.text property alias text: tooltip.text
property var tooltipParent: this property bool force: false
property var tooltipParent: parent
property bool _visible: false property bool _visible: false
...@@ -23,6 +24,16 @@ MouseArea { ...@@ -23,6 +24,16 @@ MouseArea {
id: tooltip id: tooltip
parent: tooltipParent parent: tooltipParent
visible: _visible visible: _visible || force
delay: -1
timeout: -1
// Workaround to always display tooltip.
onVisibleChanged: {
if (!visible && force) {
tooltip.visible = true
}
}
} }
} }
...@@ -16,6 +16,8 @@ SearchBox { ...@@ -16,6 +16,8 @@ SearchBox {
searchBox.filter searchBox.filter
) )
readonly property alias isOpen: searchBox._isOpen
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
signal addContact (string sipAddress) signal addContact (string sipAddress)
......
...@@ -12,6 +12,17 @@ import App.Styles 1.0 ...@@ -12,6 +12,17 @@ import App.Styles 1.0
Rectangle { Rectangle {
color: HomeStyle.color color: HomeStyle.color
// TODO: Remove me when smart tooltip will be available.
Component {
Item {
property var i18n: [
QT_TR_NOOP('showTooltips'),
QT_TR_NOOP('howToDescription'),
QT_TR_NOOP('howToTitle')
]
}
}
ListView { ListView {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
...@@ -26,13 +37,14 @@ Rectangle { ...@@ -26,13 +37,14 @@ Rectangle {
} }
model: ListModel { model: ListModel {
ListElement { // TODO: Uncomment me when smart tooltip will be available.
$component: 'checkBox' // ListElement {
$componentText: qsTr('showTooltips') // $component: 'checkBox'
$description: qsTr('howToDescription') // $componentText: qsTr('showTooltips')
$icon: 'home_use_linphone' // $description: qsTr('howToDescription')
$title: qsTr('howToTitle') // $icon: 'home_use_linphone'
} // $title: qsTr('howToTitle')
// }
ListElement { ListElement {
$component: 'button' $component: 'button'
......
...@@ -177,6 +177,11 @@ ApplicationWindow { ...@@ -177,6 +177,11 @@ ApplicationWindow {
}) })
onLaunchVideoCall: CallsListModel.launchVideoCall(sipAddress) onLaunchVideoCall: CallsListModel.launchVideoCall(sipAddress)
TooltipArea {
text: qsTr('smartSearchBarTooltip')
visible: !smartSearchBar.isOpen
}
} }
} }
} }
...@@ -213,6 +218,10 @@ ApplicationWindow { ...@@ -213,6 +218,10 @@ ApplicationWindow {
}] }]
onEntrySelected: !entry ? setView('Home') : setView('Contacts') onEntrySelected: !entry ? setView('Home') : setView('Contacts')
TooltipArea {
text: qsTr('menuTooltip')
}
} }
// History. // History.
...@@ -224,6 +233,10 @@ ApplicationWindow { ...@@ -224,6 +233,10 @@ ApplicationWindow {
model: TimelineModel model: TimelineModel
onEntrySelected: setView('Conversation', { sipAddress: entry }) onEntrySelected: setView('Conversation', { sipAddress: entry })
TooltipArea {
text: qsTr('timelineTooltip')
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment