Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-06-2025, 08:27 AM   #1
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,265
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Tag browser: custom icons per category value?

Today one can use custom icons for each tag browser category. From time to time I see a discussion about whether one can also use custom icons per category value. The latest was here.

One can apparently do it with the Job Spy plugin. Using Job Spy concerns me because a) the plugin seems to no longer be maintained, and b) to work it would need to reach deep into the tag browser code, making it fragile.

I am considering adding this ability to base calibre. I don't think any "naming" scheme where the name of an icon specifies where it is used can work. There are too many category/value pairs, perhaps thousands, meaning icons could be duplicated thousands of times. I don't think a "rule" system such as used for column icons is practical for the same reason; one could end up with thousands of rules. A template scheme permits grouping and defaulting based on how the user thinks. One could even use subtemplates to make maintaining the icons used for a given category an easier task.

If I go forward then there would be an option somewhere to specify a template that given a category and a value returns the name of an icon. If the template returns the empty string then the default icon (what you see today) would be used. The template would not have access to information about books.

The biggest question for me is "where are the icons stored?" I think that they should be in a subfolder of the tb_icons folder, perhaps named something like "##category_icons##". The template would return an icon name, which must be found in that folder. The user is in charge of names, using any scheme desired. Further subfolders would be permitted. The user is in charge of theming (light or dark), using different names such as 'aaa-light.png' and 'aaa-dark.png' for the value 'aaa'.

Questions:
  • Would something like this be useful for more than 10 people?
  • Is it too complicated to be of general use?
  • Do any of you have a different proposal for how to specify an icon for a category/value pair?
chaley is offline   Reply With Quote
Old 01-06-2025, 08:44 AM   #2
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,530
Karma: 7095191
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post
- Would something like this be useful for more than 10 people?
Hard to say, really. Just yesterday I found a feature whose implementation started exactly like this. And it only took me almost 2 years to find it, lol.

I was wondering how to make space on book details panel to give more visibility to my author Bio composite, then I saw "Show with comments in book details" and I wondered, how is this here and I never saw it?

Had to google and search github commits, it's from March 2023!
https://www.mobileread.com/forums/sh....php?p=4308469
https://github.com/kovidgoyal/calibr...e28e2297c0f+69

I'm really enjoying this feature, so I guess in the future I may be one of those 10 people you're wondering.

Click image for larger version

Name:	MWSnap 2025-01-06, 10_42_08.png
Views:	386
Size:	358.6 KB
ID:	212876

Last edited by Comfy.n; 01-06-2025 at 08:57 AM.
Comfy.n is online now   Reply With Quote
Advert
Old 01-06-2025, 08:50 AM   #3
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,530
Karma: 7095191
Join Date: Sep 2020
Device: none
(but I'm not a heavy user of the Tag Browser currently)
Comfy.n is online now   Reply With Quote
Old 01-06-2025, 12:06 PM   #4
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,280
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I would find it useful. Job Spy has limitations such as it not working with partitions.
ownedbycats is online now   Reply With Quote
Old 01-06-2025, 04:45 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,484
Karma: 29268252
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I don't use the TB extensively, most the time it's hidden. And I have difficulty identifying suitable icons - e.g. my Books library has two custom categories that I have no idea how to represent iconically — Admin Tags and Status.

But, I have a more general Tab Browser related issue: which is configuring it - IMO it's too fragmented.

JobSpy: I suspect most of its users have concerns about its longevity.

There are a handful of JS features I wouldn't like to lose. Should we try to compile a composite list of Most Valued Features as the basis for implementing them in the basellne code or in feature specific plugins?

BR
BetterRed is offline   Reply With Quote
Advert
Old 01-06-2025, 04:55 PM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,265
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
But, I have a more general Tab Browser related issue: which is configuring it - IMO it's too fragmented.
Suggestions?
Quote:
JobSpy: I suspect most of its users have concerns about its longevity.

There are a handful of JS features I wouldn't like to lose. Should we try to compile a composite list of Most Valued Features as the basis for implementing them in the basellne code or in feature specific plugins?
Sure. There is certainly no harm in having that list, especially if it has vote counts.

Another option is that someone take over maintenance of Job Spy. FWIW: not something I'm interested in doing.
chaley is offline   Reply With Quote
Old 01-16-2025, 10:16 AM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,265
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
An implementation of per-value icons is in calibre source. It works in the GUI and in the content server.

Here is the documentation from the manual, with some formatting changed:
Quote:
You can use your own icons for categories and values in categories. To change the icon for a category, right-click on the category (the outer-level item) and choose Change (category name) category icon. A dialog will open where you can pick an image to be used as the icon. To restore the icon to its default choose Restore (category name) default icon.

To choose icons for values in categories, right-click on a value then choose Manage value icons. You will see a list of choices:
  • Choose an icon for this value but not its children. A dialog will open where you choose an icon for the value. Children of that value will not inherit that icon.
  • Choose an icon for this value and its children. A dialog will open where you choose an icon for the value. Any children that don't have their own specified icon will inherit this icon.
  • Choose an existing icon for this value but not its children. This option is offered if the value already has an icon that is inherited by the value's children. Selecting it will make the icon apply to the value but not its children.
  • Choose and existing icon for this value and its children. This option is offered if the value already has an icon that is not inherited by the value's children. Selecting it will make the icon apply to the value and its children.
  • Use the default icon for this value. This option is offered if the item has an icon. It removes the icon from the value and any children inheriting the icon. The default icon is what is specified below.
  • Use/edit a template to choose the default value icon. This option permits you to provide a calibre template that returns the name of an icon file to be uses as a default icon. The template can use two variables:
    • category: the lookup name of the category, for example authors, series, #mycolumn.
    • value: the value of the item within the category.
    Book metadata such as title is not available.

    For example, this template specifies that any value in the clicked-on category beginning with History will have an icon named flower.png:
    Code:
    program:
      if substr($value, 0, 7) == 'History' then 'flower.png' fi
    If the template returns the empty string ('') then the category icon will be used. If the template returns a file name that doesn't exist then no icon is displayed.
  • Use the category icon as the default. This option specifies that the icon used for the category should be used for any value that doesn't otherwise have an icon. Selecting this option removes any template icon specification.
Icons for item values are stored in the tb_icons subfolder in the calibre configuration folder. Icons used by templates are in the template_icons subfolder of tb_icons.
chaley is offline   Reply With Quote
Old 01-16-2025, 01:14 PM   #8
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,280
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD


Should I disable the tag browser icons in job spy?
ownedbycats is online now   Reply With Quote
Old 01-16-2025, 01:15 PM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,265
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post


Should I disable the tag browser icons in job spy?
No idea. I don't know what JS does, whether what it does will break what we did, or whether what we did will break it.

If what we did solves your problem then to be safe I would disable JS.
chaley is offline   Reply With Quote
Old 01-16-2025, 01:42 PM   #10
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,280
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I turned it off just to be safe. Seems to be working as expected.
ownedbycats is online now   Reply With Quote
Old 01-16-2025, 02:03 PM   #11
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,280
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Another question: If a tag browser category regularly disappears and reappears (e.g. my Kobo statuses add/remove from device) will the icons remain?
ownedbycats is online now   Reply With Quote
Old 01-16-2025, 03:15 PM   #12
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,280
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Small bug: Ampersand is missing, replaced with underscore.
ownedbycats is online now   Reply With Quote
Old 01-16-2025, 03:19 PM   #13
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,265
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Another question: If a tag browser category regularly disappears and reappears (e.g. my Kobo statuses add/remove from device) will the icons remain?
Yes, unless you remove the specification. You can be sure if you use a template.
Quote:
Originally Posted by ownedbycats View Post
Small bug: Ampersand is missing, replaced with underscore.
Where?
chaley is offline   Reply With Quote
Old 01-16-2025, 03:35 PM   #14
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,280
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Categorys that have an ampersand in the name. In te menu.

Last edited by ownedbycats; 01-16-2025 at 03:39 PM.
ownedbycats is online now   Reply With Quote
Old 01-16-2025, 03:45 PM   #15
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,265
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Categorys that have an ampersand in the name. In te menu.
Fix submitted. It should be in source tomorrow. If there is a release or preview then it should be in that, depending on @Kovid's workflow.
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I disable Icons in Tag Browser? mikhail_fil Library Management 1 08-10-2023 06:34 PM
Lighter icons in tag browser? polymerwitch Calibre 3 11-29-2021 06:21 PM
Category Ranges in Tag Browser BetterRed Library Management 7 10-18-2020 04:44 AM
Any way to unhide just one user category in the tag browser? ownedbycats Library Management 2 10-14-2020 09:10 PM
Show Category in Tag Browser MerlinMama Calibre 4 02-01-2016 11:11 AM


All times are GMT -4. The time now is 09:59 PM.


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