Could you perhaps at least add a variable_get with a default for the icon size in the widget?
Best would be of course to have an option in the field for that.

Currently we've hacked the module to make the icons larger.

Comments

Anybody created an issue. See original summary.

thomas.frobieter’s picture

Or simply add font-size:22px; or somtehing inside the iconpicker.module - ln. 122.

I don't think this needs to be configurable as it's only for the backend.

K3vin_nl’s picture

Version: » 7.x-1.x-dev
Assigned: Unassigned » K3vin_nl
Status: Active » Needs review

Anybody, just curious as why you would want this? Are the icons too small to recognise? I always have a lot of icons available, so by making the icons larger the overview would get very long in my case.
Anyhow, I just made a new release in which the inline styles are in a variable, so you can override it now, without hacking the module!

Feel free to test and provide feedback.

Anybody’s picture

Thank you very very much. Yes the icons were too small for our case. We don't have that many in this case and you could not see clear enough what the icons were looking like.

I'm happy to try the dev now :) Thank you very much!

Anybody’s picture

Well, if you're using styles for that wouldn't it then make sense to simply use an iconpicker.admin.css file and include that as form attachment?

This way the size can be cleanly overridden an you don't even need the variable anymore. Just as an idea...

As BUG: You're using "iconpicker_icon_inline_style" for $inline_icon_style and $inline_label_style. The second should be iconpicker_label_inline_style instead.

K3vin_nl’s picture

Thanks, for the bug report. I'll fix that.
The reason I don't use an admin.css file is because it doesn't work in all cases. The inline styles are (very) ugly, but reliable. But I agree that an external CSS file would be the preferable solution.
For example I am using icons in a panel style and as panel pane fields. In both cases ctools special form handling caused the CSS not to get attached.

Anybody’s picture

Okay thank you for that information. Then it would be enough perhaps to add a font-size variable. It's 22px for example in our case to have the icons a bit larger. That way we don't have to override the whole string.

K3vin_nl’s picture

Status: Needs review » Fixed

@Anybody, I have just pushed a new alpha2 version in which the icon preview sizes are configurable per bundle. This nicer then overriding the whole inline CSS via a variable.
Let me know if you have any feedback!

Anybody’s picture

Status: Fixed » Needs work

Thank you very much. The setting now appears.

I think there is still an issue left: The options are just text, but the size should be an integer instead?

See:

'#options' => ['small', 'medium', 'large', 'extra large', 'mega'],

<== I think it misses an integer index?

// Retrieve the preview size from the bundle settings.
if (isset($bundle['iconpicker_icon_size'])) {
  $zoom = $bundle['iconpicker_icon_size'];
} else {
  $zoom = 2;
}

For example use:

'#options' => ['1' => 'small', '2' => 'medium',  '3' => 'large', '4' => 'extra large', '5' => 'mega'],

?

Anybody’s picture

Furthermore the value doesn't seem to be saved. It's always 1 (default) for me after saving and reloading the form.

EDIT: Sorry it works correctly, the problem was FF+zoom, see below.

Anybody’s picture

OK finally... zoom is not supported in FF ("The zoom property in CSS allows you to scale your content. It is non-standard, and was originally implemented only in Internet Explorer. "), so we would suggest to use font-size instead.

What was the reason to use zoom? Non-font-based icons?

This is our suggestion:

    $inline_icon_style = 'display: inline-block; font-size: ' . $zoom . 'rem; border: 0.5px dotted grey; margin: 0.1em; padding: 0.1em; cursor: pointer;';
    $inline_label_style = 'font-size:1rem; display: none;';

plus

'#options' => ['0.5' => 'mini', '0.7' => 'extra small', '0.8' => 'small', '1' => 'normal',  '1.5' => 'large', '2' => 'extra large', '4' => 'mega', '5' => 'giant'],
K3vin_nl’s picture

@Anybody,
Thanks for the feedback. Yes, I used zoom, as it seemed to be the most robust way of enlarging icons because icons can be font-based, image based or even SVG based.
I'll try to think of a solution that is as robust, but would also work in Firefox.