Reorganize title bar, introduce interaction hint
This commit is contained in:
parent
2c078307dc
commit
473c603451
14 changed files with 109 additions and 30 deletions
|
@ -66,6 +66,13 @@ Page {
|
||||||
overviewPage.chatListCreated = true;
|
overviewPage.chatListCreated = true;
|
||||||
chatListView.scrollToTop();
|
chatListView.scrollToTop();
|
||||||
updateSecondaryContentTimer.start();
|
updateSecondaryContentTimer.start();
|
||||||
|
var remainingInteractionHints = appSettings.remainingInteractionHints;
|
||||||
|
Debug.log("Remaining interaction hints: " + remainingInteractionHints);
|
||||||
|
if (remainingInteractionHints > 0) {
|
||||||
|
interactionHintTimer.start();
|
||||||
|
titleInteractionHint.visible = true;
|
||||||
|
appSettings.remainingInteractionHints = remainingInteractionHints - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +171,6 @@ Page {
|
||||||
if (chatSearchField.text === "") {
|
if (chatSearchField.text === "") {
|
||||||
chatSearchField.visible = false;
|
chatSearchField.visible = false;
|
||||||
pageHeader.visible = true;
|
pageHeader.visible = true;
|
||||||
searchChatButton.visible = overviewPage.connectionState === TelegramAPI.ConnectionReady;
|
|
||||||
}
|
}
|
||||||
chatSearchField.focus = false;
|
chatSearchField.focus = false;
|
||||||
overviewPage.focus = true;
|
overviewPage.focus = true;
|
||||||
|
@ -254,7 +260,14 @@ Page {
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: headerRow
|
id: headerRow
|
||||||
width: parent.width - Theme.horizontalPageMargin
|
width: parent.width
|
||||||
|
|
||||||
|
PageHeader {
|
||||||
|
id: pageHeader
|
||||||
|
title: qsTr("Fernschreiber")
|
||||||
|
leftMargin: Theme.itemSizeMedium
|
||||||
|
opacity: visible ? 1 : 0
|
||||||
|
Behavior on opacity { FadeAnimation {} }
|
||||||
|
|
||||||
GlassItem {
|
GlassItem {
|
||||||
id: pageStatus
|
id: pageStatus
|
||||||
|
@ -266,39 +279,23 @@ Page {
|
||||||
cache: false
|
cache: false
|
||||||
}
|
}
|
||||||
|
|
||||||
PageHeader {
|
MouseArea {
|
||||||
id: pageHeader
|
anchors.fill: parent
|
||||||
title: qsTr("Fernschreiber")
|
|
||||||
width: visible ? ( parent.width - pageStatus.width - searchChatButton.width ) : 0
|
|
||||||
opacity: visible ? 1 : 0
|
|
||||||
Behavior on opacity { FadeAnimation {} }
|
|
||||||
}
|
|
||||||
|
|
||||||
IconButton {
|
|
||||||
id: searchChatButton
|
|
||||||
width: visible ? height : 0
|
|
||||||
opacity: visible ? 1 : 0
|
|
||||||
Behavior on opacity { NumberAnimation {} }
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
icon {
|
|
||||||
source: "image://theme/icon-m-search?" + Theme.highlightColor
|
|
||||||
asynchronous: true
|
|
||||||
}
|
|
||||||
visible: overviewPage.connectionState === TelegramAPI.ConnectionReady
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
chatSearchField.focus = true;
|
chatSearchField.focus = true;
|
||||||
chatSearchField.visible = true;
|
chatSearchField.visible = true;
|
||||||
pageHeader.visible = false;
|
pageHeader.visible = false;
|
||||||
searchChatButton.visible = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
SearchField {
|
SearchField {
|
||||||
id: chatSearchField
|
id: chatSearchField
|
||||||
visible: false
|
visible: false
|
||||||
opacity: visible ? 1 : 0
|
opacity: visible ? 1 : 0
|
||||||
Behavior on opacity { FadeAnimation {} }
|
Behavior on opacity { FadeAnimation {} }
|
||||||
width: visible ? ( parent.width - pageStatus.width ) : 0
|
width: parent.width
|
||||||
height: pageHeader.height
|
height: pageHeader.height
|
||||||
placeholderText: qsTr("Filter your chats...")
|
placeholderText: qsTr("Filter your chats...")
|
||||||
canHide: text === ""
|
canHide: text === ""
|
||||||
|
@ -372,4 +369,22 @@ Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: interactionHintTimer
|
||||||
|
running: false
|
||||||
|
interval: 4000
|
||||||
|
onTriggered: {
|
||||||
|
titleInteractionHint.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InteractionHintLabel {
|
||||||
|
id: titleInteractionHint
|
||||||
|
text: qsTr("Tap on the title bar to filter your chats")
|
||||||
|
visible: false
|
||||||
|
Behavior on opacity { FadeAnimation {} }
|
||||||
|
opacity: visible ? 1 : 0
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ namespace {
|
||||||
const QString KEY_NOTIFICATION_TURNS_DISPLAY_ON("notificationTurnsDisplayOn");
|
const QString KEY_NOTIFICATION_TURNS_DISPLAY_ON("notificationTurnsDisplayOn");
|
||||||
const QString KEY_NOTIFICATION_FEEDBACK("notificationFeedback");
|
const QString KEY_NOTIFICATION_FEEDBACK("notificationFeedback");
|
||||||
const QString KEY_STORAGE_OPTIMIZER("storageOptimizer");
|
const QString KEY_STORAGE_OPTIMIZER("storageOptimizer");
|
||||||
|
const QString KEY_REMAINING_INTERACTION_HINTS("remainingInteractionHints");
|
||||||
}
|
}
|
||||||
|
|
||||||
AppSettings::AppSettings(QObject *parent) : QObject(parent), settings("harbour-fernschreiber", "settings")
|
AppSettings::AppSettings(QObject *parent) : QObject(parent), settings("harbour-fernschreiber", "settings")
|
||||||
|
@ -146,3 +147,17 @@ void AppSettings::setStorageOptimizer(bool enable)
|
||||||
emit storageOptimizerChanged();
|
emit storageOptimizerChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int AppSettings::remainingInteractionHints() const
|
||||||
|
{
|
||||||
|
return settings.value(KEY_REMAINING_INTERACTION_HINTS, 3).toInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppSettings::setRemainingInteractionHints(int remainingHints)
|
||||||
|
{
|
||||||
|
if (remainingInteractionHints() != remainingHints) {
|
||||||
|
LOG(KEY_REMAINING_INTERACTION_HINTS << remainingHints);
|
||||||
|
settings.setValue(KEY_REMAINING_INTERACTION_HINTS, remainingHints);
|
||||||
|
emit remainingInteractionHintsChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ class AppSettings : public QObject {
|
||||||
Q_PROPERTY(bool notificationTurnsDisplayOn READ notificationTurnsDisplayOn WRITE setNotificationTurnsDisplayOn NOTIFY notificationTurnsDisplayOnChanged)
|
Q_PROPERTY(bool notificationTurnsDisplayOn READ notificationTurnsDisplayOn WRITE setNotificationTurnsDisplayOn NOTIFY notificationTurnsDisplayOnChanged)
|
||||||
Q_PROPERTY(NotificationFeedback notificationFeedback READ notificationFeedback WRITE setNotificationFeedback NOTIFY notificationFeedbackChanged)
|
Q_PROPERTY(NotificationFeedback notificationFeedback READ notificationFeedback WRITE setNotificationFeedback NOTIFY notificationFeedbackChanged)
|
||||||
Q_PROPERTY(bool storageOptimizer READ storageOptimizer WRITE setStorageOptimizer NOTIFY storageOptimizerChanged)
|
Q_PROPERTY(bool storageOptimizer READ storageOptimizer WRITE setStorageOptimizer NOTIFY storageOptimizerChanged)
|
||||||
|
Q_PROPERTY(int remainingInteractionHints READ remainingInteractionHints WRITE setRemainingInteractionHints NOTIFY remainingInteractionHintsChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum NotificationFeedback {
|
enum NotificationFeedback {
|
||||||
|
@ -67,6 +68,9 @@ public:
|
||||||
bool storageOptimizer() const;
|
bool storageOptimizer() const;
|
||||||
void setStorageOptimizer(bool enable);
|
void setStorageOptimizer(bool enable);
|
||||||
|
|
||||||
|
int remainingInteractionHints() const;
|
||||||
|
void setRemainingInteractionHints(int remainingHints);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sendByEnterChanged();
|
void sendByEnterChanged();
|
||||||
void focusTextAreaAfterSendChanged();
|
void focusTextAreaAfterSendChanged();
|
||||||
|
@ -76,6 +80,7 @@ signals:
|
||||||
void notificationTurnsDisplayOnChanged();
|
void notificationTurnsDisplayOnChanged();
|
||||||
void notificationFeedbackChanged();
|
void notificationFeedbackChanged();
|
||||||
void storageOptimizerChanged();
|
void storageOptimizerChanged();
|
||||||
|
void remainingInteractionHintsChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
|
@ -1080,6 +1080,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation>Download fehlgeschlagen.</translation>
|
<translation>Download fehlgeschlagen.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation>Tippen Sie auf die Titelleiste, um Ihre Chats zu filtern</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1080,6 +1080,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation>Download failed.</translation>
|
<translation>Download failed.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation>Tap on the title bar to filter your chats</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1069,6 +1069,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation>Error al bajar</translation>
|
<translation>Error al bajar</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1081,6 +1081,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation type="unfinished">Lataus epäonnistui.</translation>
|
<translation type="unfinished">Lataus epäonnistui.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1069,6 +1069,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation type="unfinished">A letöltés nem sikerült.</translation>
|
<translation type="unfinished">A letöltés nem sikerült.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1080,6 +1080,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation type="unfinished">Download non riuscito.</translation>
|
<translation type="unfinished">Download non riuscito.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1091,6 +1091,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1091,6 +1091,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation type="unfinished">Ошибка скачивания.</translation>
|
<translation type="unfinished">Ошибка скачивания.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1080,6 +1080,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation>Nerladdning misslyckades.</translation>
|
<translation>Nerladdning misslyckades.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1069,6 +1069,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation>下载失败。</translation>
|
<translation>下载失败。</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
|
@ -1080,6 +1080,10 @@
|
||||||
<source>Download failed.</source>
|
<source>Download failed.</source>
|
||||||
<translation type="unfinished">Download failed.</translation>
|
<translation type="unfinished">Download failed.</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Tap on the title bar to filter your chats</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>PinnedMessageItem</name>
|
<name>PinnedMessageItem</name>
|
||||||
|
|
Loading…
Reference in a new issue