diff --git a/app/qml/BooksBookView.qml b/app/qml/BooksBookView.qml index 7ced02f..6fa2aa0 100644 --- a/app/qml/BooksBookView.qml +++ b/app/qml/BooksBookView.qml @@ -217,7 +217,9 @@ SilicaFlickable { } onPageClicked: { root.pageClicked(index) - Settings.pageDetails = (Settings.pageDetails + 1) % _visibilityStates.length + if (!Settings.pageDetailsFixed) { + Settings.pageDetails = (Settings.pageDetails + 1) % _visibilityStates.length + } } onImagePressed: { if (currentPage) { diff --git a/app/src/BooksSettings.cpp b/app/src/BooksSettings.cpp index 6ecadf2..14ac35c 100644 --- a/app/src/BooksSettings.cpp +++ b/app/src/BooksSettings.cpp @@ -45,6 +45,7 @@ #define DCONF_PATH BOOKS_DCONF_ROOT #define KEY_FONT_SIZE "fontSize" #define KEY_PAGE_DETAILS "pageDetails" +#define KEY_PAGE_DETAILS_FIXED "pageDetailsFixed" #define KEY_CURRENT_BOOK "currentBook" #define KEY_CURRENT_FOLDER "currentFolder" #define KEY_REMOVABLE_ROOT "removableRoot" @@ -56,6 +57,7 @@ #define DEFAULT_FONT_SIZE 0 #define DEFAULT_PAGE_DETAILS 0 +#define DEFAULT_PAGE_DETAILS_FIXED false #define DEFAULT_CURRENT_BOOK QString() #define DEFAULT_CURRENT_FOLDER QString() #define DEFAULT_REMOVABLE_ROOT "Books" @@ -233,6 +235,7 @@ public: BooksSettings* iParent; MGConfItem* iFontSizeConf; MGConfItem* iPageDetailsConf; + MGConfItem* iPageDetailsFixedConf; MGConfItem* iInvertColorsConf; MGConfItem* iKeepDisplayOnConf; MGConfItem* iVolumeUpActionConf; @@ -254,6 +257,7 @@ BooksSettings::Private::Private(BooksSettings* aParent) : iParent(aParent), iFontSizeConf(new MGConfItem(DCONF_PATH KEY_FONT_SIZE, this)), iPageDetailsConf(new MGConfItem(DCONF_PATH KEY_PAGE_DETAILS, this)), + iPageDetailsFixedConf(new MGConfItem(DCONF_PATH KEY_PAGE_DETAILS_FIXED, this)), iInvertColorsConf(new MGConfItem(DCONF_PATH KEY_INVERT_COLORS, this)), iKeepDisplayOnConf(new MGConfItem(DCONF_PATH KEY_KEEP_DISPLAY_ON, this)), iVolumeUpActionConf(new MGConfItem(DCONF_PATH KEY_VOLUME_UP_ACTION, this)), @@ -269,6 +273,7 @@ BooksSettings::Private::Private(BooksSettings* aParent) : connect(iCurrentFolderConf, SIGNAL(valueChanged()), SLOT(onCurrentFolderChanged())); connect(iCurrentBookPathConf, SIGNAL(valueChanged()), SLOT(onCurrentBookPathChanged())); connect(iPageDetailsConf, SIGNAL(valueChanged()), iParent, SIGNAL(pageDetailsChanged())); + connect(iPageDetailsFixedConf, SIGNAL(valueChanged()), iParent, SIGNAL(pageDetailsFixedChanged())); connect(iInvertColorsConf, SIGNAL(valueChanged()), iParent, SIGNAL(invertColorsChanged())); connect(iInvertColorsConf, SIGNAL(valueChanged()), iParent, SIGNAL(pageBackgroundColorChanged())); connect(iKeepDisplayOnConf, SIGNAL(valueChanged()), iParent, SIGNAL(keepDisplayOnChanged())); @@ -534,6 +539,20 @@ BooksSettings::setPageDetails( iPrivate->iPageDetailsConf->set(aValue); } +bool +BooksSettings::pageDetailsFixed() const +{ + return iPrivate->iPageDetailsFixedConf->value(DEFAULT_PAGE_DETAILS_FIXED).toBool(); +} + +void +BooksSettings::setPageDetailsFixed( + bool aValue) +{ + HDEBUG(aValue); + iPrivate->iPageDetailsFixedConf->set(aValue); +} + bool BooksSettings::invertColors() const { diff --git a/app/src/BooksSettings.h b/app/src/BooksSettings.h index 620f426..f444108 100644 --- a/app/src/BooksSettings.h +++ b/app/src/BooksSettings.h @@ -48,6 +48,7 @@ class BooksSettings : public QObject Q_ENUMS(Action) Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged) Q_PROPERTY(int pageDetails READ pageDetails WRITE setPageDetails NOTIFY pageDetailsChanged) + Q_PROPERTY(bool pageDetailsFixed READ pageDetailsFixed WRITE setPageDetailsFixed NOTIFY pageDetailsFixedChanged) Q_PROPERTY(bool invertColors READ invertColors WRITE setInvertColors NOTIFY invertColorsChanged) Q_PROPERTY(bool keepDisplayOn READ keepDisplayOn WRITE setKeepDisplayOn NOTIFY keepDisplayOnChanged) Q_PROPERTY(int volumeUpAction READ volumeUpAction WRITE setVolumeUpAction NOTIFY volumeUpActionChanged) @@ -97,6 +98,9 @@ public: int pageDetails() const; void setPageDetails(int aValue); + bool pageDetailsFixed() const; + void setPageDetailsFixed(bool aValue); + shared_ptr textStyle(int aFontSizeAdjust) const; bool invertColors() const; @@ -130,6 +134,7 @@ Q_SIGNALS: void fontSizeChanged(); void textStyleChanged(); void pageDetailsChanged(); + void pageDetailsFixedChanged(); void invertColorsChanged(); void keepDisplayOnChanged(); void volumeUpActionChanged();