Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-04-2025, 12:46 PM   #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,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Custom tooltips in the book list view

One can use templates to define "custom tooltips" for columns in the book list. The tooltip can contain whatever you want as long as it can be generated by a template. Tooltips interpret HTML so you can construct complex displays. One test I did was to include in the tooltip the note for the value where the note contained a picture.

If you change the tooltip for "title" then the changed tooltip is used in the cover grid as well.

To define a column tooltip, right-click on the column header and choose "(Define|Edit) column tooltip ...". It is also available as a calibre action, which means it is in the All Actions menu, can be given a shortcut, and can be added to context menus, favorites, action chains, etc.

You can include the text that would have been used for the tooltip. See the help text when you first create a column tooltip template:
Quote:
Notes:
  • The template global variable "column_lookup_name" contains the column lookup name.
  • The global variable "original_text" contains the original tooltip text.
This feature is in calibre source now and will be included in the next preview or release.
chaley is offline   Reply With Quote
Old 09-06-2025, 05:36 AM   #2
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,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
This feature has a small bug in calibre 8.10.0 where the first time one defines a custom tooltip for a column, calibre must be restarted to "see" it. Subsequence edits of the tooltip for that column don't require the restart. The fix is in calibre source and will be in the next release/preview.

Here is a basic example of using a custom tooltip: presenting a list of genres in a more readable fashion.

The standard tooltip looks like this. There are multiple genres per line with some of them broken across lines.
Click image for larger version

Name:	Clipboard01.jpg
Views:	39
Size:	30.8 KB
ID:	217913

If I use this template to generate the tooltip
Code:
program: 
	res = 'Genres:';
	vals = list_sort($#genre, 0, ',');
	for t in vals:
		res = res & '<br>' & t
	rof;
	res
then I see
Click image for larger version

Name:	Clipboard02.jpg
Views:	36
Size:	27.5 KB
ID:	217914

And yes, the genres don't make a lot of sense.
chaley is offline   Reply With Quote
Advert
Old 09-06-2025, 08:16 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,662
Karma: 7908443
Join Date: Sep 2020
Device: none
I did a quick test with the Title column tooltip, in cover grid view.

It worked great with my Count Pages column {#pp} (default is #pages), thanks!
Comfy.n is offline   Reply With Quote
Old 09-06-2025, 08:32 AM   #4
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,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@Comfy.n: glad it works for you.

Another example: change the Series tooltip to show the number of books in the library with that series.

Result:
Click image for larger version

Name:	Clipboard01.jpg
Views:	23
Size:	10.9 KB
ID:	217918

Template:
Code:
program:
	if $series then
		series_count = book_count('series:"""=' & $series & '"""', 0);
		return $series & ', book ' & $series_index & ' of ' & series_count
	fi;
	return 'This book is not in a series'
chaley is offline   Reply With Quote
Old 09-06-2025, 04:30 PM   #5
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 909
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
very good idea!!
dunhill is offline   Reply With Quote
Advert
Old 09-06-2025, 06:23 PM   #6
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,246
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Cool! Now I can add other collaborators to my authors column.
thiago.eec is offline   Reply With Quote
Old Today, 07:16 AM   #7
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,246
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Hi @chaley

Just noticed something weird with the HTML parser.
I added the translator info to the authors' tooltip using this template:
Code:
program:
	if $#translator  then
		tooltip = 'Autor: ' & $authors  & '<br/>' & 'Tradutor: ' & $#translator
	else
		tooltip = 'Autor: ' & $authors
	fi;
	tooltip
This made my tooltip's width to shrink.

Here it is without the <br/>:
Click image for larger version

Name:	no BR.png
Views:	15
Size:	5.0 KB
ID:	217982

Now, with the <br/>:
Click image for larger version

Name:	with BR.png
Views:	18
Size:	9.6 KB
ID:	217983

Last edited by thiago.eec; Today at 07:22 AM.
thiago.eec is offline   Reply With Quote
Old Today, 07:24 AM   #8
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,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by thiago.eec View Post
Hi @chaley

Just noticed something weird with the HTML parser.
I added the translator info to the authors' tooltip using this template:
Code:
program:
	if $#translator  then
		tooltip = 'Autor: ' & $authors  & '<br/>' & 'Tradutor: ' & $#translator
	else
		tooltip = 'Autor: ' & $authors
	fi;
	tooltip
This made my tooltip's width to shrink.

Here it is without the <br/>:
Attachment 217982

Now, with the <br/>:
Attachment 217983
Qt's tooltip display will choose different box dimensions for HTML vs plain text. Unfortunately I can't do anything about it. Showing the authors 1 per line might give you results you prefer.
chaley is offline   Reply With Quote
Old Today, 08:36 AM   #9
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,246
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by chaley View Post
Qt's tooltip display will choose different box dimensions for HTML vs plain text. Unfortunately I can't do anything about it. Showing the authors 1 per line might give you results you prefer.
I see. I've changed my template to one author per line and it worked.

P.S: I did this using Python Mode. I could not find a way to interpret the authors field as list in the regular Template Mode. What am I missing?
thiago.eec is offline   Reply With Quote
Old Today, 08:42 AM   #10
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,493
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by thiago.eec View Post
P.S: I did this using Python Mode. I could not find a way to interpret the authors field as list in the regular Template Mode. What am I missing?
Use a for loop, as in
Code:
program: 
	res = 'Authors:';
	for aut in "authors":
		res = res & '<br>' & aut
	rof;
	res
If a for loop is given the lookup name of a column it uses the separator for that column. If you have the list in a variable then the following works:
Code:
program: 
	res = 'Authors:';
	for aut in $authors separator '&':
		res = res & '<br>' & aut
	rof;
	res
chaley is offline   Reply With Quote
Old Today, 08:58 AM   #11
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,246
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by chaley View Post
Use a for loop, as in
Code:
program: 
	res = 'Authors:';
	for aut in "authors":
		res = res & '<br>' & aut
	rof;
	res
If a for loop is given the lookup name of a column it uses the separator for that column. If you have the list in a variable then the following works:
Code:
program: 
	res = 'Authors:';
	for aut in $authors separator '&':
		res = res & '<br>' & aut
	rof;
	res
Now I see my error. I was doing this:
Code:
for aut in $authors:
I didn't know about the 'separator' bit.

Thanks for your help!
thiago.eec is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Book List View on front page Amalthia PocketBook 5 01-01-2024 03:37 AM
tooltips in the list of books Fynjisx Library Management 1 11-23-2022 04:56 AM
Delete Dates from Book List View Rellwood Calibre 6 04-01-2022 02:19 PM
Calibreserver issue using Book list mode/Custom list fritskop Server 2 06-16-2020 01:20 PM
View list of custom column settings? BookJunkieLI Calibre 8 07-25-2014 09:36 AM


All times are GMT -4. The time now is 11:12 AM.


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