diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a5e27df..11f319f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,20 +136,24 @@ install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/48/bookworm.png DESTINATIO install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/64/bookworm.png DESTINATION share/icons/hicolor/64x64/apps) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/128/bookworm.png DESTINATION share/icons/hicolor/128x128/apps) #install bookworm specific icons in application specific folder - /usr/share/bookworm -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-go-next.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-go-previous.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-list-add.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-list-remove.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-view-grid-symbolic.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-view-list-symbolic.png DESTINATION share/bookworm/icons/hicolor/24x24/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-bookmark-inactive.png DESTINATION share/bookworm/icons/hicolor/24x24/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-bookmark-active.png DESTINATION share/bookworm/icons/hicolor/24x24/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-selection-checked.svg DESTINATION share/bookworm/icons/hicolor/24x24/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-selection-option.svg DESTINATION share/bookworm/icons/hicolor/24x24/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-selection.svg DESTINATION share/bookworm/icons/hicolor/24x24/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-open-menu.svg DESTINATION share/bookworm/icons/hicolor/24x24/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-profile-day.png DESTINATION share/bookworm/icons/hicolor/24x24/actions) -install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-profile-night.png DESTINATION share/bookworm/icons/hicolor/24x24/actions) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-go-next.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-go-previous.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-list-add.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-list-remove.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-view-grid-symbolic.svg DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-line-height-more.png DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-line-height-less.png DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-width-more.png DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/16/bookworm-width-less.png DESTINATION share/bookworm/icons/hicolor/16x16/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-view-list-symbolic.png DESTINATION share/bookworm/icons/hicolor/24x24/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-bookmark-inactive.png DESTINATION share/bookworm/icons/hicolor/24x24/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-bookmark-active.png DESTINATION share/bookworm/icons/hicolor/24x24/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-selection-checked.svg DESTINATION share/bookworm/icons/hicolor/24x24/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-selection-option.svg DESTINATION share/bookworm/icons/hicolor/24x24/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-selection.svg DESTINATION share/bookworm/icons/hicolor/24x24/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-open-menu.svg DESTINATION share/bookworm/icons/hicolor/24x24/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-profile-day.png DESTINATION share/bookworm/icons/hicolor/24x24/actions/) +install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/24/bookworm-profile-night.png DESTINATION share/bookworm/icons/hicolor/24x24/actions/) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/256/bookworm-placeholder-cover.png DESTINATION share/bookworm/icons/hicolor/256x256/apps/) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/256/bookworm-default-cover-1.png DESTINATION share/bookworm/icons/hicolor/256x256/apps/) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/icons/256/bookworm-default-cover-2.png DESTINATION share/bookworm/icons/hicolor/256x256/apps/) diff --git a/data/icons/16/bookworm-line-height-less.png b/data/icons/16/bookworm-line-height-less.png new file mode 100644 index 00000000..b156b3fa Binary files /dev/null and b/data/icons/16/bookworm-line-height-less.png differ diff --git a/data/icons/16/bookworm-line-height-more.png b/data/icons/16/bookworm-line-height-more.png new file mode 100644 index 00000000..977495bb Binary files /dev/null and b/data/icons/16/bookworm-line-height-more.png differ diff --git a/data/icons/16/bookworm-width-less.png b/data/icons/16/bookworm-width-less.png new file mode 100644 index 00000000..e6fa02f8 Binary files /dev/null and b/data/icons/16/bookworm-width-less.png differ diff --git a/data/icons/16/bookworm-width-more.png b/data/icons/16/bookworm-width-more.png new file mode 100644 index 00000000..e0b019af Binary files /dev/null and b/data/icons/16/bookworm-width-more.png differ diff --git a/po/bookworm.pot b/po/bookworm.pot index b17fc5d3..d1d60d91 100644 --- a/po/bookworm.pot +++ b/po/bookworm.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-05-10 23:20+0100\n" +"POT-Creation-Date: 2017-05-11 18:23+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,11 +17,11 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/constants.vala:77 +#: src/constants.vala:78 msgid "About" msgstr "" -#: src/constants.vala:103 +#: src/constants.vala:108 msgid "All Files" msgstr "" @@ -103,7 +103,7 @@ msgstr "" msgid "Not Available" msgstr "" -#: src/constants.vala:65 src/constants.vala:78 +#: src/constants.vala:65 src/constants.vala:79 msgid "Preferences" msgstr "" @@ -137,7 +137,7 @@ msgstr "" msgid "Turn on Night Mode" msgstr "" -#: src/constants.vala:76 +#: src/constants.vala:77 msgid "Unknown Book" msgstr "" diff --git a/schemas/com.github.babluboy.bookworm.gschema.xml b/schemas/com.github.babluboy.bookworm.gschema.xml index b6eae9b4..baaa074b 100644 --- a/schemas/com.github.babluboy.bookworm.gschema.xml +++ b/schemas/com.github.babluboy.bookworm.gschema.xml @@ -40,5 +40,9 @@ "1" Save the page width for reading + + "100" + Save the page line height for reading + diff --git a/screenshots/BookwormReadingView.jpeg b/screenshots/BookwormReadingView.jpeg index 4af1a5c2..7b2ead8d 100644 Binary files a/screenshots/BookwormReadingView.jpeg and b/screenshots/BookwormReadingView.jpeg differ diff --git a/screenshots/BookwormReadingViewNightView.jpeg b/screenshots/BookwormReadingViewNightView.jpeg index 2a860773..218c6805 100644 Binary files a/screenshots/BookwormReadingViewNightView.jpeg and b/screenshots/BookwormReadingViewNightView.jpeg differ diff --git a/src/constants.vala b/src/constants.vala index 83a6fe73..b18d1eaf 100644 --- a/src/constants.vala +++ b/src/constants.vala @@ -70,6 +70,7 @@ namespace BookwormApp.Constants { public const int SPACING_BUTTONS = 6; public const double ZOOM_CHANGE_VALUE = 0.1; public const int MARGIN_CHANGE_VALUE = 2; + public const int LINE_HEIGHT_CHANGE_VALUE = 10; public const string RGBA_HEX_WHITE = "#ffffff"; public const string RGBA_HEX_BLACK = "#002B36"; @@ -83,6 +84,10 @@ namespace BookwormApp.Constants { public static const string ADD_BOOK_ICON_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/16x16/actions/bookworm-list-add.svg"; public static const string REMOVE_BOOK_ICON_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/16x16/actions/bookworm-list-remove.svg"; public static const string LIBRARY_VIEW_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/16x16/actions/bookworm-view-grid-symbolic.svg"; + public static const string MORE_LINE_HEIGHT_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/16x16/actions/bookworm-line-height-more.png"; + public static const string LESS_LINE_HEIGHT_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/16x16/actions/bookworm-line-height-less.png"; + public static const string MORE_LINE_WIDTH_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/16x16/actions/bookworm-width-more.png"; + public static const string LESS_LINE_WIDTH_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/16x16/actions/bookworm-width-less.png"; public static const string CONTENTS_VIEW_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/24x24/actions/bookworm-view-list-symbolic.png"; public static const string BOOKMARK_INACTIVE_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/24x24/actions/bookworm-bookmark-inactive.png"; public static const string BOOKMARK_ACTIVE_IMAGE_LOCATION = "/usr/share/bookworm/icons/hicolor/24x24/actions/bookworm-bookmark-active.png"; diff --git a/src/contentHandler.vala b/src/contentHandler.vala index c78a419d..a9ba4f6b 100644 --- a/src/contentHandler.vala +++ b/src/contentHandler.vala @@ -31,7 +31,7 @@ public class BookwormApp.contentHandler { onloadJavaScript.append("document.getElementsByTagName('BODY')[0].style.color='black';"); } //Adjust page margin - string cssMargin = ""; + string cssMargin = ""; //add onload javascript to body tag if(pageContent.index_of(" { - if(BookwormApp.Bookworm.settings.reading_width.to_int() < 40){ + marginDecreaseButton.clicked.connect (() => { + if(BookwormApp.Bookworm.settings.reading_width.to_int() <= 40){ BookwormApp.Bookworm.settings.reading_width = (BookwormApp.Bookworm.settings.reading_width.to_int() + BookwormApp.Constants.MARGIN_CHANGE_VALUE).to_string(); if(BookwormApp.Bookworm.BOOKWORM_CURRENT_STATE == BookwormApp.Constants.BOOKWORM_UI_STATES[1]){ BookwormApp.Book currentBookForMarginIncrease = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead); @@ -126,8 +148,8 @@ public class BookwormApp.PreferencesMenu { } }); - marginDecreaseButton.clicked.connect (() => { - if(BookwormApp.Bookworm.settings.reading_width.to_int() > 1){ + marginIncreaseButton.clicked.connect (() => { + if(BookwormApp.Bookworm.settings.reading_width.to_int() >= 1){ BookwormApp.Bookworm.settings.reading_width = (BookwormApp.Bookworm.settings.reading_width.to_int() - BookwormApp.Constants.MARGIN_CHANGE_VALUE).to_string(); if(BookwormApp.Bookworm.BOOKWORM_CURRENT_STATE == BookwormApp.Constants.BOOKWORM_UI_STATES[1]){ BookwormApp.Book currentBookForMarginDecrease = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead); @@ -137,6 +159,28 @@ public class BookwormApp.PreferencesMenu { } }); + heightDecreaseButton.clicked.connect (() => { + if(BookwormApp.Bookworm.settings.reading_line_height.to_int() >= 100){ + BookwormApp.Bookworm.settings.reading_line_height = (BookwormApp.Bookworm.settings.reading_line_height.to_int() - BookwormApp.Constants.LINE_HEIGHT_CHANGE_VALUE).to_string(); + if(BookwormApp.Bookworm.BOOKWORM_CURRENT_STATE == BookwormApp.Constants.BOOKWORM_UI_STATES[1]){ + BookwormApp.Book currentBookForLineHeightDecrease = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead); + currentBookForLineHeightDecrease = BookwormApp.Bookworm.renderPage(BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead), ""); + BookwormApp.Bookworm.libraryViewMap.set(BookwormApp.Bookworm.locationOfEBookCurrentlyRead, currentBookForLineHeightDecrease); + } + } + }); + + heightIncreaseButton.clicked.connect (() => { + if(BookwormApp.Bookworm.settings.reading_line_height.to_int() <= 500){ + BookwormApp.Bookworm.settings.reading_line_height = (BookwormApp.Bookworm.settings.reading_line_height.to_int() + BookwormApp.Constants.LINE_HEIGHT_CHANGE_VALUE).to_string(); + if(BookwormApp.Bookworm.BOOKWORM_CURRENT_STATE == BookwormApp.Constants.BOOKWORM_UI_STATES[1]){ + BookwormApp.Book currentBookForLineHeightIncrease = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead); + currentBookForLineHeightIncrease = BookwormApp.Bookworm.renderPage(BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead), ""); + BookwormApp.Bookworm.libraryViewMap.set(BookwormApp.Bookworm.locationOfEBookCurrentlyRead, currentBookForLineHeightIncrease); + } + } + }); + return prefPopover; } } diff --git a/src/settings.vala b/src/settings.vala index b67c3800..ec4caafe 100644 --- a/src/settings.vala +++ b/src/settings.vala @@ -29,6 +29,7 @@ public class BookwormApp.Settings : Granite.Services.Settings { public string reading_profile { get; set; } public bool is_local_storage_enabled { get; set; } public string reading_width { get; set; } + public string reading_line_height { get; set; } public static Settings get_instance () { if (instance == null) { diff --git a/src/window.vala b/src/window.vala index 983a65fc..03f433ae 100644 --- a/src/window.vala +++ b/src/window.vala @@ -175,14 +175,17 @@ public class BookwormApp.AppWindow { BookwormApp.Bookworm.locationOfEBookCurrentlyRead = currentBookForReverse.getBookLocation(); }); //Add action for moving the pages for the page slider - pageSlider.value_changed.connect (() => { + pageSlider.change_value.connect ((scroll, new_value) => { + debug("Page Slider value change Initiated for book at location:"+BookwormApp.Bookworm.locationOfEBookCurrentlyRead); BookwormApp.Book currentBookForSlider = new BookwormApp.Book(); currentBookForSlider = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead); - currentBookForSlider.setBookPageNumber(pageSlider.get_value ().to_string().to_int()-1); + currentBookForSlider.setBookPageNumber(new_value.to_string().to_int()-1); //update book details to libraryView Map currentBookForSlider = BookwormApp.Bookworm.renderPage(currentBookForSlider, ""); BookwormApp.Bookworm.libraryViewMap.set(currentBookForSlider.getBookLocation(), currentBookForSlider); BookwormApp.Bookworm.locationOfEBookCurrentlyRead = currentBookForSlider.getBookLocation(); + debug("Page Slider value change action completed for book at location:"+BookwormApp.Bookworm.locationOfEBookCurrentlyRead+" and rendering completed for page number:"+currentBookForSlider.getBookPageNumber().to_string()); + return true; }); //Add action for adding a book on the library view add_book_button.clicked.connect (() => {