From 21c278dae62ce3aacaf791e8de3ba3ab6aa3eeb6 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Fri, 6 Aug 2021 05:08:37 +0300 Subject: [PATCH] [settings] Show app version and icon in the settings page But only when it's opened from jolla-settings --- app/qml/BooksBookView.qml | 6 ++--- app/qml/BooksStorageView.qml | 6 ++--- app/settings/BooksSettings.qml | 29 ++++++++++++++++++++----- app/translations/harbour-books-de.ts | 7 +++++- app/translations/harbour-books-es.ts | 7 +++++- app/translations/harbour-books-fi.ts | 7 +++++- app/translations/harbour-books-hu.ts | 7 +++++- app/translations/harbour-books-nl.ts | 7 +++++- app/translations/harbour-books-pl.ts | 7 +++++- app/translations/harbour-books-pt.ts | 7 +++++- app/translations/harbour-books-ru.ts | 7 +++++- app/translations/harbour-books-sv.ts | 7 +++++- app/translations/harbour-books-zh_CN.ts | 7 +++++- app/translations/harbour-books.ts | 7 +++++- 14 files changed, 96 insertions(+), 22 deletions(-) diff --git a/app/qml/BooksBookView.qml b/app/qml/BooksBookView.qml index a30b225..67a9b29 100644 --- a/app/qml/BooksBookView.qml +++ b/app/qml/BooksBookView.qml @@ -1,6 +1,6 @@ /* - Copyright (C) 2015-2020 Jolla Ltd. - Copyright (C) 2015-2020 Slava Monich + Copyright (C) 2015-2021 Jolla Ltd. + Copyright (C) 2015-2021 Slava Monich You may use this file under the terms of BSD license as follows: @@ -166,7 +166,7 @@ Item { pageStack.push(settingsComponent, { "title" : text, "allowedOrientations": window.allowedOrientations, - "followOrientationChanges": true + "inApp": true }) } } diff --git a/app/qml/BooksStorageView.qml b/app/qml/BooksStorageView.qml index 10fd852..9f0e1b6 100644 --- a/app/qml/BooksStorageView.qml +++ b/app/qml/BooksStorageView.qml @@ -1,6 +1,6 @@ /* - Copyright (C) 2015-2020 Jolla Ltd. - Copyright (C) 2015-2020 Slava Monich + Copyright (C) 2015-2021 Jolla Ltd. + Copyright (C) 2015-2021 Slava Monich You may use this file under the terms of BSD license as follows: @@ -112,7 +112,7 @@ Item { pageStack.push(_settingsComponent, { "title" : text, "allowedOrientations": window.allowedOrientations, - "followOrientationChanges": true + "inApp": true }) } } diff --git a/app/settings/BooksSettings.qml b/app/settings/BooksSettings.qml index c0ccb3f..af90312 100644 --- a/app/settings/BooksSettings.qml +++ b/app/settings/BooksSettings.qml @@ -41,7 +41,7 @@ import "../qml/harbour" Page { id: page - property bool followOrientationChanges + property bool inApp property alias title: pageHeader.title readonly property string rootPath: "/apps/" + appName() + "/" readonly property bool darkOnLight: ('colorScheme' in Theme) && Theme.colorScheme === 1 @@ -66,7 +66,7 @@ Page { } Loader { - active: followOrientationChanges + active: inApp // Follow orientation changes Connections { target: orientation onValueChanged: allowedOrientations = @@ -125,9 +125,28 @@ Page { PageHeader { id: pageHeader - //: Settings page header - //% "Books" - title: qsTrId("harbour-books-settings-page-header") + rightMargin: Theme.horizontalPageMargin + (appIcon.visible ? (height - appIcon.padding) : 0) + title: applicationName ? applicationName : + //: Settings page header (app name) + //% "Books" + qsTrId("harbour-books-settings-page-header") + description: inApp ? "" : + //: Settings page header description (app version) + //% "Version %1" + qsTrId("harbour-books-settings-version").arg("1.0.43") + + Image { + id: appIcon + readonly property int padding: Theme.paddingLarge + readonly property int size: pageHeader.height - 2 * padding + x: pageHeader.width - width - Theme.horizontalPageMargin + y: padding + width: size + height: size + sourceSize: Qt.size(size,size) + source: applicationIcon ? applicationIcon : "" + visible: appIcon.status === Image.Ready + } } // =============== Display =============== diff --git a/app/translations/harbour-books-de.ts b/app/translations/harbour-books-de.ts index 69b1690..35529bf 100644 --- a/app/translations/harbour-books-de.ts +++ b/app/translations/harbour-books-de.ts @@ -126,9 +126,14 @@ Books - Settings page header + Settings page header (app name) Bücher + + Version %1 + Settings page header description (app version) + Version %1 + Display Section header for display settings diff --git a/app/translations/harbour-books-es.ts b/app/translations/harbour-books-es.ts index 8163599..51120e7 100644 --- a/app/translations/harbour-books-es.ts +++ b/app/translations/harbour-books-es.ts @@ -126,9 +126,14 @@ Books - Settings page header + Settings page header (app name) Libros + + Version %1 + Settings page header description (app version) + Versión %1 + Display Section header for display settings diff --git a/app/translations/harbour-books-fi.ts b/app/translations/harbour-books-fi.ts index fdcbe94..1738017 100644 --- a/app/translations/harbour-books-fi.ts +++ b/app/translations/harbour-books-fi.ts @@ -126,9 +126,14 @@ Books - Settings page header + Settings page header (app name) Kirjat + + Version %1 + Settings page header description (app version) + Versio %1 + Display Section header for display settings diff --git a/app/translations/harbour-books-hu.ts b/app/translations/harbour-books-hu.ts index 8403280..2b61d83 100644 --- a/app/translations/harbour-books-hu.ts +++ b/app/translations/harbour-books-hu.ts @@ -124,9 +124,14 @@ Books - Settings page header + Settings page header (app name) Könyvek + + Version %1 + Settings page header description (app version) + %1 verzió + Display Section header for display settings diff --git a/app/translations/harbour-books-nl.ts b/app/translations/harbour-books-nl.ts index 47ab952..7537e1f 100644 --- a/app/translations/harbour-books-nl.ts +++ b/app/translations/harbour-books-nl.ts @@ -126,9 +126,14 @@ Books - Settings page header + Settings page header (app name) Boeken + + Version %1 + Settings page header description (app version) + Versie %1 + Display Section header for display settings diff --git a/app/translations/harbour-books-pl.ts b/app/translations/harbour-books-pl.ts index 8fa600e..d2ebe61 100644 --- a/app/translations/harbour-books-pl.ts +++ b/app/translations/harbour-books-pl.ts @@ -128,9 +128,14 @@ Books - Settings page header + Settings page header (app name) Książki + + Version %1 + Settings page header description (app version) + Wersja %1 + Display Section header for display settings diff --git a/app/translations/harbour-books-pt.ts b/app/translations/harbour-books-pt.ts index c0c0a91..39bd0b0 100644 --- a/app/translations/harbour-books-pt.ts +++ b/app/translations/harbour-books-pt.ts @@ -126,9 +126,14 @@ Books - Settings page header + Settings page header (app name) Livros + + Version %1 + Settings page header description (app version) + Versão %1 + Display Section header for display settings diff --git a/app/translations/harbour-books-ru.ts b/app/translations/harbour-books-ru.ts index 47bb880..bdbaba3 100644 --- a/app/translations/harbour-books-ru.ts +++ b/app/translations/harbour-books-ru.ts @@ -128,9 +128,14 @@ Books - Settings page header + Settings page header (app name) Книги + + Version %1 + Settings page header description (app version) + Версия %1 + Display Section header for display settings diff --git a/app/translations/harbour-books-sv.ts b/app/translations/harbour-books-sv.ts index efa4eaa..b4b2a79 100644 --- a/app/translations/harbour-books-sv.ts +++ b/app/translations/harbour-books-sv.ts @@ -126,9 +126,14 @@ Books - Settings page header + Settings page header (app name) Böcker + + Version %1 + Settings page header description (app version) + Version %1 + Display Section header for display settings diff --git a/app/translations/harbour-books-zh_CN.ts b/app/translations/harbour-books-zh_CN.ts index e256d75..381a21d 100644 --- a/app/translations/harbour-books-zh_CN.ts +++ b/app/translations/harbour-books-zh_CN.ts @@ -124,9 +124,14 @@ Books - Settings page header + Settings page header (app name) 书籍 + + Version %1 + Settings page header description (app version) + 版本 %1 + Display Section header for display settings diff --git a/app/translations/harbour-books.ts b/app/translations/harbour-books.ts index c3cc03f..0e9c39b 100644 --- a/app/translations/harbour-books.ts +++ b/app/translations/harbour-books.ts @@ -126,9 +126,14 @@ Books - Settings page header + Settings page header (app name) Books + + Version %1 + Settings page header description (app version) + Version %1 + Display Section header for display settings