[app] Added option to hide pulley menu in the book view

This commit is contained in:
Slava Monich 2021-11-13 18:03:10 +02:00
parent 97eafa63a5
commit 091c85d1ce
15 changed files with 183 additions and 24 deletions

View file

@ -65,8 +65,8 @@ Item {
property alias viewInteractive: bookView.interactive
property alias pullDownMenu: menu
property alias isCurrentView: menu.visible
property alias loadingBackgroundOpacity: loadingBackground.opacity
property bool isCurrentView
property bool pageActive
readonly property bool viewActive: pageActive && Qt.application.active && !!book
@ -147,7 +147,7 @@ Item {
PullDownMenu {
id: menu
visible: false // BooksMainPage will make it visible when it's needed
visible: isCurrentView && Settings.bookPullDownMenu
property real backToLibrary

View file

@ -456,6 +456,12 @@ Page {
}
}
Item {
width: 1
height: 1
visible: landscapeLayout // To occupy the grid slot
}
TextSwitch {
width: parent.columnWidth
automaticCheck: false
@ -473,6 +479,24 @@ Page {
defaultValue: false
}
}
TextSwitch {
width: parent.columnWidth
automaticCheck: false
checked: bookPullDownMenu.value
//: Text switch label
//% "Show pulley menu when the book is open"
text: qsTrId("harbour-books-settings-page-book_pulldown_menu")
//: Text switch description
//% "Without the pulley menu, the book has to be closed by swiping it up."
description: qsTrId("harbour-books-settings-page-book_pulldown_menu-description")
onClicked: bookPullDownMenu.value = !bookPullDownMenu.value
ConfigurationValue {
id: bookPullDownMenu
key: rootPath + "bookPullDownMenu"
defaultValue: true
}
}
}
// =============== Memory card ===============

View file

@ -55,6 +55,7 @@
#define KEY_REMOVABLE_ROOT "removableRoot"
#define KEY_INVERT_COLORS "invertColors"
#define KEY_KEEP_DISPLAY_ON "keepDisplayOn"
#define KEY_BOOK_PULL_DOWN_MENU "bookPullDownMenu"
#define KEY_VOLUME_UP_ACTION "volumeUpAction"
#define KEY_VOLUME_DOWN_ACTION "volumeDownAction"
#define KEY_ORIENTATION "orientation"
@ -70,6 +71,7 @@
#define DEFAULT_REMOVABLE_ROOT "Books"
#define DEFAULT_INVERT_COLORS false
#define DEFAULT_KEEP_DISPLAY_ON false
#define DEFAULT_BOOK_PULL_DOWN_MENU true
#define DEFAULT_VOLUME_UP_ACTION (BooksSettings::ActionNextPage)
#define DEFAULT_VOLUME_DOWN_ACTION (BooksSettings::ActionPreviousPage)
#define DEFAULT_ORIENTATION (BooksSettings::OrientationAny)
@ -257,6 +259,7 @@ public:
MGConfItem* iInvertColorsConf;
MGConfItem* iSampleBookCopiedConf;
MGConfItem* iKeepDisplayOnConf;
MGConfItem* iBookPullDownMenuConf;
MGConfItem* iVolumeUpActionConf;
MGConfItem* iVolumeDownActionConf;
MGConfItem* iCurrentFolderConf;
@ -282,6 +285,7 @@ BooksSettings::Private::Private(BooksSettings* aParent) :
iInvertColorsConf(new MGConfItem(DCONF_PATH KEY_INVERT_COLORS, this)),
iSampleBookCopiedConf(new MGConfItem(DCONF_PATH KEY_SAMPLE_BOOK_COPIED, this)),
iKeepDisplayOnConf(new MGConfItem(DCONF_PATH KEY_KEEP_DISPLAY_ON, this)),
iBookPullDownMenuConf(new MGConfItem(DCONF_PATH KEY_BOOK_PULL_DOWN_MENU, this)),
iVolumeUpActionConf(new MGConfItem(DCONF_PATH KEY_VOLUME_UP_ACTION, this)),
iVolumeDownActionConf(new MGConfItem(DCONF_PATH KEY_VOLUME_DOWN_ACTION, this)),
iCurrentFolderConf(new MGConfItem(DCONF_PATH KEY_CURRENT_FOLDER, this)),
@ -302,6 +306,7 @@ BooksSettings::Private::Private(BooksSettings* aParent) :
connect(iTurnPageByTapConf, SIGNAL(valueChanged()), aParent, SIGNAL(turnPageByTapChanged()));
connect(iSampleBookCopiedConf, SIGNAL(valueChanged()), aParent, SIGNAL(sampleBookCopiedChanged()));
connect(iKeepDisplayOnConf, SIGNAL(valueChanged()), aParent, SIGNAL(keepDisplayOnChanged()));
connect(iBookPullDownMenuConf, SIGNAL(valueChanged()), aParent, SIGNAL(bookPullDownMenuChanged()));
connect(iVolumeUpActionConf, SIGNAL(valueChanged()), aParent, SIGNAL(volumeUpActionChanged()));
connect(iVolumeDownActionConf, SIGNAL(valueChanged()), aParent, SIGNAL(volumeDownActionChanged()));
connect(iOrientationConf, SIGNAL(valueChanged()), aParent, SIGNAL(orientationChanged()));
@ -701,19 +706,6 @@ BooksSettings::setInvertColors(
iPrivate->iInvertColorsConf->set(aValue);
}
bool
BooksSettings::sampleBookCopied() const
{
return iPrivate->iSampleBookCopiedConf->value(DEFAULT_SAMPLE_BOOK_COPIED).toBool();
}
void
BooksSettings::setSampleBookCopied()
{
HDEBUG("");
iPrivate->iSampleBookCopiedConf->set(true);
}
bool
BooksSettings::keepDisplayOn() const
{
@ -728,6 +720,34 @@ BooksSettings::setKeepDisplayOn(
iPrivate->iKeepDisplayOnConf->set(aValue);
}
bool
BooksSettings::bookPullDownMenu() const
{
return iPrivate->iBookPullDownMenuConf->value(DEFAULT_BOOK_PULL_DOWN_MENU).toBool();
}
void
BooksSettings::setBookPullDownMenu(
bool aValue)
{
HDEBUG(aValue);
iPrivate->iBookPullDownMenuConf->set(aValue);
}
bool
BooksSettings::sampleBookCopied() const
{
return iPrivate->iSampleBookCopiedConf->value(DEFAULT_SAMPLE_BOOK_COPIED).toBool();
}
void
BooksSettings::setSampleBookCopied()
{
HDEBUG("");
iPrivate->iSampleBookCopiedConf->set(true);
}
BooksSettings::Action
BooksSettings::volumeUpAction() const
{

View file

@ -1,6 +1,6 @@
/*
* Copyright (C) 2015-2020 Jolla Ltd.
* Copyright (C) 2015-2020 Slava Monich <slava.monich@jolla.com>
* Copyright (C) 2015-2021 Jolla Ltd.
* Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@ -55,6 +55,7 @@ class BooksSettings : public QObject
Q_PROPERTY(bool invertColors READ invertColors WRITE setInvertColors NOTIFY invertColorsChanged)
Q_PROPERTY(bool sampleBookCopied READ sampleBookCopied NOTIFY sampleBookCopiedChanged)
Q_PROPERTY(bool keepDisplayOn READ keepDisplayOn WRITE setKeepDisplayOn NOTIFY keepDisplayOnChanged)
Q_PROPERTY(bool bookPullDownMenu READ bookPullDownMenu WRITE setBookPullDownMenu NOTIFY bookPullDownMenuChanged)
Q_PROPERTY(int volumeUpAction READ volumeUpAction WRITE setVolumeUpAction NOTIFY volumeUpActionChanged)
Q_PROPERTY(int volumeDownAction READ volumeDownAction WRITE setVolumeDownAction NOTIFY volumeDownActionChanged)
Q_PROPERTY(QObject* currentBook READ currentBook WRITE setCurrentBook NOTIFY currentBookChanged)
@ -117,12 +118,15 @@ public:
bool invertColors() const; // Night mode
void setInvertColors(bool aValue);
bool sampleBookCopied() const;
void setSampleBookCopied();
bool keepDisplayOn() const;
void setKeepDisplayOn(bool aValue);
bool bookPullDownMenu() const;
void setBookPullDownMenu(bool aValue);
bool sampleBookCopied() const;
void setSampleBookCopied();
Action volumeUpAction() const;
void setVolumeUpAction(int aValue);
@ -158,6 +162,7 @@ Q_SIGNALS:
void invertColorsChanged();
void sampleBookCopiedChanged();
void keepDisplayOnChanged();
void bookPullDownMenuChanged();
void volumeUpActionChanged();
void volumeDownActionChanged();
void currentBookChanged();

View file

@ -277,13 +277,23 @@
<message id="harbour-books-settings-page-turn_pages_by_tap">
<source>Turn pages by tapping the screen</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished"></translation>
<translation type="unfinished">Blättern um, indem auf den Bildschirm tippen</translation>
</message>
<message id="harbour-books-settings-page-turn_pages_by_tap-description">
<source>Tapping near the left edge of the screen returns to the previous page, tapping near the right edge gets you to the next page.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished"></translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished">Schiebemenü anzeigen, wenn das Buch geöffnet ist</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished">Ohne Schiebemenü muss das Buch durch Hochstreichen geschlossen werden.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -284,6 +284,16 @@
<extracomment>Text switch description</extracomment>
<translation>Tocando cerca del borde izquierdo de la pantalla, se regresa a la página anterior; si se toca cerca del borde derecho, se pasa a la página siguiente.</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished">Mostrar menú actualizable cuando el libro está abierto</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished">Sin menú actualizable, el libro debe cerrarse deslizándose hacia arriba.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -277,13 +277,23 @@
<message id="harbour-books-settings-page-turn_pages_by_tap">
<source>Turn pages by tapping the screen</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished"></translation>
<translation type="unfinished">Käännä sivuja napauttamalla näyttöä</translation>
</message>
<message id="harbour-books-settings-page-turn_pages_by_tap-description">
<source>Tapping near the left edge of the screen returns to the previous page, tapping near the right edge gets you to the next page.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished"></translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished">Näytä vetovalikko kun kirja on auki</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished">Ilman vetovalikkoa kirja on suljettava pyyhkäisemällä sitä ylös.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -282,6 +282,16 @@
<extracomment>Text switch description</extracomment>
<translation>Ha a képernyő bal szélét megérinted, az előző oldalra, a jobb szélét megérintve pedig a következő oldalra kerülsz.</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished">A lehúzható menü megjelenítése, amikor a könyv nyitva van</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished">Lehúzható menü nélkül a könyvet felfelé húzással kell bezárni.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -277,13 +277,23 @@
<message id="harbour-books-settings-page-turn_pages_by_tap">
<source>Turn pages by tapping the screen</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished"></translation>
<translation type="unfinished">Pagina&apos;s omslaan door op het scherm te tikken</translation>
</message>
<message id="harbour-books-settings-page-turn_pages_by_tap-description">
<source>Tapping near the left edge of the screen returns to the previous page, tapping near the right edge gets you to the next page.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished"></translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished">Toon uittrekmenu wanneer het boek is geopend</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished">Zonder uittrekmenu moet het boek worden gesloten door het omhoog te vegen.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -286,6 +286,16 @@
<extracomment>Text switch description</extracomment>
<translation>Dotknięcie blisko lewej krawędzi ekranu powoduje powrót do wcześniejszej strony, dotknięcie prawej zmienia stronę na nastepną. </translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished">Pokaż menu wysuwane, gdy książka jest otwarta</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished">Aby zamknąć książkę w przypadku braku menu wysuwane, należy przesunąć w górę o ponad pół ekranu.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -277,13 +277,23 @@
<message id="harbour-books-settings-page-turn_pages_by_tap">
<source>Turn pages by tapping the screen</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished"></translation>
<translation type="unfinished">Vire as páginas tocando na tela</translation>
</message>
<message id="harbour-books-settings-page-turn_pages_by_tap-description">
<source>Tapping near the left edge of the screen returns to the previous page, tapping near the right edge gets you to the next page.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished"></translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished">Mostrar o menu deslizante quando o livro estiver aberto</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished">Sem o menu deslizante, o livro deve ser fechado deslizando-o para cima.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -291,6 +291,16 @@
<extracomment>Section header for memory card settings</extracomment>
<translation>Карта памяти</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation>Показывать вытягиваемое меню при открытой книге</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation>Чтобы закрыть книгу в отсутствие вытягиваемого меню, её надо будет сдвинуть вверх больше, чем на пол-экрана.</translation>
</message>
<message id="harbour-books-settings-page-removable_root-label">
<source>Books folder</source>
<extracomment>Settings field label</extracomment>

View file

@ -284,6 +284,16 @@
<extracomment>Text switch description</extracomment>
<translation>Tryck nära vänster skärmkant, för att återvända till föregående sida. Tryck nära höger skärmkant, för att komma till nästa sida.</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished">Visa rullgardinsmeny när boken är öppen</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished">Utan rullgardinsmeny måste boken stängas genom att svepa uppåt.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -283,6 +283,16 @@
<extracomment>Text switch description</extracomment>
<translation></translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation type="unfinished"></translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation type="unfinished"></translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>

View file

@ -284,6 +284,16 @@
<extracomment>Text switch description</extracomment>
<translation>Tapping near the left edge of the screen returns to the previous page, tapping near the right edge gets you to the next page.</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu">
<source>Show pulley menu when the book is open</source>
<extracomment>Text switch label</extracomment>
<translation>Show pulley menu when the book is open</translation>
</message>
<message id="harbour-books-settings-page-book_pulldown_menu-description">
<source>Without the pulley menu, the book has to be closed by swiping it up.</source>
<extracomment>Text switch description</extracomment>
<translation>Without the pulley menu, the book has to be closed by swiping it up.</translation>
</message>
<message id="harbour-books-settings-page-removable-section_header">
<source>Memory card</source>
<extracomment>Section header for memory card settings</extracomment>