Skip to content

Commit

Permalink
Clean up QML pages (#34)
Browse files Browse the repository at this point in the history
* [AboutPage.qml] Clean up

* Delete `qml/scripts/ExternalLinks.js` helper functions

* [Constants.qml] Cleanse and update

* [ComicPage.qml] Omit deleted `../scripts/ExternalLinks.js`

* [ComicInfoPage.qml] Omit deleted `../scripts/ExternalLinks.js`

* [AboutPage.qml] Omit deleted `../scripts/ExternalLinks.js`

* [FavoritesPage.qml] Omit deleted `../scripts/ExternalLinks.js`

* [ImageOverlay.qml] Omit deleted `../scripts/ExternalLinks.js`

* [EndPanel.qml] Use specific article

* Update [ComicInfoPanel.qml] Omit deleted `../scripts/ExternalLinks.js`

* [harbour-dailycomics.qml] Add missing space

* [ComicItem.qml] Omit deleted `../scripts/ExternalLinks.js`

* [ImageOverlay.qml] "url" → "URL"

* [RequestContactDevRectangle.qml] Omit deleted `../scripts/ExternalLinks.js`

* [ZoomableImage.qml] Omit deleted `../scripts/ExternalLinks.js`

* [ComicInfoPanel.qml] Add copyright

* [ComicItem.qml] Add copyright

* [EndPanel.qml] Add copyright

* [ImageOverlay.qml] Add copyright

* [RequestContactDevRectangle.qml] Add copyright

* [RequestContactDevRectangle.qml] Remove extra, empty line

* [ZoomableImage.qml] Add copyright

* [harbour-dailycomics.qml] Add copyright

* [ComicInfoPage.qml] Add copyright

* [ComicPage.qml] Add copyright

* [FavoritesPage.qml] Add empty lines to align `QStr` fields

* [ComicItem.qml] Move added, empty line

* [ComicInfoPanel.qml] Move added, empty line

* [RequestContactDevRectangle.qml] Add empty line to align

* [ZoomableImage.qml] "Can't" → "Cannot"

* [AboutPage.qml] Add word "repository"

* [ComicItem.qml] Re-remove newline

* [ComicInfoPage.qml] Re-remove newline

* [ComicInfoPanel.qml] Re-remove newline

* [EndPanel.qml] Re-add neweline

* [RequestContactDevRectangle.qml] Re-remove newline

* [FavoritesPage.qml] Re-remove two newlines

* [ImageOverlay.qml] Move newline

* [StatusOverlay.qml] Adapt to deleted `../scripts/ExternalLinks.js`

* [ShareLinkPage.qml] Remoive superfluous newline

* [ShareLinkPage.qml] Add copyright

* [harbour-dailycomics.ts] Adapt and fix primary translations file (#35)

* Rename RequestContactDevRectangle.qml to ReportNewComicRectangle.qml

* [harbour-dailycomics.ts] RequestContactDevRectangle.qml → ReportNewComicRectangle.qml
  • Loading branch information
Olf0 authored Oct 15, 2023
1 parent aaaba13 commit 8eb2ba3
Show file tree
Hide file tree
Showing 16 changed files with 146 additions and 335 deletions.
5 changes: 2 additions & 3 deletions qml/components/ComicInfoPanel.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2015 Damien Tardy-Panis <damien@tardypad.me>
* Copyright (c) 2023 olf <Olf0@users.noreply.github.com>
*
* This file is subject to the terms and conditions defined in
* file `LICENSE.txt`, which is part of this source code package.
Expand All @@ -10,8 +11,6 @@ import Sailfish.Silica 1.0

import harbour.dailycomics.Comics 1.0

import "../scripts/ExternalLinks.js" as ExternalLinks

DockedPanel {
id: comicInfoPanel

Expand Down Expand Up @@ -123,7 +122,7 @@ DockedPanel {

MenuItem {
text: qsTr("Go to homepage")
onClicked: ExternalLinks.browse(comic.homepage)
onClicked: Qt.openUrlExternally(comic.homepage)
}
}
}
27 changes: 12 additions & 15 deletions qml/components/ComicItem.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* Copyright (c) 2018-2019 Oleg Linkin <maledictusdemagog@gmail.com>
* Copyright (c) 2020 Mirian Margiani <ichthyosaurus@users.noreply.github.com>
* Copyright (c) 2023 olf <Olf0@users.noreply.github.com>
*
* This file is subject to the terms and conditions defined in
* file `LICENSE.txt`, which is part of this source code package.
Expand All @@ -14,8 +15,6 @@ import harbour.dailycomics.Comics 1.0
import "../utils"
import "../components"

import "../scripts/ExternalLinks.js" as ExternalLinks

ZoomableImage {
id: zoomableImage
imageOpacity: indicator.visible ? Theme.opacityLow : 1.0
Expand All @@ -28,10 +27,10 @@ ZoomableImage {
StatusOverlay {
id: indicator
loadingText: qsTr("Loading comic")
defaultErrorText: qsTr("Can't display comic")
networkErrorText: qsTr("Can't download comic")
parsingErrorText: qsTr("Can't extract comic")
savingErrorText: qsTr("Can't save comic")
defaultErrorText: qsTr("Cannot display comic")
networkErrorText: qsTr("Cannot download comic")
parsingErrorText: qsTr("Cannot extract comic")
savingErrorText: qsTr("Cannot save comic")
}

MouseArea {
Expand All @@ -50,10 +49,7 @@ ZoomableImage {
width: parent.width
height: Theme.itemSizeMedium

onClicked: {
ExternalLinks.mail(constants.maintainerMail, constants.mailErrorSubjectHeader,
constants.mailBodyHeader + 'There is a problem with comic "%1"'.arg(encodeURIComponent(zoomableImage.name)))
}
onClicked: Qt.openUrlExternally(constants.issuesGithub)

Rectangle {
anchors.fill: parent; z: -1
Expand All @@ -65,23 +61,24 @@ ZoomableImage {
Label {
anchors {
leftMargin: Theme.horizontalPageMargin; left: parent.left
rightMargin: Theme.paddingMedium; right: mailButton.left
rightMargin: Theme.paddingMedium; right: githubButton.left
top: parent.top; bottom: parent.bottom
}
verticalAlignment: Text.AlignVCenter
text: qsTr("Please contact me if the problem persists.")
text: qsTr("Please report if this issue persists.")
font.pixelSize: Theme.fontSizeExtraSmall
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
wrapMode: Text.WordWrap
}

HighlightImage {
id: mailButton
id: githubButton
anchors {
right: parent.right; rightMargin: Theme.horizontalPageMargin
verticalCenter: parent.verticalCenter
}
height: Theme.iconSizeMedium; width: height
source: "image://theme/icon-m-mail"
fillMode: Image.PreserveAspectFit
source: Theme.colorScheme == 0 ? "qrc:/icon/light/github" : "qrc:/icon/dark/github"
highlighted: parent.highlighted
}
}
Expand Down
11 changes: 1 addition & 10 deletions qml/components/Constants.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@
import QtQuick 2.0

QtObject {
property string devMail: "damien@tardypad.me"
property url devGithub: "https://github.com/tardypad"

property string maintainerMail: "maledictusdemagog@gmail.com"
property string maintainerGithub: "https://github.com/Maledictus"

property url repoGithub: "https://github.com/sailfishos-applications/daily-comics"

property string mailSubjectHeader: "[SailfishOS][Daily Comics " + Qt.application.version + "] "
property string mailErrorSubjectHeader: "[SailfishOS][Daily Comics " + Qt.application.version + "][Error] "
property string mailBodyHeader: "Yo man, "
property url issuesGithub: "https://github.com/sailfishos-applications/daily-comics/issues"
}
3 changes: 2 additions & 1 deletion qml/components/EndPanel.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2015 Damien Tardy-Panis <damien@tardypad.me>
* Copyright (c) 2023 olf <Olf0@users.noreply.github.com>
*
* This file is subject to the terms and conditions defined in
* file `LICENSE.txt`, which is part of this source code package.
Expand Down Expand Up @@ -51,7 +52,7 @@ DockedPanel {

Label {
id: supportLabel
text: qsTr("If you like the app, please consider supporting your favorite comic artists")
text: qsTr("If you like this app, please consider to support your favorite comic artists")
width: parent.width - supportImage.width - 3*Theme.paddingMedium
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.pixelSize: Theme.fontSizeSmall
Expand Down
9 changes: 4 additions & 5 deletions qml/components/ImageOverlay.qml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/**
* Copyright (c) 2018-2019 Oleg Linkin <maledictusdemagog@gmail.com>
* Copyright (c) 2023 olf <Olf0@users.noreply.github.com>
*
* This file is subject to the terms and conditions defined in
* file `LICENSE.txt`, which is part of this source code package.
**/

import QtQuick 2.0
import Sailfish.Silica 1.0

import harbour.dailycomics.Comics 1.0

import "../utils"
import "../components"

import "../scripts/ExternalLinks.js" as ExternalLinks

Item {
id: overlay

Expand Down Expand Up @@ -90,8 +90,8 @@ Item {
onClicked: {
Clipboard.text = comicProxy.stripImageUrl
window.notify(Clipboard.text !== "" ?
qsTr("Comic strip url copied to clipboard") :
qsTr("Unable to copy comic strip url to clipboard"))
qsTr("Comic strip URL copied to clipboard") :
qsTr("Unable to copy comic strip URL to clipboard"))
}
}

Expand All @@ -118,4 +118,3 @@ Item {
}
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2015 Damien Tardy-Panis <damien@tardypad.me>
* Copyright (c) 2023 olf <Olf0@users.noreply.github.com>
*
* This file is subject to the terms and conditions defined in
* file `LICENSE.txt`, which is part of this source code package.
Expand All @@ -8,8 +9,6 @@
import QtQuick 2.0
import Sailfish.Silica 1.0

import "../scripts/ExternalLinks.js" as ExternalLinks

Item {

property Item flickable
Expand Down Expand Up @@ -38,14 +37,14 @@ Item {
leftMargin: Theme.paddingSmall
verticalCenter: parent.verticalCenter
}
width: parent.width - mailButton.width - 3*Theme.paddingSmall
width: parent.width - githubButton.width - 3*Theme.paddingSmall
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: qsTr("Let me know if you're missing some of your favorite comics in this list")
text: qsTr("Please report if you like to see some additional comic(s)")
font.pixelSize: Theme.fontSizeExtraSmall
}

IconButton {
id: mailButton
id: githubButton
height: Theme.iconSizeMedium
width: Theme.iconSizeMedium
anchors {
Expand All @@ -55,20 +54,15 @@ Item {
verticalCenter: parent.verticalCenter
}
icon {
source: "image://theme/icon-m-mail"
source: Theme.colorScheme == 0 ? "qrc:/icon/light/github" : "qrc:/icon/dark/github"
height: Theme.iconSizeMedium
fillMode: Image.PreserveAspectFit
}
}

MouseArea {
anchors.fill: parent
onClicked: {
var mailRequestMail = constants.maintainerMail
var mailRequestSubject = constants.mailSubjectHeader
var mailRequestMessage = constants.mailBodyHeader + "Please add these comics to the app: "
ExternalLinks.mail(mailRequestMail, mailRequestSubject, mailRequestMessage)
}
onClicked: Qt.openUrlExternally(constants.issuesGithub)
}
}
}
4 changes: 2 additions & 2 deletions qml/components/ZoomableImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) 2015 Damien Tardy-Panis <damien@tardypad.me>
* Copyright (c) 2018-2019 Oleg Linkin <maledictusdemagog@gmail.com>
* Copyright (c) 2020 Mirian Margiani <ichthyosaurus@users.noreply.github.com>
* Copyright (c) 2023 olf <Olf0@users.noreply.github.com>
*
* This file is subject to the terms and conditions defined in
* file `LICENSE.txt`, which is part of this source code package.
Expand All @@ -13,7 +14,6 @@ import harbour.dailycomics.Comics 1.0

import "../utils"
import "../components"
import "../scripts/ExternalLinks.js" as ExternalLinks

SilicaFlickable {
id: zoomableImage
Expand Down Expand Up @@ -154,7 +154,7 @@ SilicaFlickable {
if (status === Image.Ready)
zoomableImage.read()
else if (status === Image.Error) {
zoomableImage.setError(qsTr("Image error"), qsTr("Can't display strip"))
zoomableImage.setError(qsTr("Image error"), qsTr("Cannot display strip"))
}
}

Expand Down
5 changes: 2 additions & 3 deletions qml/harbour-dailycomics.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2015 Damien Tardy-Panis <damien@tardypad.me>
* Copyright (c) 2023 olf <Olf0@users.noreply.github.com>
*
* This file is subject to the terms and conditions defined in
* file `LICENSE.txt`, which is part of this source code package.
Expand Down Expand Up @@ -27,7 +28,7 @@ ApplicationWindow
}

Notification {
id:notification
id: notification
appName: "Daily Comics"
}

Expand All @@ -43,5 +44,3 @@ ApplicationWindow
pageStack.push(Qt.resolvedUrl("pages/NewComicsPage.qml"), {"comicsModel": favoritesPage.comicsModel}, PageStackAction.Immediate)
}
}


Loading

0 comments on commit 8eb2ba3

Please sign in to comment.