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 03-26-2020, 01:06 PM   #1
Frizzell
Enthusiast
Frizzell began at the beginning.
 
Frizzell's Avatar
 
Posts: 33
Karma: 10
Join Date: Sep 2017
Location: Royston, Georgia
Device: Moon Reader & Prestigio on Android
Multiple icons in a column when in Book List view

Displaying multiple icons in one column seems elusive to me...

On the topic of using icons in columns (book list view), how many icons can be placed in one column and how many on the same row? So far, I haven't been able to create more than three rules for three icons in my 'Formats' column, and I had to double up a couple of icons to simulate two icons at once(See Screenshot). Is two icons the limit on the same row, or am I doing something wrong? I created icons for the four different eBook formats I use in my library, one each for epub, original_epub, mobi and pdf.

If anyone's an expert at creating rules for 'Column icons', I sure would like to see an example of how to make 'Four' rules for one column, and have all four display on the same row. Here is what I have so far:

RULE ONE:
Set the icon with no text of 'Format' to epub_original.png if the following conditions are met:
•If the Format column contains value: ORIGINAL_EPUB

RULE TWO:
Set the icon with no text of 'Format' to epub_pdficon.png if the following conditions are met:
•If the Format column contains value: PDF

RULE THREE
Set the icon with no text of 'Format' to epubicon.png if the following conditions are met:
•If the Format column contains value: EPUB


RULE FOUR: ***THIS ONE DOESN'T DISPLAY ICON***
Set the icon with no text of 'Format' to epub_mobiicon.png if the following conditions are met:
•If the Format column contains value: MOBI

Thanks,
Frizzell

"Why a four year old child could understand this.
Run out and get me a four year old child,
I can't make head or tail out of it"
Attached Thumbnails
Click image for larger version

Name:	screenshot_001.jpg
Views:	247
Size:	47.5 KB
ID:	177950  
Frizzell is offline   Reply With Quote
Old 03-26-2020, 04:43 PM   #2
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: 20,779
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
AFAIK there's no limit on the number of icons that can be placed in a 'composed icon', I have one with six. I create integer columns on which to hang composed icons, so I use the 'composed icon with no text' option.

I think of a composed icon as a fixed array, with each slot assigned to condition. e.g. first slot gets a transparent_square if there's no epub else it gets an epub icon; second slot gets transparent_square if there's no pdf else it gets an pdf icon etc.

If you want a transparent square knock the .txt off the end of the attachment.

BR
Attached Files
File Type: txt transparent_square.png.txt (2.2 KB, 187 views)
BetterRed is online now   Reply With Quote
Advert
Old 03-26-2020, 07:54 PM   #3
Frizzell
Enthusiast
Frizzell began at the beginning.
 
Frizzell's Avatar
 
Posts: 33
Karma: 10
Join Date: Sep 2017
Location: Royston, Georgia
Device: Moon Reader & Prestigio on Android
Two icons limit (or composed icons) per column

Quote:
Originally Posted by BetterRed View Post
AFAIK there's no limit on the number of icons that can be placed in a 'composed icon', I have one with six. I create integer columns on which to hang composed icons, so I use the 'composed icon with no text' option.

I think of a composed icon as a fixed array, with each slot assigned to condition. e.g. first slot gets a transparent_square if there's no epub else it gets an epub icon; second slot gets transparent_square if there's no pdf else it gets an pdf icon etc.

If you want a transparent square knock the .txt off the end of the attachment.

BR
I understand what you are describing, and I take it that since you are creating multiple 'Integer' columns, then the primary answer to my question is, "Yes, you can only have two separate icons in one column."

Well, that certainly seems limiting as to the number of rules per column. Can you post a screenshot of your 'Book List' view so I can see exactly what you've done?

Thanks Red,
Frizzell

"Why a four year old child could understand this.
Run out and get me a four year old child,
I can't make head or tail out of it"

Last edited by Frizzell; 03-26-2020 at 07:57 PM. Reason: add title
Frizzell is offline   Reply With Quote
Old 03-26-2020, 09:31 PM   #4
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: 20,779
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
No, multiple icons on one Integer, screen shots from my Test library

Book List

Click image for larger version

Name:	Annotation 2020-03-27 122539.jpg
Views:	297
Size:	62.7 KB
ID:	177955

Column Icon Rules

Click image for larger version

Name:	Annotation 2020-03-27 122651.jpg
Views:	294
Size:	179.6 KB
ID:	177956


BR

Last edited by BetterRed; 03-26-2020 at 09:43 PM.
BetterRed is online now   Reply With Quote
Old 07-23-2022, 06:34 AM   #5
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Sorry for necroing this old thread.

If I have two conditions with true/false to show two icons simultaneously I will need 4 rules with composed icon sets?

00
xx
0x
x0
Wiggo is offline   Reply With Quote
Advert
Old 07-23-2022, 07:14 AM   #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: 11,864
Karma: 7036239
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Wiggo View Post
Sorry for necroing this old thread.

If I have two conditions with true/false to show two icons simultaneously I will need 4 rules with composed icon sets?

00
xx
0x
x0
Yes, if you want different icons for true and false.

I think it would be easier to use a single advanced rule that returns a compound icon. Something like this, but with the column names changed and the logic you want.
Code:
program:
	icon1 = if $$#myint != 'none' then 'cry-icon.png' else 'dictionary.png' fi;
	icon2 = if $$#mybool != 'true' then 'arrow-down.png' else 'arrow-up.png' fi;
	icon1 & ':' & icon2
EDIT: added image of results
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	120
Size:	6.7 KB
ID:	195255  

Last edited by chaley; 07-23-2022 at 07:27 AM. Reason: Added image
chaley is offline   Reply With Quote
Old 07-23-2022, 10:15 AM   #7
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by chaley View Post
Code:
program:
	icon1 = if $$#myint != 'none' then 'cry-icon.png' else 'dictionary.png' fi;
	icon2 = if $$#mybool != 'true' then 'arrow-down.png' else 'arrow-up.png' fi;
	icon1 & ':' & icon2
Thank you so much again!

Code:
program:
	icon1 = if $$languages == 'englisch' then 'uk.png' else '' fi;
	icon2 = if $$#read == 'true' then 'ok.png' else  '' fi;
	icon3 = if $$#redl == 'true' then 'auto-reload.png' else '' fi;
	icon4 = if $$#toread == 'true' then 'reference.png' else '' fi;
	icon1 & ':' & icon2 & ':' & icon3 & ':' & icon4
I don't get language to work and not a 3x condition for #read (true, false, not defined).
Wiggo is offline   Reply With Quote
Old 07-23-2022, 11: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: 11,864
Karma: 7036239
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Wiggo View Post
Code:
program:
	icon1 = if $$languages == 'englisch' then 'uk.png' else '' fi;
	icon2 = if $$#read == 'true' then 'ok.png' else  '' fi;
	icon3 = if $$#redl == 'true' then 'auto-reload.png' else '' fi;
	icon4 = if $$#toread == 'true' then 'reference.png' else '' fi;
	icon1 & ':' & icon2 & ':' & icon3 & ':' & icon4
I don't get language to work and not a 3x condition for #read (true, false, not defined).
I think you want something like this.
Code:
program:
	def add_icon(icon, val):
		if icon == '' then icon = val else icon = icon & ':' & val fi;
		return icon
	fed;

	icon = '';
	if $languages == 'eng' then icon = add_icon(icon, 'uk.png') fi;
	icon = add_icon(
		icon, 
		switch(
			$$#read,
			'true', 'ok.png',
			'false', 'false_icon.png',
			'unset_icon.png'));
	if $$#redl == 'true' then add_icon(icon, 'auto-reload.png') fi;
	if $$#toread == 'true' then add_icon(icon, 'reference.png') fi;
	return icon
Rationale:
  • The language code check must look for the three-letter value as shown in this web page, not the full language name. If you want to indicate other languages then use a switch() as explained below.
  • Using $$ (raw_field()) of a tristate boolean returns one of three values: "true", "false", and "none". These are not translated.
  • The switch function is a good substitute for a sequence of if/then/elif/else that check string matches.
  • It is best for performance not to have empty values separated by colons. The add_icon function takes care of that by adding the colon only if the icon string already has a value.
chaley is offline   Reply With Quote
Old 07-23-2022, 01:14 PM   #9
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
note to myself: buy chaley some beer

three-letter value

Code:
program:
	def add_icon(icon, val):
		if icon == '' then icon = val else icon = icon & ':' & val fi;
		return icon
	fed;

	icon = '';
	if $languages == 'eng' then icon = add_icon(icon, 'uk.png') fi;
	icon = add_icon(
		icon, 
		switch(
			$$#toread,
			'true', 'toread.png',
			'false', 'false.png',
			''));
	if $$#redl == 'true' then icon = add_icon(icon, 'redl.png') fi;
	if $$#read == 'true' then icon = add_icon(icon, 'ok.png') fi;
	return icon
Two modifications to your code. I had to add "icon =" to both bottom ones. It took me a while to figure this out.

Wiggo is offline   Reply With Quote
Old 07-23-2022, 01:54 PM   #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: 11,864
Karma: 7036239
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Wiggo View Post
note to myself: buy chaley some beer

chaley is offline   Reply With Quote
Old 02-05-2023, 10:17 AM   #11
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
I have an #annots column 'Long text, like comments, not in tag browser' for annotations and I want - like above - an icon if there are annoations.

Code:
program:
	def add_icon(icon, val):
		if icon == '' then icon = val else icon = icon & ':' & val fi;
		return icon
	fed;

	icon = '';
	if $languages == 'eng' then icon = add_icon(icon, 'uk.png') fi;
	icon = add_icon(
		icon, 
		switch(
			$$#toread,
			'true', 'toread.png',
			'false', 'false.png',
			''));
	if $$#formats == 'paper' then icon = add_icon(icon, 'paper.png') fi;
	if $$#read == 'true' then icon = add_icon(icon, 'ok.png') fi;
	if $$#readinglist != '' then icon = add_icon(icon, 'reading_list.png') fi;
	if $$#annots != '' then icon = add_icon(icon, 'annotations.png') fi;
	return icon
With this code I get the icon on every book.

I also tried
Code:
	if $$#annots == 'true' then icon = add_icon(icon, 'annotations.png') fi;
I don't get any annot icon

Some help much appreciated
Wiggo is offline   Reply With Quote
Old 02-05-2023, 10:44 AM   #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: 9,049
Karma: 62040591
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
The second template is checking that the column has a value of 'true.'

Here's what I would try:

Code:
program: if $$#annots then 'annotations.png' fi

Last edited by ownedbycats; 02-05-2023 at 10:46 AM. Reason: slight error in template
ownedbycats is offline   Reply With Quote
Old 02-05-2023, 11:01 AM   #13
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
thx, but doesn't work
Wiggo is offline   Reply With Quote
Old 02-05-2023, 12:36 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: 9,049
Karma: 62040591
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Dang, it works for me (though I used a different long-text column).
ownedbycats is offline   Reply With Quote
Old 02-05-2023, 12:49 PM   #15
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 415
Karma: 1153449
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
I placed your code in my list, not as a single one (don’t know how to say in a better way)
Wiggo is offline   Reply With Quote
Reply

Tags
column icons, customize, icons, preferences


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
added custom column icons render larger than original icons masp Library Management 12 01-22-2019 04:07 PM
customized column icons now Micro-icons Gary_M_Mugford Calibre 10 09-05-2016 04:05 AM
View list of custom column settings? BookJunkieLI Calibre 8 07-25-2014 09:36 AM
Multiple icons in a column? RenoA Library Management 2 09-09-2013 03:20 AM
REMOVE multiple files in Book view wizard2b Sigil 1 05-09-2011 09:14 PM


All times are GMT -4. The time now is 07:54 AM.


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