[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-2020 Slava Monich <slava.monich@jolla.com>
Copyright (C) 2015-2021 Jolla Ltd.
Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
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
})
}
}

View file

@ -1,6 +1,6 @@
/*
Copyright (C) 2015-2020 Jolla Ltd.
Copyright (C) 2015-2020 Slava Monich <slava.monich@jolla.com>
Copyright (C) 2015-2021 Jolla Ltd.
Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
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
})
}
}

View file

@ -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 ===============

View file

@ -126,9 +126,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Bücher</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Libros</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Kirjat</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -124,9 +124,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Könyvek</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Boeken</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -128,9 +128,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Książki</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Livros</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -128,9 +128,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Книги</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Böcker</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -124,9 +124,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation></translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>

View file

@ -126,9 +126,14 @@
</message>
<message id="harbour-books-settings-page-header">
<source>Books</source>
<extracomment>Settings page header</extracomment>
<extracomment>Settings page header (app name)</extracomment>
<translation>Books</translation>
</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">
<source>Display</source>
<extracomment>Section header for display settings</extracomment>