[app] Derive tool colors from the color scheme

This commit is contained in:
Slava Monich 2022-10-10 05:44:05 +03:00
parent 2a64b91cde
commit 4156a16c2f
8 changed files with 75 additions and 175 deletions

View file

@ -1,6 +1,6 @@
/*
Copyright (C) 2015-2021 Jolla Ltd.
Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
Copyright (C) 2015-2022 Jolla Ltd.
Copyright (C) 2015-2022 Slava Monich <slava.monich@jolla.com>
You may use this file under the terms of BSD license as follows:
@ -35,6 +35,8 @@ import QtQuick 2.0
import Sailfish.Silica 1.0
import harbour.books 1.0
import "harbour"
Item {
id: pageTools
height: Theme.itemSizeExtraSmall
@ -59,7 +61,7 @@ Item {
}
onClicked: Settings.nightMode = !Settings.nightMode
Image {
HarbourHighlightIcon {
id: dayModeImage
source: "images/day-mode.svg"
anchors {
@ -68,16 +70,18 @@ Item {
verticalCenter: parent.verticalCenter
}
sourceSize.height: Theme.iconSizeSmall
opacity: Settings.nightMode ? 0.5 : 0
highlightColor: Settings.primaryPageToolColor
opacity: Settings.nightMode ? 1 : 0
visible: opacity > 0
Behavior on opacity { FadeAnimation {} }
}
Image {
HarbourHighlightIcon {
source: "images/night-mode.svg"
anchors.centerIn: dayModeImage
sourceSize.height: Theme.iconSizeSmall
opacity: Settings.nightMode ? 0 : 0.25
highlightColor: Settings.primaryPageToolColor
opacity: Settings.nightMode ? 0 : 1
visible: opacity > 0
Behavior on opacity { FadeAnimation {} }
}
@ -93,7 +97,7 @@ Item {
right: parent.right
verticalCenter: parent.verticalCenter
}
Image {
HarbourHighlightIcon {
id: increaseFontSizeButtonImage
source: "images/font-larger.svg"
anchors {
@ -101,8 +105,7 @@ Item {
verticalCenter: parent.verticalCenter
}
sourceSize.height: Theme.iconSizeSmall
opacity: Settings.nightMode ? 1 : 0.5
Behavior on opacity { FadeAnimation {} }
highlightColor: Settings.primaryPageToolColor
}
onClicked: pageTools.increaseFontSize()
}
@ -115,7 +118,7 @@ Item {
right: increaseFontSizeButton.left
verticalCenter: parent.verticalCenter
}
Image {
HarbourHighlightIcon {
id: decreaseFontSizeButtonImage
source: "images/font-smaller.svg"
anchors {
@ -123,8 +126,7 @@ Item {
verticalCenter: parent.verticalCenter
}
sourceSize.height: increaseFontSizeButtonImage.height
opacity: Settings.nightMode ? 1 : 0.5
Behavior on opacity { FadeAnimation {} }
highlightColor: Settings.primaryPageToolColor
}
onClicked: pageTools.decreaseFontSize()
}

View file

@ -1,57 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="100"
height="64"
id="svg4459"
version="1.1"
inkscape:version="0.48.4 r9939"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="font-larger.svg">
<defs
id="defs4461" />
<metadata
id="metadata4464">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<rect
style="opacity:0;fill:#ffffff"
height="64"
width="100"/>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-14,-946.02223)">
<g
style="fill:#808080;fill-opacity:1;stroke:none"
id="text4477"
transform="matrix(1.6163793,0,0,1.5182163,-0.62931024,-534.45853)">
<path
d="m 14,994.18217 7.12,0 0,-7.84 4.32,0 0,7.84 7.12,0 0,4.08 -7.12,0 0,7.84003 -4.32,0 0,-7.84003 -7.12,0 0,-4.08"
id="path5549"
inkscape:connector-curvature="0" />
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="m 14,994.18217 h 7.12 v -7.84 h 4.32 v 7.84 h 7.12 v 4.08 h -7.12 v 7.84003 h -4.32 v -7.84003 H 14 v -4.08"
inkscape:connector-curvature="0"/>
</g>
<g
transform="matrix(1.7406963,0,0,1.7391304,12.768306,943.23962)"
style="fill:#808080;fill-opacity:1;stroke:none"
id="text5562">
transform="matrix(1.7406963,0,0,1.7391304,12.768306,943.23962)">
<path
d="m 53.56,33.8 -11.16,0 0,-1.8 c 1.013315,-0.05333 1.719981,-0.159998 2.12,-0.32 0.39998,-0.159998 0.59998,-0.439997 0.6,-0.84 -2e-5,-0.346663 -0.28002,-1.199996 -0.84,-2.56 L 43,25.12 l -9.76,0 c -0.106675,0.320008 -0.360008,0.920008 -0.76,1.8 -0.400007,0.853339 -0.720007,1.626672 -0.96,2.32 -0.240006,0.666671 -0.360006,1.200003 -0.36,1.6 -6e-6,0.480002 0.22666,0.800002 0.68,0.96 0.479993,0.133335 1.173325,0.200002 2.08,0.2 l 0,1.8 -8.92,0 0,-1.72 c 0.293333,-0.02667 0.573333,-0.08 0.84,-0.16 0.266666,-0.08 0.519999,-0.199998 0.76,-0.36 0.239998,-0.186664 0.453331,-0.346664 0.64,-0.48 0.186664,-0.159997 0.373331,-0.399997 0.56,-0.72 0.21333,-0.319996 0.37333,-0.573329 0.48,-0.76 0.13333,-0.186662 0.306663,-0.493329 0.52,-0.92 0.213329,-0.453328 0.359996,-0.786661 0.44,-1 0.106662,-0.213327 0.266662,-0.58666 0.48,-1.12 0.239995,-0.559992 0.413328,-0.946658 0.52,-1.16 l 8.04,-19.2 1.76,0 9.68,22.24 c 0.639975,1.493337 1.119974,2.400003 1.44,2.72 0.533307,0.560002 1.333306,0.840002 2.4,0.84 l 0,1.8 m -11.52,-11.24 -3.96,-9.28 -3.8,9.28 7.76,0"
id="path5570"
d="M 53.56,33.8 H 42.4 V 32 c 1.013315,-0.05333 1.719981,-0.159998 2.12,-0.32 0.39998,-0.159998 0.59998,-0.439997 0.6,-0.84 -2e-5,-0.346663 -0.28002,-1.199996 -0.84,-2.56 L 43,25.12 h -9.76 c -0.106675,0.320008 -0.360008,0.920008 -0.76,1.8 -0.400007,0.853339 -0.720007,1.626672 -0.96,2.32 -0.240006,0.666671 -0.360006,1.200003 -0.36,1.6 -6e-6,0.480002 0.22666,0.800002 0.68,0.96 0.479993,0.133335 1.173325,0.200002 2.08,0.2 v 1.8 H 25 v -1.72 c 0.293333,-0.02667 0.573333,-0.08 0.84,-0.16 0.266666,-0.08 0.519999,-0.199998 0.76,-0.36 0.239998,-0.186664 0.453331,-0.346664 0.64,-0.48 0.186664,-0.159997 0.373331,-0.399997 0.56,-0.72 0.21333,-0.319996 0.37333,-0.573329 0.48,-0.76 0.13333,-0.186662 0.306663,-0.493329 0.52,-0.92 0.213329,-0.453328 0.359996,-0.786661 0.44,-1 0.106662,-0.213327 0.266662,-0.58666 0.48,-1.12 0.239995,-0.559992 0.413328,-0.946658 0.52,-1.16 L 38.28,6.2 h 1.76 l 9.68,22.24 c 0.639975,1.493337 1.119974,2.400003 1.44,2.72 0.533307,0.560002 1.333306,0.840002 2.4,0.84 v 1.8 m -11.52,-11.24 -3.96,-9.28 -3.8,9.28 h 7.76"
inkscape:connector-curvature="0"
style="fill:#808080;fill-opacity:1" />
style="fill:#ffffff;fill-opacity:1"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

@ -1,57 +1,33 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg4449"
version="1.1"
inkscape:version="0.48.4 r9939"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="font-smaller.svg">
<defs
id="defs4451" />
<metadata
id="metadata4454">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<rect
style="opacity:0;fill:#ffffff"
height="64"
width="64"/>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer"
transform="translate(-14,49.620001)">
<g
style="fill:#808080;fill-opacity:1;stroke:none"
id="text4469"
transform="matrix(1.2081784,0,0,1.1261261,5.0855019,-14.592736)">
<path
d="m 14,2.7799982 10.76,0 0,4.44 -10.76,0 0,-4.44"
id="path5540"
inkscape:connector-curvature="0" />
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="m 14,2.7799982 h 10.76 v 4.44 H 14 v -4.44"
inkscape:connector-curvature="0"/>
</g>
<g
transform="matrix(1.7673813,0,0,1.7057569,5.0734262,-43.73514)"
style="fill:#808080;fill-opacity:1;stroke:none"
id="text5558">
transform="matrix(1.7673813,0,0,1.7057569,5.0734262,-43.73514)">
<path
d="m 20.72,15.14 c -2e-6,-0.293319 0.09333,-0.653319 0.28,-1.08 0.186664,-0.453318 0.49333,-0.946651 0.92,-1.48 0.453329,-0.559983 1.159995,-1.026649 2.12,-1.4 0.959993,-0.373315 2.106659,-0.559982 3.44,-0.56 2.186655,1.8e-5 3.679987,0.520018 4.48,1.56 0.826652,1.013349 1.239985,2.773347 1.24,5.28 l 0,8.4 c -1.5e-5,0.826669 0.306652,1.240001 0.92,1.24 0.479984,10e-7 1.173316,-0.306665 2.08,-0.92 l 0,1.04 c -0.400017,0.480001 -0.93335,0.96 -1.6,1.44 -0.640016,0.479999 -1.213348,0.719999 -1.72,0.72 -0.960014,-10e-7 -1.666679,-0.293334 -2.12,-0.88 -0.453345,-0.586666 -0.706678,-1.319999 -0.76,-2.2 -2.213343,2.053334 -4.133341,3.079999 -5.76,3.08 -1.200005,-10e-7 -2.213337,-0.413334 -3.04,-1.24 -0.800002,-0.826665 -1.200002,-1.826664 -1.2,-3 -2e-6,-0.586663 0.09333,-1.133329 0.28,-1.64 0.213331,-0.533328 0.466664,-0.999994 0.76,-1.4 0.29333,-0.399993 0.69333,-0.786659 1.2,-1.16 0.506662,-0.399992 0.973329,-0.733325 1.4,-1 0.426661,-0.266658 0.959994,-0.533324 1.6,-0.8 0.666659,-0.293324 1.199992,-0.51999 1.6,-0.68 0.426658,-0.15999 0.959991,-0.35999 1.6,-0.6 0.666656,-0.239989 1.133322,-0.413322 1.4,-0.52 -1.1e-5,-2.239986 -0.186678,-3.759985 -0.56,-4.56 -0.373344,-0.82665 -1.16001,-1.239983 -2.36,-1.24 -0.453341,1.7e-5 -0.960008,0.106684 -1.52,0.32 -0.53334,0.21335 -0.906673,0.480016 -1.12,0.8 -0.05334,0.213349 -0.08001,0.413349 -0.08,0.6 -6e-6,0.133349 0.01333,0.400015 0.04,0.8 0.02666,0.373348 0.03999,0.680014 0.04,0.92 -6e-6,0.453347 -0.186672,0.86668 -0.56,1.24 -0.346672,0.373345 -0.746671,0.560012 -1.2,0.56 -0.58667,1.2e-5 -1.040003,-0.146655 -1.36,-0.44 -0.293336,-0.319987 -0.440002,-0.719987 -0.44,-1.2 m 9.12,10.04 0,-6.8 c -0.266678,0.106677 -0.706677,0.28001 -1.32,0.52 -0.613343,0.213343 -1.106676,0.400009 -1.48,0.56 -0.373342,0.133342 -0.813341,0.346675 -1.32,0.64 -0.506673,0.266675 -0.906673,0.560008 -1.2,0.88 -0.266673,0.293341 -0.506672,0.680007 -0.72,1.16 -0.213339,0.453339 -0.320005,0.973339 -0.32,1.56 -5e-6,0.933337 0.239995,1.720003 0.72,2.36 0.50666,0.613335 1.213326,0.920002 2.12,0.92 0.479992,2e-6 1.133324,-0.186665 1.96,-0.56 0.853323,-0.399997 1.373322,-0.81333 1.56,-1.24"
id="path5567"
d="m 20.72,15.14 c -2e-6,-0.293319 0.09333,-0.653319 0.28,-1.08 0.186664,-0.453318 0.49333,-0.946651 0.92,-1.48 0.453329,-0.559983 1.159995,-1.026649 2.12,-1.4 0.959993,-0.373315 2.106659,-0.559982 3.44,-0.56 2.186655,1.8e-5 3.679987,0.520018 4.48,1.56 0.826652,1.013349 1.239985,2.773347 1.24,5.28 v 8.4 c -1.5e-5,0.826669 0.306652,1.240001 0.92,1.24 0.479984,10e-7 1.173316,-0.306665 2.08,-0.92 v 1.04 c -0.400017,0.480001 -0.93335,0.96 -1.6,1.44 -0.640016,0.479999 -1.213348,0.719999 -1.72,0.72 -0.960014,-10e-7 -1.666679,-0.293334 -2.12,-0.88 -0.453345,-0.586666 -0.706678,-1.319999 -0.76,-2.2 -2.213343,2.053334 -4.133341,3.079999 -5.76,3.08 -1.200005,-10e-7 -2.213337,-0.413334 -3.04,-1.24 -0.800002,-0.826665 -1.200002,-1.826664 -1.2,-3 -2e-6,-0.586663 0.09333,-1.133329 0.28,-1.64 0.213331,-0.533328 0.466664,-0.999994 0.76,-1.4 0.29333,-0.399993 0.69333,-0.786659 1.2,-1.16 0.506662,-0.399992 0.973329,-0.733325 1.4,-1 0.426661,-0.266658 0.959994,-0.533324 1.6,-0.8 0.666659,-0.293324 1.199992,-0.51999 1.6,-0.68 0.426658,-0.15999 0.959991,-0.35999 1.6,-0.6 0.666656,-0.239989 1.133322,-0.413322 1.4,-0.52 -1.1e-5,-2.239986 -0.186678,-3.759985 -0.56,-4.56 -0.373344,-0.82665 -1.16001,-1.239983 -2.36,-1.24 -0.453341,1.7e-5 -0.960008,0.106684 -1.52,0.32 -0.53334,0.21335 -0.906673,0.480016 -1.12,0.8 -0.05334,0.213349 -0.08001,0.413349 -0.08,0.6 -6e-6,0.133349 0.01333,0.400015 0.04,0.8 0.02666,0.373348 0.03999,0.680014 0.04,0.92 -6e-6,0.453347 -0.186672,0.86668 -0.56,1.24 -0.346672,0.373345 -0.746671,0.560012 -1.2,0.56 -0.58667,1.2e-5 -1.040003,-0.146655 -1.36,-0.44 -0.293336,-0.319987 -0.440002,-0.719987 -0.44,-1.2 m 9.12,10.04 v -6.8 c -0.266678,0.106677 -0.706677,0.28001 -1.32,0.52 -0.613343,0.213343 -1.106676,0.400009 -1.48,0.56 -0.373342,0.133342 -0.813341,0.346675 -1.32,0.64 -0.506673,0.266675 -0.906673,0.560008 -1.2,0.88 -0.266673,0.293341 -0.506672,0.680007 -0.72,1.16 -0.213339,0.453339 -0.320005,0.973339 -0.32,1.56 -5e-6,0.933337 0.239995,1.720003 0.72,2.36 0.50666,0.613335 1.213326,0.920002 2.12,0.92 0.479992,2e-6 1.133324,-0.186665 1.96,-0.56 0.853323,-0.399997 1.373322,-0.81333 1.56,-1.24"
inkscape:connector-curvature="0"
style="fill:#808080;fill-opacity:1" />
style="fill:#ffffff;fill-opacity:1"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -1,75 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg2"
version="1.1"
inkscape:version="0.48.4 r9939"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="night-mode.svg">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-988.36215)">
<path
sodipodi:type="arc"
style="opacity:0;fill:#000000;fill-opacity:0.50196078;stroke:#808080;stroke-width:10;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path3778"
sodipodi:cx="42.5"
sodipodi:cy="52.5"
sodipodi:rx="27.5"
sodipodi:ry="27.5"
d="m 70,52.5 a 27.5,27.5 0 1 1 -55,0 27.5,27.5 0 1 1 55,0 z"
transform="matrix(0.48,0,0,0.48,9.180329,978.36216)" />
<path
sodipodi:type="arc"
style="opacity:0;fill:#000000;fill-opacity:0.50196078;stroke:#000000;stroke-width:10;stroke-linecap:square;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path3790"
sodipodi:cx="47.5"
sodipodi:cy="50"
sodipodi:rx="32.5"
sodipodi:ry="35"
d="M 80,50 C 80,69.329966 65.449254,85 47.5,85 29.550746,85 15,69.329966 15,50 15,30.670034 29.550746,15 47.5,15 65.449254,15 80,30.670034 80,50 z"
transform="matrix(0.48,0,0,0.48,21.180329,978.36216)" />
<g
transform="matrix(0.33942251,-0.33942251,0.33942251,0.33942251,-0.9,1024.6049)"
id="g8">
<rect
id="rect3794"
height="48"
width="48"
style="fill:none"
x="0"
y="0" />
style="opacity:0;fill:#ffffff"
height="64"
width="64"/>
<g
transform="translate(0,-988.36215)">
<g
transform="matrix(0.33942251,-0.33942251,0.33942251,0.33942251,-0.9,1024.6049)">
<path
id="path3800"
d="m 54.714286,-7.78571 c -27.611111,0 -50.0000003,22.388889 -50.0000003,50 0,27.611111 22.3888893,50 50.0000003,50 27.611111,0 50.000004,-22.388889 50.000004,-50 0,-27.611111 -22.388893,-50 -50.000004,-50 z m 9.781481,83.492593 c -2.925925,0.8 -5.996296,1.229629 -9.174074,1.229629 -19.177777,0 -34.388888,-15.540741 -34.388888,-34.722222 0,-19.174074 15.211111,-34.722222 34.388888,-34.722222 3.174074,0 6.248149,0.433333 9.174074,1.237037 -14.729629,4.018518 -25.04074,17.485185 -25.04074,33.485185 0,16 10.311111,29.462963 25.04074,33.492593 z"
style="fill:#000000;fill-opacity:1"
style="fill:#ffffff;fill-opacity:1"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ssssscssscsc" />
sodipodi:nodetypes="ssssscssscsc"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -75,10 +75,6 @@
#define DEFAULT_VOLUME_DOWN_ACTION (BooksSettings::ActionPreviousPage)
#define DEFAULT_ORIENTATION (BooksSettings::OrientationAny)
#define PAGETOOL_COLOR QColor(128,128,128) // any bg
#define NORMAL_PAGETOOL_HIGHLIGHT_COLOR QColor(64,64,64) // on white
#define INVERTED_PAGETOOL_HIGHLIGHT_COLOR QColor(192,192,192) // on black
// ==========================================================================
// BooksSettings::TextStyle
// ==========================================================================
@ -366,7 +362,6 @@ BooksSettings::Private::onNightModeChanged()
if (updateBrightness()) {
Q_EMIT settings->brightnessChanged();
}
Q_EMIT settings->highlightPageToolColorChanged();
}
void
@ -820,20 +815,6 @@ BooksSettings::orientation() const
return DEFAULT_ORIENTATION;
}
QColor
BooksSettings::primaryPageToolColor() const
{
return PAGETOOL_COLOR;
}
QColor
BooksSettings::highlightPageToolColor() const
{
return nightMode() ?
INVERTED_PAGETOOL_HIGHLIGHT_COLOR :
NORMAL_PAGETOOL_HIGHLIGHT_COLOR;
}
void
BooksSettings::setCurrentBookPath(
QString aPath)

View file

@ -64,8 +64,6 @@ class BooksSettings : public BooksSettingsBase
Q_PROPERTY(QString relativePath READ relativePath NOTIFY relativePathChanged)
Q_PROPERTY(QString removableRoot READ removableRoot NOTIFY removableRootChanged)
Q_PROPERTY(int orientation READ orientation NOTIFY orientationChanged)
Q_PROPERTY(QColor primaryPageToolColor READ primaryPageToolColor CONSTANT)
Q_PROPERTY(QColor highlightPageToolColor READ highlightPageToolColor NOTIFY highlightPageToolColorChanged)
class TextStyle;
public:
@ -95,60 +93,57 @@ public:
Q_INVOKABLE bool increaseFontSize();
Q_INVOKABLE bool decreaseFontSize();
shared_ptr<ZLTextStyle> textStyle(int aFontSizeAdjust) const;
shared_ptr<ZLTextStyle> textStyle(int) const;
int fontSize() const;
void setFontSize(int aValue);
qreal brightness() const;
qreal nightModeBrightness() const;
void setNightModeBrightness(qreal aValue);
void setNightModeBrightness(qreal);
int pageDetails() const;
void setPageDetails(int aValue);
void setPageDetails(int);
bool pageDetailsFixed() const;
void setPageDetailsFixed(bool aValue);
void setPageDetailsFixed(bool);
bool turnPageByTap() const;
void setTurnPageByTap(bool aValue);
void setTurnPageByTap(bool);
bool keepDisplayOn() const;
void setKeepDisplayOn(bool aValue);
void setKeepDisplayOn(bool);
bool bookPullDownMenu() const;
void setBookPullDownMenu(bool aValue);
void setBookPullDownMenu(bool);
bool sampleBookCopied() const;
void setSampleBookCopied();
Action volumeUpAction() const;
void setVolumeUpAction(int aValue);
void setVolumeUpAction(int);
Action volumeDownAction() const;
void setVolumeDownAction(int aValue);
void setVolumeDownAction(int);
QObject* currentBook() const;
void setCurrentBook(QObject* aBook);
void setCurrentBook(QObject*);
QString relativePath() const;
QString removableRoot() const;
QString currentFolder() const;
void setCurrentFolder(const QString aValue);
void setCurrentFolder(const QString);
QString currentStorage() const;
QColor primaryPageToolColor() const;
QColor highlightPageToolColor() const;
Orientation orientation() const;
public Q_SLOTS:
void setCurrentBookPath(QString aPath);
void setCurrentBookPath(QString);
Q_SIGNALS:
void fontSizeChanged();
void nightModeBrightnessChanged();
void highlightPageToolColorChanged();
void brightnessChanged();
void textStyleChanged();
void pageDetailsChanged();

View file

@ -430,6 +430,20 @@ BooksSettingsBase::invertedPageBackgroundColor() const
return QColor(HarbourUtil::invertedRgb(iPrivate->iColorScheme.background()));
}
QColor
BooksSettingsBase::primaryPageToolColor() const
{
const QRgb rgb = iPrivate->iColorScheme.foreground();
return QColor(qRed(rgb), qGreen(rgb), qBlue(rgb), 128);
}
QColor
BooksSettingsBase::highlightPageToolColor() const
{
const QRgb rgb = iPrivate->iColorScheme.foreground();
return QColor(qRed(rgb), qGreen(rgb), qBlue(rgb), 192);
}
BooksColorScheme
BooksSettingsBase::colorScheme() const
{

View file

@ -49,6 +49,8 @@ class BooksSettingsBase : public QObject
Q_PROPERTY(bool nightMode READ nightMode WRITE setNightMode NOTIFY nightModeChanged)
Q_PROPERTY(QColor pageBackgroundColor READ pageBackgroundColor NOTIFY colorSchemeChanged)
Q_PROPERTY(QColor invertedPageBackgroundColor READ invertedPageBackgroundColor NOTIFY colorSchemeChanged)
Q_PROPERTY(QColor primaryPageToolColor READ primaryPageToolColor NOTIFY colorSchemeChanged)
Q_PROPERTY(QColor highlightPageToolColor READ highlightPageToolColor NOTIFY colorSchemeChanged)
Q_PROPERTY(BooksColorScheme colorScheme READ colorScheme NOTIFY colorSchemeChanged)
Q_PROPERTY(BooksColorScheme customColorScheme READ customColorScheme WRITE setCustomColorScheme NOTIFY customColorSchemeChanged)
Q_PROPERTY(BooksColorScheme customNightModeColorScheme READ customNightModeColorScheme NOTIFY customColorSchemeChanged)
@ -69,6 +71,8 @@ public:
QColor pageBackgroundColor() const;
QColor invertedPageBackgroundColor() const;
QColor primaryPageToolColor() const;
QColor highlightPageToolColor() const;
BooksColorScheme colorScheme() const;
BooksColorScheme customColorScheme() const;
@ -76,7 +80,7 @@ public:
void setCustomColorScheme(const BooksColorScheme);
bool useCustomColorScheme() const;
void setUseCustomColorScheme(bool aValue);
void setUseCustomColorScheme(bool);
const QStringList defaultColors() const;
QStringList availableColors() const;