View Single Post
Old 07-15-2022, 12:44 PM   #844
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by allanahk View Post
Ok, that's fair! I wasn't sure if my requests were simple to implement or more complex like you say.
I've had a re-think. What you asked for would normally require 3 patches, each patch having settings for all the Kobo models. Instead I've combined all 3 patches into a single one, but only targeted at a single Kobo model group. The beta patch in the spoiler below should work for all Storm devices, i.e. LibraH2O/Libra2.

Have a look at the patch code to see if the included help notes are clear enough to be usable.
All Replace: lines can be customised as required. If that's too complicated simply enabling the patch will look like the 2nd image in the 2 screenshots (default vs. patched) attached below.

If the patch is considered both useable and useful on a Libra, I can look at creating similar patches for the other Kobo model groups. Feedback welcome.

Place the patch code in nickel.yaml (or wherever you keep all your other custom nickel patches).

'Storm' devices only (LibraH2O/Libra2)
Spoiler:
Code:
beta Increase width available for book Title in Booklists - Storm only:
  - Enabled: no
  - PatchGroup: Booklist layout tweaks
  - Description: |
        'Storm' devices only (LibraH2O/Libra2)
        Increase width available for book Title in GUI Booklists.
          - Part 1:     Customise font-size of book Title
          - Part 2:     (optional) Customise font-size of book Author(s) & Subtitle
          - Part 3:     Customise font-size of book Series and book (time remaining, filetype, filesize)
          - Part 4a/4b: Reduce large left/right margins in Booklists
        To get an idea of what effect this patch has, see screenshots at
            https://www.mobileread.com/forums/showpost.php?p=4239375&postcount=844
        N.B. Not suitable for users of Chinese-HK locale
        
  # Part 1: Customise font-size of book Title
  - FindZlib: "HeaderSmallElidedLabel[localeName=\"zh-HK\"]," # default.qss (HeaderSmallElidedLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Customise Title font-size from default 42px
        # add Storm-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "HeaderSmallElidedLabel[localeName=\"zh-HK\"],\nHeaderSmallItalicLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n  qproperty-forceLeading: 5;\n}"
          Replace: "HeaderSmallElidedLabel[qApp_deviceIsStorm=true] {font-size:35px;}"
        
  # Part 2: Customise font-size of book Author(s) and Subtitle (optional)
  #         This is an extra option for patchers who would like more control over the
  #         Booklist font-size for both Author & Subtitle. Same value is used for both.
  - FindZlib: "PageLabel[localeName=\"zh-HK\"]," # default.qss (SmallElidedLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Change Author & Subtitle font-size from default 30px
        # add Storm-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "PageLabel[localeName=\"zh-HK\"],\nSmallElidedLabel[localeName=\"zh-HK\"],\nSmallTouchLabel[localeName=\"zh-HK\"],\nSmallLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n}"
          Replace: "SmallElidedLabel[qApp_deviceIsStorm=true] {font-size:30px;}"

  # Part 3: Customise font-size of book Series and book (time remaining, filetype, filesize)
  - FindZlib: "MetaDataElidedLabel[localeName=\"zh-HK\"]," # default.qss (MetaDataElidedLabel, MetaDataLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Customise font-sizes for:
        # - book Series                               (MetaDataElidedLabel) - default 29px
        # - book (time remaining, filetype, filesize) (MetaDataLabel)       - default 29px
        # add Storm-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "MetaDataElidedLabel[localeName=\"zh-HK\"],\nMetaDataLabel[localeName=\"zh-HK\"],\nMetaDataAdjustingLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n  text-transform: none;\n}"
          Replace: "MetaDataElidedLabel[qApp_deviceIsStorm=true] {font-size:30px;}\nMetaDataLabel[qApp_deviceIsStorm=true] {font-size:23px;}"
          
  # Part 4: Reduce large left/right margins in Booklists
  - FindZlib: "ScrollableContentWidgetBase[qApp_deviceIsStorm=true] {\n  qproperty-leftMargin:" # default.qss
  - ReplaceZlibGroup:
      Replacements:
        # 4a: Reduce left margin gap between edge of screen and bookcover thumbnails
        # L-margin reduction approx. 6mm -> 2mm
        - Find:    "ScrollableContentWidgetBase[qApp_deviceIsStorm=true] {\n  qproperty-leftMargin: 67;\n}"
          Replace: "ScrollableContentWidgetBase[qApp_deviceIsStorm=true] {\n  qproperty-leftMargin:23;\n}"
        
        # 4b: Reduce right margin gap between edge of screen and book metadata when no vertical scrollbar present
        #     i.e. when Booklist page contains <=5 Book/Series titles or <=10 Author/Collection titles
        # R-margin reduction approx. 6mm -> 2mm
        - Find:    "ScrollableContentWidgetBase[noScrollBar=true][qApp_deviceIsStorm=true] {\n  qproperty-rightMargin: 67;\n}"
          Replace: "ScrollableContentWidgetBase[noScrollBar=true][qApp_deviceIsStorm=true] {\n  qproperty-rightMargin:23;\n}"


'Daylight' devices only (AuraOne/Forma/Sage/Elipsa/Elipsa2E)
Spoiler:
Code:
beta Increase width available for book Title in Booklists - Daylight only:
  - Enabled: no
  - PatchGroup: Booklist layout tweaks
  - Description: |
        'Daylight' devices only (AuraOne/Forma/Sage/Elipsa)
        Increase width available for book Title in GUI Booklists.
          - Part 1:     Customise font-size of book Title
          - Part 2:     (optional) Customise font-size of book Author(s) & Subtitle
          - Part 3:     Customise font-size of book Series and book (time remaining, filetype, filesize)
          - Part 4a/4b: Reduce large left/right margins in Booklists
        To get an idea of what effect this patch has, see screenshots at
            https://www.mobileread.com/forums/showpost.php?p=4239375&postcount=844
        N.B. Not suitable for users of Chinese-HK locale
        
  # Part 1: Customise font-size of book Title
  - FindZlib: "HeaderSmallElidedLabel[localeName=\"zh-HK\"]," # default.qss (HeaderSmallElidedLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Customise Title font-size from default 47px
        # add Daylight-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "HeaderSmallElidedLabel[localeName=\"zh-HK\"],\nHeaderSmallItalicLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n  qproperty-forceLeading: 5;\n}"
          Replace: "HeaderSmallElidedLabel[qApp_deviceIsDaylight=true] {font-size:38px;}"
        
  # Part 2: Customise font-size of book Author(s) and Subtitle (optional)
  #         This is an extra option for patchers who would like more control over the
  #         Booklist font-size for both Author & Subtitle. Same value is used for both.
  - FindZlib: "PageLabel[localeName=\"zh-HK\"]," # default.qss (SmallElidedLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Change Author & Subtitle font-size from default 34px
        # add Daylight-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "PageLabel[localeName=\"zh-HK\"],\nSmallElidedLabel[localeName=\"zh-HK\"],\nSmallTouchLabel[localeName=\"zh-HK\"],\nSmallLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n}"
          Replace: "SmallElidedLabel[qApp_deviceIsDaylight=true] {font-size:34px;}"

  # Part 3: Customise font-size of book Series and book (time remaining, filetype, filesize)
  - FindZlib: "MetaDataElidedLabel[localeName=\"zh-HK\"]," # default.qss (MetaDataElidedLabel, MetaDataLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Customise font-sizes for:
        # - book Series                               (MetaDataElidedLabel) - default 32px
        # - book (time remaining, filetype, filesize) (MetaDataLabel)       - default 32px
        # add Daylight-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "MetaDataElidedLabel[localeName=\"zh-HK\"],\nMetaDataLabel[localeName=\"zh-HK\"],\nMetaDataAdjustingLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n  text-transform: none;\n}"
          Replace: "MetaDataElidedLabel[qApp_deviceIsDaylight=true] {font-size:32px;}\nMetaDataLabel[qApp_deviceIsDaylight=true] {font-size:23px;}"
          
  # Part 4: Reduce large left/right margins in Booklists
  - FindZlib: "ScrollableContentWidgetBase[qApp_deviceIsDaylight=true] {\n  qproperty-leftMargin:" # default.qss
  - ReplaceZlibGroup:
      Replacements:
        # 4a: Reduce left margin gap between edge of screen and bookcover thumbnails
        # L-margin reduction approx. 6mm -> 2mm
        - Find:    "ScrollableContentWidgetBase[qApp_deviceIsDaylight=true] {\n  qproperty-leftMargin: 74;\n}"
          Replace: "ScrollableContentWidgetBase[qApp_deviceIsDaylight=true] {\n  qproperty-leftMargin:26;\n}"
        
        # 4b: Reduce right margin gap between edge of screen and book metadata when no vertical scrollbar present
        #     i.e. when Booklist page contains <=5 Book/Series titles or <=10 Author/Collection titles
        # R-margin reduction approx. 6mm -> 2mm
        - Find:    "ScrollableContentWidgetBase[noScrollBar=true][qApp_deviceIsDaylight=true] {\n  qproperty-rightMargin: 74;\n}"
          Replace: "ScrollableContentWidgetBase[noScrollBar=true][qApp_deviceIsDaylight=true] {\n  qproperty-rightMargin:26;\n}"


GloHD/ClaraHD/Clara2E devices only
Spoiler:
Code:
beta Increase width available for book Title in Booklists - GloHD,Clara only:
  - Enabled: no
  - PatchGroup: Booklist layout tweaks
  - Description: |
        GloHD/ClaraHD/Clara2E devices only
        Increase width available for book Title in GUI Booklists.
          - Part 1:     Customise font-size of book Title
          - Part 2:     (optional) Customise font-size of book Author(s) & Subtitle
          - Part 3:     Customise font-size of book Series and book (time remaining, filetype, filesize)
          - Part 4a/4b: Reduce large left/right margins in Booklists
        To get an idea of what effect this patch has, see screenshots at
            https://www.mobileread.com/forums/showpost.php?p=4239375&postcount=844
        N.B. Not suitable for users of Chinese-HK locale
        
  # Part 1: Customise font-size of book Title
  - FindZlib: "HeaderSmallElidedLabel[localeName=\"zh-HK\"]," # default.qss (HeaderSmallElidedLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Customise Title font-size from default 39px
        # add Clara-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "HeaderSmallElidedLabel[localeName=\"zh-HK\"],\nHeaderSmallItalicLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n  qproperty-forceLeading: 5;\n}"
          Replace: "HeaderSmallElidedLabel[qApp_deviceIsAlyssum=true], HeaderSmallElidedLabel[qApp_deviceIsNova=true] {font-size:35px;}"
        
  # Part 2: Customise font-size of book Author(s) and Subtitle (optional)
  #         This is an extra option for patchers who would like more control over the
  #         Booklist font-size for both Author & Subtitle. Same value is used for both.
  - FindZlib: "PageLabel[localeName=\"zh-HK\"]," # default.qss (SmallElidedLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Change Author & Subtitle font-size from default 30px
        # add Clara-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "PageLabel[localeName=\"zh-HK\"],\nSmallElidedLabel[localeName=\"zh-HK\"],\nSmallTouchLabel[localeName=\"zh-HK\"],\nSmallLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n}"
          Replace: "SmallElidedLabel[qApp_deviceIsAlyssum=true], SmallElidedLabel[qApp_deviceIsNova=true] {font-size:30px;}"

  # Part 3: Customise font-size of book Series and book (time remaining, filetype, filesize)
  - FindZlib: "MetaDataElidedLabel[localeName=\"zh-HK\"]," # default.qss (MetaDataElidedLabel, MetaDataLabel)
  - ReplaceZlibGroup:
      Replacements:
        # Customise font-sizes for:
        # - book Series                               (MetaDataElidedLabel) - default 25px
        # - book (time remaining, filetype, filesize) (MetaDataLabel)       - default 25px
        # add Clara-specific code by commandeering some code used only by Chinese-HK locale users
        - Find:    "MetaDataElidedLabel[localeName=\"zh-HK\"],\nMetaDataLabel[localeName=\"zh-HK\"],\nMetaDataAdjustingLabel[localeName=\"zh-HK\"] {\n  font-family: Sans-SerifZH-Traditional, sans-serif;\n  font-style: normal;\n  text-transform: none;\n}"
          Replace: "MetaDataElidedLabel[qApp_deviceIsDragon=true] {font-size:27px;}\nMetaDataLabel[qApp_deviceIsDragon=true] {font-size:22px;}"
          
  # Part 4: Reduce large left/right margins in Booklists
  - FindZlib: "ScrollableContentWidgetBase[qApp_deviceIsDragon=true] {\n  qproperty-leftMargin:" # default.qss
  - ReplaceZlibGroup:
      Replacements:
        # 4a: Reduce left margin gap between edge of screen and bookcover thumbnails
        # L-margin reduction approx. 6mm -> 2mm (Dragon/Alyssum/Nova)
        - Find:    "ScrollableContentWidgetBase[qApp_deviceIsDragon=true] {\n  qproperty-leftMargin: 57;\n}"
          Replace: "ScrollableContentWidgetBase[qApp_deviceIsDragon=true] {\n  qproperty-leftMargin:20;\n}"
        
        # 4b: Reduce right margin gap between edge of screen and book metadata when no vertical scrollbar present
        #     i.e. when Booklist page contains <=5 Book/Series titles or <=10 Author/Collection titles
        # R-margin reduction approx. 6mm -> 2mm (Dragon/Alyssum/Nova)
        - Find:    "ScrollableContentWidgetBase[noScrollBar=true][qApp_deviceIsDragon=true] {\n  qproperty-rightMargin: 57;\n}"
          Replace: "ScrollableContentWidgetBase[noScrollBar=true][qApp_deviceIsDragon=true] {\n  qproperty-rightMargin:20;\n}"


ETA 1: These beta patches are not suitable for kobopatchers who have set their Kobo locale to Chinese-HK. The space occupied by some of the Chinese-specific code was commandeered to simplify this patch for other users.

ETA 2:
  • Added new option (Part 2) to customise font-size of both Author and Subtitle lines in the Booklist. Same font-size is used for both. Cosmetic only, won't affect width available for long book Titles.
  • Changed Series option (Part 3) so only a single Find/Replace is needed to customise font-sizes for Series and (time remaining, filetype, filesize). These 2 values can be different.
  • Equivalent patch for Daylight devices added above.

ETA 3: Added beta patch for GloHD/ClaraHD/Clara2E devices
Attached Thumbnails
Click image for larger version

Name:	booklist_default.png
Views:	454
Size:	357.5 KB
ID:	195014   Click image for larger version

Name:	booklist_35_23.png
Views:	424
Size:	343.7 KB
ID:	195015  

Last edited by jackie_w; 07-01-2023 at 02:47 PM. Reason: See ETA 3
jackie_w is offline   Reply With Quote