Remove obsolete Row; Enable animations; Change Hint

This commit is contained in:
John Gibbon 2021-01-02 19:55:41 +01:00 committed by Sebastian Wolf
parent 473c603451
commit 54602d8a6c
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A

View file

@ -70,7 +70,7 @@ Page {
Debug.log("Remaining interaction hints: " + remainingInteractionHints); Debug.log("Remaining interaction hints: " + remainingInteractionHints);
if (remainingInteractionHints > 0) { if (remainingInteractionHints > 0) {
interactionHintTimer.start(); interactionHintTimer.start();
titleInteractionHint.visible = true; titleInteractionHint.opacity = 1.0;
appSettings.remainingInteractionHints = remainingInteractionHints - 1; appSettings.remainingInteractionHints = remainingInteractionHints - 1;
} }
} }
@ -169,8 +169,8 @@ Page {
function resetFocus() { function resetFocus() {
if (chatSearchField.text === "") { if (chatSearchField.text === "") {
chatSearchField.visible = false; chatSearchField.opacity = 0.0;
pageHeader.visible = true; pageHeader.opacity = 1.0;
} }
chatSearchField.focus = false; chatSearchField.focus = false;
overviewPage.focus = true; overviewPage.focus = true;
@ -258,68 +258,62 @@ Page {
} }
} }
Row { PageHeader {
id: headerRow id: pageHeader
width: parent.width title: qsTr("Fernschreiber")
leftMargin: Theme.itemSizeMedium
PageHeader { visible: opacity > 0
id: pageHeader Behavior on opacity { FadeAnimation {} }
title: qsTr("Fernschreiber")
leftMargin: Theme.itemSizeMedium
opacity: visible ? 1 : 0
Behavior on opacity { FadeAnimation {} }
GlassItem {
id: pageStatus
width: Theme.itemSizeMedium
height: Theme.itemSizeMedium
color: "red"
falloffRadius: 0.1
radius: 0.2
cache: false
}
MouseArea {
anchors.fill: parent
onClicked: {
chatSearchField.focus = true;
chatSearchField.visible = true;
pageHeader.visible = false;
}
}
GlassItem {
id: pageStatus
width: Theme.itemSizeMedium
height: Theme.itemSizeMedium
color: "red"
falloffRadius: 0.1
radius: 0.2
cache: false
} }
SearchField { MouseArea {
id: chatSearchField anchors.fill: parent
visible: false onClicked: {
opacity: visible ? 1 : 0 chatSearchField.focus = true;
Behavior on opacity { FadeAnimation {} } chatSearchField.opacity = 1.0;
width: parent.width pageHeader.opacity = 0.0;
height: pageHeader.height
placeholderText: qsTr("Filter your chats...")
canHide: text === ""
onTextChanged: {
searchChatTimer.restart();
}
onHideClicked: {
resetFocus();
}
EnterKey.iconSource: "image://theme/icon-m-enter-close"
EnterKey.onClicked: {
resetFocus();
} }
} }
} }
SearchField {
id: chatSearchField
visible: opacity > 0
opacity: 0
Behavior on opacity { FadeAnimation {} }
width: parent.width
height: pageHeader.height
placeholderText: qsTr("Filter your chats...")
canHide: text === ""
onTextChanged: {
searchChatTimer.restart();
}
onHideClicked: {
resetFocus();
}
EnterKey.iconSource: "image://theme/icon-m-enter-close"
EnterKey.onClicked: {
resetFocus();
}
}
SilicaListView { SilicaListView {
id: chatListView id: chatListView
anchors { anchors {
top: headerRow.bottom top: pageHeader.bottom
bottom: parent.bottom bottom: parent.bottom
left: parent.left left: parent.left
right: parent.right right: parent.right
@ -375,16 +369,18 @@ Page {
running: false running: false
interval: 4000 interval: 4000
onTriggered: { onTriggered: {
titleInteractionHint.visible = false; titleInteractionHint.opacity = 0.0;
} }
} }
InteractionHintLabel { InteractionHintLabel {
id: titleInteractionHint id: titleInteractionHint
text: qsTr("Tap on the title bar to filter your chats") text: qsTr("Tap on the title bar to filter your chats")
visible: false visible: opacity > 0
invert: true
anchors.fill: parent
Behavior on opacity { FadeAnimation {} } Behavior on opacity { FadeAnimation {} }
opacity: visible ? 1 : 0 opacity: 0
} }
} }