[settings] Show app version and icon in the settings page

But only when it's opened from jolla-settings
This commit is contained in:
Slava Monich 2021-08-06 05:08:37 +03:00
parent a2d1214e36
commit 21c278dae6
14 changed files with 96 additions and 22 deletions

View file

@ -1,6 +1,6 @@
/* /*
Copyright (C) 2015-2020 Jolla Ltd. Copyright (C) 2015-2021 Jolla Ltd.
Copyright (C) 2015-2020 Slava Monich <slava.monich@jolla.com> Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
You may use this file under the terms of BSD license as follows: You may use this file under the terms of BSD license as follows:
@ -166,7 +166,7 @@ Item {
pageStack.push(settingsComponent, { pageStack.push(settingsComponent, {
"title" : text, "title" : text,
"allowedOrientations": window.allowedOrientations, "allowedOrientations": window.allowedOrientations,
"followOrientationChanges": true "inApp": true
}) })
} }
} }

View file

@ -1,6 +1,6 @@
/* /*
Copyright (C) 2015-2020 Jolla Ltd. Copyright (C) 2015-2021 Jolla Ltd.
Copyright (C) 2015-2020 Slava Monich <slava.monich@jolla.com> Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
You may use this file under the terms of BSD license as follows: You may use this file under the terms of BSD license as follows:
@ -112,7 +112,7 @@ Item {
pageStack.push(_settingsComponent, { pageStack.push(_settingsComponent, {
"title" : text, "title" : text,
"allowedOrientations": window.allowedOrientations, "allowedOrientations": window.allowedOrientations,
"followOrientationChanges": true "inApp": true
}) })
} }
} }

View file

@ -41,7 +41,7 @@ import "../qml/harbour"
Page { Page {
id: page id: page
property bool followOrientationChanges property bool inApp
property alias title: pageHeader.title property alias title: pageHeader.title
readonly property string rootPath: "/apps/" + appName() + "/" readonly property string rootPath: "/apps/" + appName() + "/"
readonly property bool darkOnLight: ('colorScheme' in Theme) && Theme.colorScheme === 1 readonly property bool darkOnLight: ('colorScheme' in Theme) && Theme.colorScheme === 1
@ -66,7 +66,7 @@ Page {
} }
Loader { Loader {
active: followOrientationChanges active: inApp // Follow orientation changes
Connections { Connections {
target: orientation target: orientation
onValueChanged: allowedOrientations = onValueChanged: allowedOrientations =
@ -125,9 +125,28 @@ Page {
PageHeader { PageHeader {
id: pageHeader id: pageHeader
//: Settings page header rightMargin: Theme.horizontalPageMargin + (appIcon.visible ? (height - appIcon.padding) : 0)
//% "Books" title: applicationName ? applicationName :
title: qsTrId("harbour-books-settings-page-header") //: 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 =============== // =============== Display ===============

View file

@ -126,9 +126,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Bücher</translation> <translation>Bücher</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation type="unfinished">Version %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Libros</translation> <translation>Libros</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation type="unfinished">Versión %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Kirjat</translation> <translation>Kirjat</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation>Versio %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -124,9 +124,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Könyvek</translation> <translation>Könyvek</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation type="unfinished">%1 verzió</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Boeken</translation> <translation>Boeken</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation type="unfinished">Versie %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -128,9 +128,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Książki</translation> <translation>Książki</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation type="unfinished">Wersja %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Livros</translation> <translation>Livros</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation type="unfinished">Versão %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -128,9 +128,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Книги</translation> <translation>Книги</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation>Версия %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Böcker</translation> <translation>Böcker</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation type="unfinished">Version %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -124,9 +124,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation></translation> <translation></translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation type="unfinished"> %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message> </message>
<message id="harbour-books-settings-page-header"> <message id="harbour-books-settings-page-header">
<source>Books</source> <source>Books</source>
<extracomment>Settings page header</extracomment> <extracomment>Settings page header (app name)</extracomment>
<translation>Books</translation> <translation>Books</translation>
</message> </message>
<message id="harbour-books-settings-version">
<source>Version %1</source>
<extracomment>Settings page header description (app version)</extracomment>
<translation>Version %1</translation>
</message>
<message id="harbour-books-settings-page-display-section_header"> <message id="harbour-books-settings-page-display-section_header">
<source>Display</source> <source>Display</source>
<extracomment>Section header for display settings</extracomment> <extracomment>Section header for display settings</extracomment>