diff --git a/qml/components/PhotoTextsListItem.qml b/qml/components/PhotoTextsListItem.qml index f5fbb4b..a728053 100644 --- a/qml/components/PhotoTextsListItem.qml +++ b/qml/components/PhotoTextsListItem.qml @@ -33,15 +33,14 @@ ListItem { height: contentColumn.height spacing: Theme.paddingMedium - Column { - id: pictureColumn + ShaderEffectSource { + id: pictureItem width: contentColumn.height - Theme.paddingSmall height: contentColumn.height - Theme.paddingSmall anchors.verticalCenter: parent.verticalCenter - - Item { - width: parent.width - height: parent.width + sourceItem: Item { + width: pictureItem.width + height: pictureItem.width ProfileThumbnail { id: pictureThumbnail @@ -93,7 +92,7 @@ ListItem { Column { id: contentColumn - width: mainColumn.width - pictureColumn.width - mainRow.spacing + width: mainColumn.width - pictureItem.width - mainRow.spacing spacing: Theme.paddingSmall Row { diff --git a/qml/pages/ChatPage.qml b/qml/pages/ChatPage.qml index dc1c50f..f5f0aeb 100644 --- a/qml/pages/ChatPage.qml +++ b/qml/pages/ChatPage.qml @@ -243,6 +243,10 @@ Page { } else { tdLibWrapper.sendTextMessage(chatInformation.id, newMessageTextField.text, newMessageColumn.replyToMessageId); } + + if(appSettings.focusTextAreaAfterSend) { + lostFocusTimer.start(); + } } controlSendButton(); newMessageInReplyToRow.inReplyToMessage = null; @@ -373,7 +377,9 @@ Page { } Component.onDestruction: { - tdLibWrapper.setChatDraftMessage(chatInformation.id, 0, newMessageColumn.replyToMessageId, newMessageTextField.text); + if (chatPage.canSendMessages) { + tdLibWrapper.setChatDraftMessage(chatInformation.id, 0, newMessageColumn.replyToMessageId, newMessageTextField.text); + } tdLibWrapper.closeChat(chatInformation.id); } @@ -1528,7 +1534,9 @@ Page { if (appSettings.sendByEnter) { sendMessage(); newMessageTextField.text = ""; - newMessageTextField.focus = false; + if(!appSettings.focusTextAreaAfterSend) { + newMessageTextField.focus = false; + } } } @@ -1568,7 +1576,9 @@ Page { onClicked: { sendMessage(); newMessageTextField.text = ""; - newMessageTextField.focus = false; + if(!appSettings.focusTextAreaAfterSend) { + newMessageTextField.focus = false; + } } } } diff --git a/qml/pages/SearchChatsPage.qml b/qml/pages/SearchChatsPage.qml index 82fe385..3e0571b 100644 --- a/qml/pages/SearchChatsPage.qml +++ b/qml/pages/SearchChatsPage.qml @@ -175,13 +175,13 @@ Page { onBasicGroupFullInfoUpdated: { if (foundChatListDelegate.isBasicGroup && groupId.toString() === foundChatListDelegate.foundChatInformation.type.basic_group_id.toString()) { - foundChatListItem.secondaryText.text = qsTr("%1 members").arg(Number(groupFullInfo.members.length).toLocaleString(Qt.locale(), "f", 0)); + foundChatListItem.secondaryText.text = qsTr("%1 members", "", groupFullInfo.members.length).arg(Number(groupFullInfo.members.length).toLocaleString(Qt.locale(), "f", 0)); foundChatListItem.tertiaryText.text = Emoji.emojify(groupFullInfo.description, foundChatListItem.tertiaryText.font.pixelSize, "../js/emoji/"); } } onBasicGroupFullInfoReceived: { if (foundChatListDelegate.isBasicGroup && groupId.toString() === foundChatListDelegate.foundChatInformation.type.basic_group_id.toString()) { - foundChatListItem.secondaryText.text = qsTr("%1 members").arg(Number(groupFullInfo.members.length).toLocaleString(Qt.locale(), "f", 0)); + foundChatListItem.secondaryText.text = qsTr("%1 members", "", groupFullInfo.members.length).arg(Number(groupFullInfo.members.length).toLocaleString(Qt.locale(), "f", 0)); foundChatListItem.tertiaryText.text = Emoji.emojify(groupFullInfo.description, foundChatListItem.tertiaryText.font.pixelSize, "../js/emoji/"); } } @@ -189,9 +189,9 @@ Page { onSupergroupFullInfoUpdated: { if (foundChatListDelegate.isSupergroup && groupId.toString() === foundChatListDelegate.foundChatInformation.type.supergroup_id.toString()) { if (foundChatListDelegate.relatedInformation.is_channel) { - foundChatListItem.secondaryText.text = qsTr("%1 subscribers").arg(Number(groupFullInfo.member_count).toLocaleString(Qt.locale(), "f", 0)); + foundChatListItem.secondaryText.text = qsTr("%1 subscribers", "", groupFullInfo.member_count).arg(Number(groupFullInfo.member_count).toLocaleString(Qt.locale(), "f", 0)); } else { - foundChatListItem.secondaryText.text = qsTr("%1 members").arg(Number(groupFullInfo.member_count).toLocaleString(Qt.locale(), "f", 0)); + foundChatListItem.secondaryText.text = qsTr("%1 members", "", groupFullInfo.member_count).arg(Number(groupFullInfo.member_count).toLocaleString(Qt.locale(), "f", 0)); } foundChatListItem.tertiaryText.text = Emoji.emojify(groupFullInfo.description, foundChatListItem.tertiaryText.font.pixelSize, "../js/emoji/"); } @@ -199,9 +199,9 @@ Page { onSupergroupFullInfoReceived: { if (foundChatListDelegate.isSupergroup && groupId.toString() === foundChatListDelegate.foundChatInformation.type.supergroup_id.toString()) { if (foundChatListDelegate.relatedInformation.is_channel) { - foundChatListItem.secondaryText.text = qsTr("%1 subscribers").arg(Number(groupFullInfo.member_count).toLocaleString(Qt.locale(), "f", 0)); + foundChatListItem.secondaryText.text = qsTr("%1 subscribers", "", groupFullInfo.member_count).arg(Number(groupFullInfo.member_count).toLocaleString(Qt.locale(), "f", 0)); } else { - foundChatListItem.secondaryText.text = qsTr("%1 members").arg(Number(groupFullInfo.member_count).toLocaleString(Qt.locale(), "f", 0)); + foundChatListItem.secondaryText.text = qsTr("%1 members", "", groupFullInfo.member_count).arg(Number(groupFullInfo.member_count).toLocaleString(Qt.locale(), "f", 0)); } foundChatListItem.tertiaryText.text = Emoji.emojify(groupFullInfo.description, foundChatListItem.tertiaryText.font.pixelSize, "../js/emoji/"); } diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index e9abe19..800d5ef 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -52,6 +52,16 @@ Page { } } + TextSwitch { + checked: appSettings.focusTextAreaAfterSend + text: qsTr("Focus text input area after send") + description: qsTr("Focus the text input area after sending a message") + automaticCheck: false + onClicked: { + appSettings.focusTextAreaAfterSend = !checked + } + } + TextSwitch { checked: appSettings.useOpenWith text: qsTr("Open-with menu integration") diff --git a/src/appsettings.cpp b/src/appsettings.cpp index 497578f..0924a42 100644 --- a/src/appsettings.cpp +++ b/src/appsettings.cpp @@ -22,6 +22,7 @@ namespace { const QString KEY_SEND_BY_ENTER("sendByEnter"); + const QString KEY_FOCUS_TEXTAREA_AFTER_SEND("focusTextAreaAfterSend"); const QString KEY_USE_OPEN_WITH("useOpenWith"); const QString KEY_SHOW_STICKERS_AS_IMAGES("showStickersAsImages"); const QString KEY_ANIMATE_STICKERS("animateStickers"); @@ -48,6 +49,20 @@ void AppSettings::setSendByEnter(bool sendByEnter) } } +bool AppSettings::getFocusTextAreaAfterSend() const +{ + return settings.value(KEY_FOCUS_TEXTAREA_AFTER_SEND, false).toBool(); +} + +void AppSettings::setFocusTextAreaAfterSend(bool focusTextAreaAfterSend) +{ + if (getFocusTextAreaAfterSend() != focusTextAreaAfterSend) { + LOG(KEY_FOCUS_TEXTAREA_AFTER_SEND << focusTextAreaAfterSend); + settings.setValue(KEY_FOCUS_TEXTAREA_AFTER_SEND, focusTextAreaAfterSend); + emit focusTextAreaAfterSendChanged(); + } +} + bool AppSettings::getUseOpenWith() const { return settings.value(KEY_USE_OPEN_WITH, true).toBool(); diff --git a/src/appsettings.h b/src/appsettings.h index bb63cdf..a040e60 100644 --- a/src/appsettings.h +++ b/src/appsettings.h @@ -24,6 +24,7 @@ class AppSettings : public QObject { Q_OBJECT Q_PROPERTY(bool sendByEnter READ getSendByEnter WRITE setSendByEnter NOTIFY sendByEnterChanged) + Q_PROPERTY(bool focusTextAreaAfterSend READ getFocusTextAreaAfterSend WRITE setFocusTextAreaAfterSend NOTIFY focusTextAreaAfterSendChanged) Q_PROPERTY(bool useOpenWith READ getUseOpenWith WRITE setUseOpenWith NOTIFY useOpenWithChanged) Q_PROPERTY(bool showStickersAsImages READ showStickersAsImages WRITE setShowStickersAsImages NOTIFY showStickersAsImagesChanged) Q_PROPERTY(bool animateStickers READ animateStickers WRITE setAnimateStickers NOTIFY animateStickersChanged) @@ -45,6 +46,9 @@ public: bool getSendByEnter() const; void setSendByEnter(bool sendByEnter); + bool getFocusTextAreaAfterSend() const; + void setFocusTextAreaAfterSend(bool focusTextAreaAfterSend); + bool getUseOpenWith() const; void setUseOpenWith(bool useOpenWith); @@ -65,6 +69,7 @@ public: signals: void sendByEnterChanged(); + void focusTextAreaAfterSendChanged(); void useOpenWithChanged(); void showStickersAsImagesChanged(); void animateStickersChanged(); diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index e871efc..10db4a5 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -1296,13 +1296,19 @@ Channel Kanal - + %1 members - %1 Mitglied + + %1 Mitglied + %1 Mitglieder + - + %1 subscribers - %1 Abonnent + + %1 Abonnent + %1 Abonnenten + Search Chats @@ -1391,6 +1397,14 @@ Enable storage optimizer Speicheroptimierer einschalten + + Focus text input area after send + Texteingabe nach Senden fokussieren + + + Focus the text input area after sending a message + Fokussiert die Texteingabe nach Senden einer Nachricht + StickerPicker diff --git a/translations/harbour-fernschreiber-en.ts b/translations/harbour-fernschreiber-en.ts index 6e943e0..ffaad43 100644 --- a/translations/harbour-fernschreiber-en.ts +++ b/translations/harbour-fernschreiber-en.ts @@ -1296,13 +1296,19 @@ Channel Channel - + %1 members - %1 member + + %1 member + %1 members + - + %1 subscribers - %1 subscriber + + %1 subscriber + %1 subscribers + Search Chats @@ -1391,6 +1397,14 @@ Enable storage optimizer Enable storage optimizer + + Focus text input area after send + Focus text input area after send + + + Focus the text input area after sending a message + Focus the text input area after sending a message + StickerPicker @@ -1810,21 +1824,21 @@ has added %1 to the chat - has added %1 to the chat + has added %1 to the chat has removed %1 from the chat - has removed %1 from the chat + has removed %1 from the chat have added %1 to the chat myself - have added %1 to the chat + have added %1 to the chat have removed %1 from the chat myself - have removed %1 from the chat + have removed %1 from the chat diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index 06060e9..57c7541 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -263,15 +263,15 @@ Mark chat as unread - + Marcar como no leído Draft - + Borrador Mark chat as read - + Marcar como leído @@ -395,11 +395,11 @@ Search in Chat - + Buscar en charla Search in chat... - + Buscar @@ -777,21 +777,21 @@ has added %1 to the chat - + ha añadido %1 a charla has removed %1 from the chat - + ha quitado %1 de charla have added %1 to the chat myself - + ha añadido %1 a la charla have removed %1 from the chat myself - + ha quitado %1 de charla @@ -828,7 +828,7 @@ Please enter your phone number to continue. - Marcar número de teléfono para continuar. + Marcar el número de teléfono para continuar. Continue @@ -876,7 +876,7 @@ Use the international format, e.g. %1 - Usar el formato internacional %1 + Usa el formato internacional %1 About Fernschreiber @@ -902,7 +902,7 @@ Copy Message to Clipboard - Copiar mensaje + Copiar Message deleted @@ -922,7 +922,7 @@ Select Message - Seleccionar mensaje + Seleccionar Pin Message @@ -930,11 +930,11 @@ Message unpinned - Desanclar mensaje + Mensaje desanclado Unpin Message - + Desanclar mensaje @@ -1055,19 +1055,19 @@ Filter your chats... - + Filtrar las charlas... Search Chats - + Buscar charlas Download of %1 successful. - Bajada de %1 exitosa. + Bajada de %1 exitosa. Download failed. - Error al bajar + Error al bajar @@ -1082,7 +1082,7 @@ Message unpinned - Desanclar mensaje + Mensaje desanclado @@ -1259,43 +1259,47 @@ SearchChatsPage No chats found. - + No se han encontrado charlas. Searching chats... - + Buscando charlas... Private Chat - Privado + Privado Group - + Grupo Channel - + Canal - + %1 members - %1 miembros + + %1 miembros + - + %1 subscribers - %1 suscriptores + + %1 suscriptores + Search Chats - + Buscar charlas Search a chat... - + Buscar una charla... Enter your query to start searching (at least 5 characters needed) - + Introducir la consulta para iniciar la búsqueda (se necesitan al menos 5 caracteres) @@ -1372,6 +1376,14 @@ Enable storage optimizer Optimizador de almacenamiento + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker @@ -1791,21 +1803,21 @@ has added %1 to the chat - + ha añadido %1 a la charla has removed %1 from the chat - + ha quitado %1 de la charla have added %1 to the chat myself - + ha añadido %1 a la charla have removed %1 from the chat myself - + ha añadido %1 de la charla diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index 83349c7..2739023 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -1297,13 +1297,19 @@ Channel - + %1 members - %1 jäsen + + %1 jäsen + + - + %1 subscribers - %1 tilaaja + + %1 tilaaja + + Search Chats @@ -1392,6 +1398,14 @@ Enable storage optimizer Käytä tallennustilan optimointia + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index cbe6a16..630f4ae 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -1277,13 +1277,17 @@ Channel - + %1 members - %1 tag + + %1 tag + - + %1 subscribers - %1 feliratkozott + + %1 feliratkozott + Search Chats @@ -1372,6 +1376,14 @@ Enable storage optimizer + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index 85f802a..5c18e4c 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -1296,13 +1296,19 @@ Channel - + %1 members - %1 membro + + %1 membro + + - + %1 subscribers - %1 abbonato + + %1 abbonato + + Search Chats @@ -1391,6 +1397,14 @@ Enable storage optimizer Abilita ottimizzazione memoria + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index 92fdc5f..dd55b46 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -1315,13 +1315,21 @@ Channel - + %1 members - %1 członek + + %1 członek + + + - + %1 subscribers - %1 subskrybent + + %1 subskrybent + + + Search Chats @@ -1410,6 +1418,14 @@ Enable storage optimizer Włącz optymalizację pamięci + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 481f829..0edb938 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -1315,13 +1315,21 @@ Channel - + %1 members - %1 участников + + %1 участников + + + - + %1 subscribers - %1 подписчиков + + %1 подписчиков + + + Search Chats @@ -1410,6 +1418,14 @@ Enable storage optimizer Включить оптимизацию хранилища + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker diff --git a/translations/harbour-fernschreiber-sv.ts b/translations/harbour-fernschreiber-sv.ts index e3d44d2..2a159af 100644 --- a/translations/harbour-fernschreiber-sv.ts +++ b/translations/harbour-fernschreiber-sv.ts @@ -1296,13 +1296,19 @@ Channel Kanal - + %1 members - %1 medlemmar + + %1 medlemmar + + - + %1 subscribers - %1 prenumeranter + + %1 prenumeranter + + Search Chats @@ -1391,6 +1397,14 @@ Enable storage optimizer Aktivera lagringsoptimering + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index c938305..44d8a9e 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -1277,13 +1277,17 @@ Channel - + %1 members - %1 位成员 + + %1 位成员 + - + %1 subscribers - %1 位订阅者 + + %1 位订阅者 + Search Chats @@ -1372,6 +1376,14 @@ Enable storage optimizer 启用储存加速器 + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index b9adc5e..f0b5aa4 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -1296,13 +1296,19 @@ Channel - + %1 members - %1 member + + %1 member + + - + %1 subscribers - %1 subscriber + + %1 subscriber + + Search Chats @@ -1391,6 +1397,14 @@ Enable storage optimizer + + Focus text input area after send + + + + Focus the text input area after sending a message + + StickerPicker