From 78e981d9cb0a89b325a77c4046d5459cb9eece57 Mon Sep 17 00:00:00 2001 From: tronfortytwo Date: Tue, 12 Jan 2021 13:58:02 +0100 Subject: [PATCH] Scaling now will not make very little things on pc monitors a scaling.dp(X) will never return less than X --- po/sturmreader.pot | 196 ++++++++++++++++++++++----------------------- ui/qml/Scaling.qml | 1 + ui/units.cpp | 3 +- 3 files changed, 101 insertions(+), 99 deletions(-) diff --git a/po/sturmreader.pot b/po/sturmreader.pot index 5a43a92..932bbaa 100644 --- a/po/sturmreader.pot +++ b/po/sturmreader.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: sturmreader.emanuelesorce\n" "Report-Msgid-Bugs-To: rschroll@gmail.com - emanuele.sorce@hotmail.com\n" -"POT-Creation-Date: 2021-01-12 13:31+0100\n" +"POT-Creation-Date: 2021-01-12 12:55+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,51 +18,65 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: ui/qml/About.qml:30 -msgid "About" +#: ui/qml/Settings.qml:33 +msgid "Settings" msgstr "" -#: ui/qml/About.qml:75 -msgid "Sturm Reader" +#: ui/qml/Settings.qml:64 ui/qml/Settings.qml:95 +msgid "Default Book Location" msgstr "" -#: ui/qml/About.qml:83 +#: ui/qml/Settings.qml:68 msgid "" -"Sturm (und Drang) Reader is an open source Ebook reader.
Community is " -"what makes this app possible, so pull requests, translations, feedback and " -"donations are very appreciated :)
This app Is a fork of the Beru app by " -"Rshcroll, Thanks!
This app stands on the shoulder of various Open Source " -"projects, see source code for licensing details" +"Sturm Reader seems to be operating under AppArmor restrictions that prevent " +"it from accessing most of your home directory. Ebooks should be put in " +"%1 for Sturm Reader to read them." msgstr "" -#: ui/qml/About.qml:91 +#. / Read the books in the given directory again. / +#: ui/qml/Settings.qml:76 ui/qml/Settings.qml:122 +msgid "Reload Directory" +msgstr "" + +#: ui/qml/Settings.qml:99 msgid "" -"A big thanks to all translators, beta-testers, and users
in general who " -"improve this app with their work and feedback" +"Enter the folder in your home directory where your ebooks are or should be " +"stored. Changing this value will not affect existing books in your library." msgstr "" -#: ui/qml/About.qml:99 -msgid "A special thanks to Joan Cibersheep for the new logo" +#. / Create a new directory from path given. / +#: ui/qml/Settings.qml:113 +msgid "Create Directory" msgstr "" -#: ui/qml/About.qml:107 -msgid "A special thanks to Jeroen for support and a test device" +#. / File exists with path given. / +#: ui/qml/Settings.qml:117 +msgid "File Exists" msgstr "" -#: ui/qml/About.qml:112 -msgid "See source on Github" +#. / Use directory specified to store books. / +#: ui/qml/Settings.qml:125 +msgid "Use Directory" msgstr "" -#: ui/qml/About.qml:120 -msgid "Report bug or feature request" +#: ui/qml/Settings.qml:159 +msgid "Use legacy PDF viewer" msgstr "" -#: ui/qml/About.qml:128 -msgid "See License (GNU GPL v3)" +#: ui/qml/Settings.qml:172 +msgid "Application Style (experimental)" msgstr "" -#: ui/qml/About.qml:135 -msgid "❤Donate❤" +#: ui/qml/Settings.qml:176 +msgid "Supported styles: " +msgstr "" + +#: ui/qml/Settings.qml:181 +msgid "Requires a restart to take effect" +msgstr "" + +#: ui/qml/ImporterUT.qml:51 +msgid "Import books from" msgstr "" #: ui/qml/BookPage.qml:81 @@ -122,38 +136,24 @@ msgstr "" msgid "Close" msgstr "" -#: ui/qml/ImportPage.qml:42 -msgid "Importing books..." -msgstr "" - -#: ui/qml/ImportPage.qml:92 -msgid "Waiting" -msgstr "" - -#: ui/qml/ImportPage.qml:94 -msgid "Processing" -msgstr "" - -#: ui/qml/ImportPage.qml:96 -msgid "Imported to %1" -msgstr "" - -#: ui/qml/ImportPage.qml:98 -msgid "Already in library: %1" +#: ui/qml/Reader.qml:21 +msgid "" +"Could not determine file type.\n" +"\n" +"Remember, Sturm Reader can only open EPUB, PDF, and CBZ files without DRM." msgstr "" -#: ui/qml/ImportPage.qml:100 -msgid "Error: %1" +#: ui/qml/Reader.qml:22 +msgid "" +"Could not parse file.\n" +"\n" +"Although it appears to be a %1 file, it could not be parsed by Sturm Reader." msgstr "" #: ui/qml/ImporterPortable.qml:23 msgid "Choose the books to import" msgstr "" -#: ui/qml/ImporterUT.qml:51 -msgid "Import books from" -msgstr "" - #: ui/qml/LocalBooks.qml:41 msgid "Library" msgstr "" @@ -231,85 +231,85 @@ msgstr "" msgid "Swipe to Delete" msgstr "" -#: ui/qml/Main.qml:106 -msgid "Error Opening File" +#: ui/qml/About.qml:30 +msgid "About" msgstr "" -#: ui/qml/MetricsUT.qml:13 -msgid "Pages read today: %1" +#: ui/qml/About.qml:75 +msgid "Sturm Reader" msgstr "" -#: ui/qml/MetricsUT.qml:14 -msgid "No pages read today" +#: ui/qml/About.qml:83 +msgid "" +"Sturm (und Drang) Reader is an open source Ebook reader.
Community is " +"what makes this app possible, so pull requests, translations, feedback and " +"donations are very appreciated :)
This app Is a fork of the Beru app by " +"Rshcroll, Thanks!
This app stands on the shoulder of various Open Source " +"projects, see source code for licensing details" msgstr "" -#: ui/qml/Reader.qml:21 +#: ui/qml/About.qml:91 msgid "" -"Could not determine file type.\n" -"\n" -"Remember, Sturm Reader can only open EPUB, PDF, and CBZ files without DRM." +"A big thanks to all translators, beta-testers, and users
in general who " +"improve this app with their work and feedback" msgstr "" -#: ui/qml/Reader.qml:22 -msgid "" -"Could not parse file.\n" -"\n" -"Although it appears to be a %1 file, it could not be parsed by Sturm Reader." +#: ui/qml/About.qml:99 +msgid "A special thanks to Joan Cibersheep for the new logo" msgstr "" -#: ui/qml/Settings.qml:33 -msgid "Settings" +#: ui/qml/About.qml:107 +msgid "A special thanks to Jeroen for support and a test device" msgstr "" -#: ui/qml/Settings.qml:64 ui/qml/Settings.qml:95 -msgid "Default Book Location" +#: ui/qml/About.qml:112 +msgid "See source on Github" msgstr "" -#: ui/qml/Settings.qml:68 -msgid "" -"Sturm Reader seems to be operating under AppArmor restrictions that prevent " -"it from accessing most of your home directory. Ebooks should be put in " -"%1 for Sturm Reader to read them." +#: ui/qml/About.qml:120 +msgid "Report bug or feature request" msgstr "" -#. / Read the books in the given directory again. / -#: ui/qml/Settings.qml:76 ui/qml/Settings.qml:122 -msgid "Reload Directory" +#: ui/qml/About.qml:128 +msgid "See License (GNU GPL v3)" msgstr "" -#: ui/qml/Settings.qml:99 -msgid "" -"Enter the folder in your home directory where your ebooks are or should be " -"stored. Changing this value will not affect existing books in your library." +#: ui/qml/About.qml:135 +msgid "❤Donate❤" msgstr "" -#. / Create a new directory from path given. / -#: ui/qml/Settings.qml:113 -msgid "Create Directory" +#: ui/qml/ImportPage.qml:42 +msgid "Importing books..." msgstr "" -#. / File exists with path given. / -#: ui/qml/Settings.qml:117 -msgid "File Exists" +#: ui/qml/ImportPage.qml:92 +msgid "Waiting" msgstr "" -#. / Use directory specified to store books. / -#: ui/qml/Settings.qml:125 -msgid "Use Directory" +#: ui/qml/ImportPage.qml:94 +msgid "Processing" msgstr "" -#: ui/qml/Settings.qml:159 -msgid "Use legacy PDF viewer" +#: ui/qml/ImportPage.qml:96 +msgid "Imported to %1" msgstr "" -#: ui/qml/Settings.qml:172 -msgid "Application Style (experimental)" +#: ui/qml/ImportPage.qml:98 +msgid "Already in library: %1" msgstr "" -#: ui/qml/Settings.qml:176 -msgid "Supported styles: " +#: ui/qml/ImportPage.qml:100 +msgid "Error: %1" msgstr "" -#: ui/qml/Settings.qml:181 -msgid "Requires a restart to take effect" +#: ui/qml/Main.qml:106 +msgid "Error Opening File" +msgstr "" + +#: ui/qml/MetricsUT.qml:13 +msgid "Pages read today: %1" +msgstr "" + +#: ui/qml/MetricsUT.qml:14 +msgid "No pages read today" msgstr "" diff --git a/ui/qml/Scaling.qml b/ui/qml/Scaling.qml index 3b4280b..5bccc79 100644 --- a/ui/qml/Scaling.qml +++ b/ui/qml/Scaling.qml @@ -34,5 +34,6 @@ QtObject { return; } console.log("Scaling implementation: Portable"); + console.log("scaling.dp(100) = " + scaling.dp(100) ); } } diff --git a/ui/units.cpp b/ui/units.cpp index bfa82f5..c27ecd6 100644 --- a/ui/units.cpp +++ b/ui/units.cpp @@ -33,5 +33,6 @@ int Units::dp(double value) const } // Based on 160 DPI as 1:1 to match Android - return qRound(value * (dpi / 160.0) * screen->devicePixelRatio()); + // BUT avoid having too little stuff, preventing 1 dp to be smaller than a real pixel + return qRound( qMax( value * (dpi / 160.0) * screen->devicePixelRatio(), value)); }