Skip to content

Commit

Permalink
Hacky fix for #38
Browse files Browse the repository at this point in the history
  • Loading branch information
TronFortyTwo committed Feb 2, 2021
1 parent e45f273 commit 084c62b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
22 changes: 11 additions & 11 deletions po/sturmreader.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: sturmreader.emanuelesorce\n"
"Report-Msgid-Bugs-To: [email protected] - [email protected]\n"
"POT-Creation-Date: 2021-02-02 17:54+0000\n"
"POT-Creation-Date: 2021-02-02 19:35+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -95,50 +95,50 @@ msgstr ""
msgid "No outline available"
msgstr ""

#: ui/qml/BookPage.qml:662
#: ui/qml/BookPage.qml:659
msgid "Book Settings"
msgstr ""

#. / Prefer string of < 16 characters /
#: ui/qml/BookPage.qml:707
#: ui/qml/BookPage.qml:704
msgid "Color scheme"
msgstr ""

#. / Prefer string of < 16 characters /
#: ui/qml/BookPage.qml:774
#: ui/qml/BookPage.qml:771
msgid "Font"
msgstr ""

#: ui/qml/BookPage.qml:784 ui/qml/BookPage.qml:794
#: ui/qml/BookPage.qml:781 ui/qml/BookPage.qml:791
msgid "Default Font"
msgstr ""

#. / Prefer string of < 16 characters /
#: ui/qml/BookPage.qml:807
#: ui/qml/BookPage.qml:804
msgid "Font Scaling"
msgstr ""

#. / Prefer string of < 16 characters /
#: ui/qml/BookPage.qml:831
#: ui/qml/BookPage.qml:828
msgid "Line Height"
msgstr ""

#. / Prefer string of < 16 characters /
#: ui/qml/BookPage.qml:855
#: ui/qml/BookPage.qml:852
msgid "Margins"
msgstr ""

#. / Prefer < 16 characters /
#: ui/qml/BookPage.qml:878
#: ui/qml/BookPage.qml:875
msgid "Make Default"
msgstr ""

#. / Prefer < 16 characters /
#: ui/qml/BookPage.qml:886
#: ui/qml/BookPage.qml:883
msgid "Load Defaults"
msgstr ""

#: ui/qml/BookPage.qml:894
#: ui/qml/BookPage.qml:891
msgid "Close"
msgstr ""

Expand Down
19 changes: 5 additions & 14 deletions ui/qml/BookPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,6 @@ Page {
}
}

onVisibleChanged: {
if(visible)
bookStyles.loadForBook();
}

BusyIndicator {
id: loadingIndicator
width: scaling.dp(50)
Expand Down Expand Up @@ -551,6 +546,7 @@ Page {

function loadForBook() {
var saved = getBookSetting("styles") || {}
console.log(JSON.stringify(saved));
load(saved)
}

Expand Down Expand Up @@ -602,9 +598,10 @@ Page {
// Set the margins to give us the target width, but no more than 30%.
defaults.margin = Math.round(Math.min(50 * (1 - targetwidth/widthgu), 30))

// load defaults
var saveddefault = getSetting("defaultBookStyle")
var savedvals = {}
if (saveddefault != null)
if (saveddefault)
savedvals = JSON.parse(saveddefault)
for (var prop in savedvals)
if (prop in defaults)
Expand Down Expand Up @@ -915,17 +912,9 @@ Page {
lineHeightSlider.value = bookStyles.lineHeight
marginSlider.value = bookStyles.margin
}
/* function onLoadingChanged() {
if (bookStyles.loading == false)
setValues()
}
Component.onCompleted: {
setValues()
bookStyles.onLoadingChanged.connect(onLoadingChanged)
}
Component.onDestruction: {
bookStyles.onLoadingChanged.disconnect(onLoadingChanged)
}*/
}

function updateNavButtons(back, forward) {
Expand Down Expand Up @@ -967,5 +956,7 @@ Page {

Component.onCompleted: {
server.reader.contentsReady.connect(parseContents)
bookStyles.loadForBook();
bookStyles.update();
}
}

0 comments on commit 084c62b

Please sign in to comment.