01-18-2019, 10:25 PM | #1 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Sep 2014
Device: ipad air
|
added custom column icons render larger than original icons
I'm trying to use column icon rules to map some custom column text to icons: the columns already contains 'Yes' and 'No' and those are displayed as checkmark and cross, respectively, as they should. I'm using copies of those same two icons to create my new icons, and everything works, except that the new icons (which are being placed in the cc_icons directory by calibre, as expected) are being displayed at a slightly larger scale than the original ones. At a glance I'd say they're about 50% bigger than the originals. I have noticed that when I use an exact duplicate of an existing icon to "add icon", the new PNG file that's created in cc_icons is about 25% larger than the original PNG file, but is still 128 pixels square. Any idea what's going on? How can I force my new ("add icon") icons to render at the same scale as they do when they're automatic "show checkmarks" icons?
Thanks! |
01-18-2019, 10:27 PM | #2 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Sep 2014
Device: ipad air
|
Attached screenshot showing new, larger custom icon, below two instances of original icon (from which it was copied).
|
Advert | |
|
01-18-2019, 10:29 PM | #3 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Sep 2014
Device: ipad air
|
trying again to add screenshot...
|
01-19-2019, 09:55 AM | #4 |
Deviser
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
I made my "Entity Manager" plug-in icons smaller than otherwise shown in the Library View by using Irfanview to create one that looks smaller, although it is still 128x128. Simply open an original copy in Irfanview, and then:
[1] Resize to 128x128 if it is not already [2] Click Image > Add Border/Frame [3] Select Plain White Frame [4] Change the top border width to 50 pixels (the others 0) and Add the Frame [5] Repeat #4 to make it even smaller in the end [6] Resize the entire image back to 128x128 (it grew with the Frame) collapsing the original towards the middle. [7] Click Edit > Show Paint Dialog [8] Select White with the bucket of paint tool [9] Fill in all areas around the original icon with White [10] Save as a .png, clicking on the White as the .png "Transparent" color The 128x128 icon now has more White around the original icon, making it look smaller in the Library View because of the transparent color around it. DaltonST Last edited by DaltonST; 01-19-2019 at 09:57 AM. |
01-19-2019, 04:16 PM | #5 |
null operator (he/him)
Posts: 20,855
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@masp - it would seem that different icon display sizing algorithms are used for the Yes/No (and checkmarking) icons and column icons. Maybe because a column icon can be displayed along side its text, or within a composed set (array) of icons, or maybe because it just is
You could do as DaltonST suggests and edit the green tick and red cross icons to have a transparent frame before you add them to cc-icons, or you could find some alternative icons. I'd do the latter so as to clearly distinguish my column icons from calibre's Yes/No icons. BR |
Advert | |
|
01-19-2019, 08:54 PM | #6 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Sep 2014
Device: ipad air
|
@DaltonST thanks for the detailed workaround: I will try to find a suitable mac osx application (maybe the Gimp?) to do it.
@BetterRed yes that's what I figured: I was trying to be a bit lazy since my column is already a yes/no column, but with added likely/maybe/unlikely values in the middle, so I was hoping to be able to continue using automatic checkmarks for yes and no, and then add custom (icon) rules for likely/maybe/unlikely: that clearly works, just looks awkward due to the different scaling algorithms. I'll use the icon resizing trick to try to match the scales for now (assuming I can't just get over the aesthetic jarring sensation and continue with the mis-matched scales!) Thanks! |
01-19-2019, 11:34 PM | #7 |
null operator (he/him)
Posts: 20,855
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@masp - even if the resizing was consistent, I'd still avoid using the icons used by Yes/No columns.
I'd use a program mode template that sets the icon for each of the possible values (true, likely, maybe, unlikely and false) in a single column icon rule. Having the icon controlled by a column definition setting AND column icon rule settings would confuse me no end. I can't remember exactly why, but I consciously avoid using calibre's built in icons for column icons, I suspect it might be something to do with the built in icons changing in version 2, or was it 3. BR Last edited by BetterRed; 01-19-2019 at 11:40 PM. |
01-19-2019, 11:56 PM | #8 |
creator of calibre
Posts: 44,264
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC the display path for yes/no icons and custom icons is totally different, one is rendered by Qt and is dependent on the Qt style/theme, the other by calibre, so you are unlikely to get consistent results.
|
01-21-2019, 02:07 PM | #9 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Sep 2014
Device: ipad air
|
@BetterRed thanks that's a good point! This is my current template:
{tags:'in_list($, ",", "keep", "Yes", "^probably keep ?.*", "Likely", "^possibly keep ?.*", "Maybe", "^probably discard ?.*", "Unlikely", "^discard ?.*", "No", "")'} Can you possibly give me an example of how to modify that to generate an icon rather than text? Many thanks in advance! @kovidgoyal Thanks that makes sense: I'll try to stop obsessing over the typography |
01-21-2019, 02:09 PM | #10 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Sep 2014
Device: ipad air
|
Actually what I'd really like is to be able to define a new (5+1 state) "Yes/No" column *type* (Yes/Likely/Maybe/Unlikely/No + empty), and then be able to use assign that new column type to any custom column: I can't see any way to do that, but is it conceivably possible?
|
01-21-2019, 03:59 PM | #11 | |
null operator (he/him)
Posts: 20,855
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
The nearest you will to get to what what you want, is to define multiple columns with column type "Text, with a fixed set of permitted values", with the same set of values. There is no copy column definition feature. It maybe possible to devise a reusable Template Function (python) to set the icons for the similarly defined custom columns. Or use Export (json), a bit of cut/paste/edit in a editor, and Import. BR |
|
01-22-2019, 03:33 PM | #12 |
Enthusiast
Posts: 47
Karma: 10
Join Date: Sep 2014
Device: ipad air
|
@BetterRed thanks: one remaining point of confusion for me: when you said "I'd use a program mode template that sets the icon for each of the possible values (true, likely, maybe, unlikely and false) in a single column icon rule", I can't figure out how to make my custom column template output icons...
|
01-22-2019, 04:07 PM | #13 |
null operator (he/him)
Posts: 20,855
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@masp - something like this (not tested)
Code:
program: first_non_empty ( contains(field('#keep'), "Yes", 'MyYes.png', ''), contains(field('#keep'), "Likely", 'MyLikely.png', ''), contains(field('#keep'), "Maybe", 'MyMaybe.png', ''), contains(field('#keep'), "Unlikely", 'MyUnlikely.png', ''), contains(field('#keep'), "No", 'MyNo.png', '') ) Tip - keep this handy ==>> Reference for all built-in template language functions - on paper, device, 2nd monitor BR |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I create a icons only custom column? | pleiadesc | Library Management | 3 | 09-24-2017 08:58 PM |
customized column icons now Micro-icons | Gary_M_Mugford | Calibre | 10 | 09-05-2016 04:05 AM |
Custom Column Icons? | tarisea | Library Management | 90 | 01-17-2014 06:12 PM |
Multiple icons in a column? | RenoA | Library Management | 2 | 09-09-2013 03:20 AM |
Classic Original nook icons for mynook.ru Launcher? | Kypt | Barnes & Noble NOOK | 5 | 09-17-2010 11:32 AM |