[app] Avoid QML runtime warnings

"Unable to assign undefined to bool"
This commit is contained in:
Slava Monich 2020-11-03 05:30:56 +02:00
parent a39ad381b0
commit b220cbd60d

View file

@ -69,7 +69,7 @@ Item {
property alias loadingBackgroundOpacity: loadingBackground.opacity property alias loadingBackgroundOpacity: loadingBackground.opacity
property bool pageActive property bool pageActive
readonly property bool viewActive: pageActive && Qt.application.active && book readonly property bool viewActive: pageActive && Qt.application.active && !!book
readonly property bool haveVolumeUpAction: Settings.volumeUpAction !== BooksSettings.ActionNone readonly property bool haveVolumeUpAction: Settings.volumeUpAction !== BooksSettings.ActionNone
readonly property bool haveVolumeDownAction: Settings.volumeDownAction !== BooksSettings.ActionNone readonly property bool haveVolumeDownAction: Settings.volumeDownAction !== BooksSettings.ActionNone
readonly property bool haveKeyAction: haveVolumeUpAction || haveVolumeDownAction readonly property bool haveKeyAction: haveVolumeUpAction || haveVolumeDownAction
@ -380,7 +380,7 @@ Item {
leftMargin: bookModel.leftMargin leftMargin: bookModel.leftMargin
rightMargin: bookModel.rightMargin rightMargin: bookModel.rightMargin
opacity: _currentState.tools ? 1 : 0 opacity: _currentState.tools ? 1 : 0
visible: opacity > 0 && book && bookModel.pageCount && !loading visible: opacity > 0 && !!book && bookModel.pageCount && !loading
onIncreaseFontSize: bookModel.increaseFontSize() onIncreaseFontSize: bookModel.increaseFontSize()
onDecreaseFontSize: bookModel.decreaseFontSize() onDecreaseFontSize: bookModel.decreaseFontSize()