Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 12-09-2020, 10:54 AM   #16
mxbndr
Grateful Plebe
mxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavens
 
Posts: 39
Karma: 13638
Join Date: Dec 2012
Device: Kindle 3, Kobo Libra H2O
One other thing comes to mind: is it possible to change the default landing screen from "Home" to "My Books" when powering on? This one is far less important, but it would be an improvement.
mxbndr is offline   Reply With Quote
Old 12-12-2020, 12:54 PM   #17
mxbndr
Grateful Plebe
mxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavens
 
Posts: 39
Karma: 13638
Join Date: Dec 2012
Device: Kindle 3, Kobo Libra H2O
Anyone have any ideas? Could I, for instance, add something to nickel.yaml that looks something like the following?

Code:
Remove My Books (row2) on home screen:
  - Enabled: yes
  - PatchGroup: Home screen visibility tweaks
  - FindZlib: "#row1col2"
  - ReplaceZlib:
      Find:    "#row1col2 {\n  qproperty-visible: false;\n}"
      Replace: "#row1col2 {\n  qproperty-visible: false;\n}\n#row2 {\n  qproperty-visible: false;\n}"
mxbndr is offline   Reply With Quote
Advert
Old 12-12-2020, 02:49 PM   #18
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,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by mxbndr View Post
Anyone have any ideas? Could I, for instance, add something to nickel.yaml that looks something like the following?

Code:
Remove My Books (row2) on home screen:
  - Enabled: yes
  - PatchGroup: Home screen visibility tweaks
  - FindZlib: "#row1col2"
  - ReplaceZlib:
      Find:    "#row1col2 {\n  qproperty-visible: false;\n}"
      Replace: "#row1col2 {\n  qproperty-visible: false;\n}\n#row2 {\n  qproperty-visible: false;\n}"
I don't see any reason why that shouldn't work. Why not just try it and see.

One thing I would add is that if you wanted to remove both #row2 and #row3 then I wouldn't use 2 separate patches. I'd customise your personal patch above to remove both #row2 and #row3 in one hit.
jackie_w is offline   Reply With Quote
Old 12-12-2020, 04:33 PM   #19
mxbndr
Grateful Plebe
mxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavens
 
Posts: 39
Karma: 13638
Join Date: Dec 2012
Device: Kindle 3, Kobo Libra H2O
Thanks for the encouragement!

I'm wondering, is there documentation for how to target things in Kobo files? For instance, I can infer from

Code:
  - FindZlib: "#row1col2"
that there is a grid with at least 2 columns, and from

Code:
      Replace: "#row1col2 {\n  qproperty-visible: false;\n}\n#row2 {\n  qproperty-visible: false;\n}"
that the grid also has at least 3 rows. Is everything I've been requesting in "#row1col2"? I am befuddled because I'm not sure why targeting the third row would be "#row1col2" but later in the file it reads "\n#row3". Does that mean all the row-targeting actually happens at "\n#row3"? E.g., "\n#row2"?

With that in mind, I'm also wondering what one patch would look like. Based on the above, I'm guessing something like

Code:
Remove footer (row3) and My Books (row2) on home screen:
  - Enabled: yes
  - PatchGroup: Home screen visibility tweaks
  - FindZlib: "#row1col2"
  - ReplaceZlib:
      Find:    "#row1col2 {\n  qproperty-visible: false;\n}"
      Replace: "#row1col2 {\n  qproperty-visible: false;\n}\n#row3 {\n  qproperty-visible: false;\n}"
      Replace: "#row1col2 {\n  qproperty-visible: false;\n}\n#row2 {\n  qproperty-visible: false;\n}"
I'm happy to mess around and see what works, I'm just curious if there is documentation.

Thanks!
mxbndr is offline   Reply With Quote
Old 12-12-2020, 07:30 PM   #20
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,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by mxbndr View Post
I'm wondering, is there documentation for how to target things in Kobo files?
If you want to examine the CSS streams in nickel you need @geek1011's cssextract executable (e.g. cssextract-windows.exe is the one for Windows). He used to distribute it in every release of kobopatch_xxx.zip but doesn't anymore. See here for more detail if you're interested. It may still on his GitHub website but I'm not sure exactly where it's stored. Once you've got it, all you do is pull out the nickel file from the relevant kobo firmware zip file and drop it onto the executable. It creates a single text file containing the CSS streams which you can examine at your leisure.

Quote:
Originally Posted by mxbndr View Post
For instance, I can infer from
Code:
  - FindZlib: "#row1col2"
that there is a grid with at least 2 columns, and from

Code:
      Replace: "#row1col2 {\n  qproperty-visible: false;\n}\n#row2 {\n  qproperty-visible: false;\n}"
The Home screen has a header (time and icons), a footer (4 Nav buttons) and between them is a 3x2 grid. What is in each "cell" can vary a bit, especially if you check the More>Beta Features>Large Print Mode box.
row1col1 & col2: Recent books
row2col1: MyBooks "tile" (recently duplicated in MyBooks navbutton)
row2col2: a variable "tile" usually showing books from one of your Collections or one of your Authors.
row3col1: link to Kobo store (recently duplicated in Discover navbutton)
row3col2: a random item from a select list of "useful (maybe) things". There are kobopatches to force this to something you might actually use.

Quote:
Originally Posted by mxbndr View Post
With that in mind, I'm also wondering what one patch would look like.
Try
Code:
Remove footer (row3) and My Books (row2) on home screen:
  - Enabled: yes
  - PatchGroup: Home screen visibility tweaks
  - FindZlib: "#row1col2"
  - ReplaceZlib:
      Find:    "#row1col2 {\n  qproperty-visible: false;\n}"
      Replace: "#row1col2 {\n  qproperty-visible: false;\n}\n#row2, #row3 {\n  qproperty-visible: false;\n}"
This is the whole contents for HomePageView.qss CSS resource in 4.25.15875 so you can get an idea what the existing Home screen patches are doing.:
Spoiler:
Code:
#mainContainer[qApp_deviceIsTrilogy=true] {
  qproperty-leftMargin: 32px;
}
#mainContainer[qApp_deviceIsPhoenix=true] {
  qproperty-leftMargin: 40px;
}
#mainContainer[qApp_deviceIsDragon=true] {
  qproperty-leftMargin: 57px;
}
#mainContainer[qApp_deviceIsStorm=true] {
  qproperty-leftMargin: 67px;
}
#mainContainer[qApp_deviceIsDaylight=true] {
  qproperty-leftMargin: 74px;
}
#mainContainer[qApp_deviceIsTrilogy=true] {
  qproperty-rightMargin: 32px;
}
#mainContainer[qApp_deviceIsPhoenix=true] {
  qproperty-rightMargin: 40px;
}
#mainContainer[qApp_deviceIsDragon=true] {
  qproperty-rightMargin: 57px;
}
#mainContainer[qApp_deviceIsStorm=true] {
  qproperty-rightMargin: 67px;
}
#mainContainer[qApp_deviceIsDaylight=true] {
  qproperty-rightMargin: 74px;
}
#mainContainer[qApp_deviceIsTrilogy=true] {
  qproperty-topMargin: 96;
  qproperty-spacing: 10;
}
#mainContainer[qApp_deviceIsPhoenix=true] {
  qproperty-topMargin: 126;
  qproperty-spacing: 14;
}
#mainContainer[qApp_deviceIsDragon=true] {
  qproperty-topMargin: 170;
  qproperty-spacing: 20;
}
#mainContainer[qApp_deviceIsStorm=true] {
  qproperty-topMargin: 192;
  qproperty-spacing: 23;
}
#mainContainer[qApp_deviceIsDaylight=true] {
  qproperty-topMargin: 220;
  qproperty-spacing: 26;
}
#row1[qApp_deviceIsTrilogy=true],
#row2[qApp_deviceIsTrilogy=true] {
  max-height: 280px;
  min-height: 280px;
}
#row1[qApp_deviceIsPhoenix=true],
#row2[qApp_deviceIsPhoenix=true] {
  max-height: 346px;
  min-height: 346px;
}
#row1[qApp_deviceIsDragon=true],
#row2[qApp_deviceIsDragon=true] {
  max-height: 488px;
  min-height: 488px;
}
#row1[qApp_deviceIsDaylight=true],
#row2[qApp_deviceIsDaylight=true] {
  max-height: 634px;
  min-height: 634px;
}
#row1[qApp_deviceIsStorm=true],
#row2[qApp_deviceIsStorm=true] {
  max-height: 556px;
  min-height: 556px;
}
[qApp_isFontScaleLarge=true] #row1[qApp_deviceIsTrilogy=true] {
  max-height: 392px;
  min-height: 392px;
}
[qApp_isFontScaleLarge=true] #row1[qApp_deviceIsPhoenix=true] {
  max-height: 484px;
  min-height: 484px;
}
[qApp_isFontScaleLarge=true] #row1[qApp_deviceIsDragon=true] {
  max-height: 683px;
  min-height: 683px;
}
[qApp_isFontScaleLarge=true] #row1[qApp_deviceIsDaylight=true] {
  max-height: 887px;
  min-height: 887px;
}
[qApp_isFontScaleLarge=true] #row1[qApp_deviceIsStorm=true] {
  max-height: 776px;
  min-height: 776px;
}
[qApp_isFontScaleLarge=true] #row2[qApp_deviceIsTrilogy=true] {
  max-height: 112px;
  min-height: 112px;
}
[qApp_isFontScaleLarge=true] #row2[qApp_deviceIsPhoenix=true] {
  max-height: 138px;
  min-height: 138px;
}
[qApp_isFontScaleLarge=true] #row2[qApp_deviceIsDragon=true] {
  max-height: 195px;
  min-height: 195px;
}
[qApp_isFontScaleLarge=true] #row2[qApp_deviceIsDaylight=true] {
  max-height: 253px;
  min-height: 253px;
}
[qApp_isFontScaleLarge=true] #row2[qApp_deviceIsStorm=true] {
  max-height: 220px;
  min-height: 220px;
}
[qApp_isFontScaleLarge=true] #row1col2 {
  qproperty-visible: false;
}

Last edited by jackie_w; 12-12-2020 at 07:35 PM. Reason: added CSS
jackie_w is offline   Reply With Quote
Advert
Old 12-12-2020, 07:36 PM   #21
mxbndr
Grateful Plebe
mxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavensmxbndr is a rising star in the heavens
 
Posts: 39
Karma: 13638
Join Date: Dec 2012
Device: Kindle 3, Kobo Libra H2O
Quote:
Originally Posted by jackie_w View Post
If you want to examine the CSS streams in nickel you need @geek1011's cssextract executable (e.g. cssextract-windows.exe is the one for Windows). He used to distribute it in every release of kobopatch_xxx.zip but doesn't anymore. See here for more detail if you're interested. It may still on his GitHub website but I'm not sure exactly where it's stored. Once you've got it, all you do is pull out the nickel file from the relevant kobo firmware zip file and drop it onto the executable. It creates a single text file containing the CSS streams which you can examine at your leisure.


The Home screen has a header (time and icons), a footer (4 Nav buttons) and between them is a 3x2 grid. What is in each "cell" can vary a bit, especially if you check the More>Beta Features>Large Print Mode box.
row1col1 & col2: Recent books
row2col1: MyBooks "tile" (recently duplicated in MyBooks navbutton)
row2col2: a variable "tile" usually showing books from one of your Collections or one of your Authors.
row3col1: link to Kobo store (recently duplicated in Discover navbutton)
row3col2: a random item from a select list of "useful (maybe) things". There are kobopatches to force this to something you might actually use.


Try
Code:
Remove footer (row3) and My Books (row2) on home screen:
  - Enabled: yes
  - PatchGroup: Home screen visibility tweaks
  - FindZlib: "#row1col2"
  - ReplaceZlib:
      Find:    "#row1col2 {\n  qproperty-visible: false;\n}"
      Replace: "#row1col2 {\n  qproperty-visible: false;\n}\n#row2, #row3 {\n  qproperty-visible: false;\n}"
Thank you! I like how elegantly you combined hiding multiple rows. I did already accomplish what I was looking for via https://www.mobileread.com/forums/sh...&postcount=674 but I appreciate your effort all the same! And I especially appreciate your taking the time to introduce me to the CSS and 3x2 grid.
mxbndr is offline   Reply With Quote
Reply

Tags
homescreen, kobo, libra h2o, overdrive, patching


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anywhere where I can buy a kobo ereader in person? Scaledish Kobo Reader 3 03-05-2020 06:05 PM
Yet another person with the Kobo ARC USB port problems WanderingOne Kobo Reader 4 07-16-2015 06:45 AM
Older Kobo CazMar Kobo Reader 1 06-18-2015 02:08 PM
K4NTB works for older person? DuckieTigger Amazon Kindle 44 12-01-2012 09:12 PM
F-Zero 4K, code ported, now it needs dumbing down. WIP... twobob Kindle Developer's Corner 2 09-06-2012 10:12 AM


All times are GMT -4. The time now is 01:37 PM.


MobileRead.com is a privately owned, operated and funded community.