简体   繁体   中英

Icon size of imageorient selection

I have extended the imageorient selection with some additional options:

TSconfig:

TCEFORM.tt_content.types.textmedia.addItems{
  101 = XL Image
  101.icon = img_xl
  # …
}

The new icons are already registered via the Icon API in a sitepackage.

ext:sitepackage/Configuration/Icons.php

<?php
   return [
        'img_xl' => [
            'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
            'source' => 'EXT:sitepackage/Resources/Public/Icons/Content/img_xl.svg',
        ],
        'mybitmapicon' => [
            'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
            'source' => 'EXT:sitepackage/Resources/Public/Icons/Content/test.png',
        ],
   ];

It looks like this:

在此处输入图片说明

They are displayed with 16x16 pixels, no matter how big they actually are (I tried it with svg and png of different sizes). Since some are a bit more complex than the standard icons, I would like to make them larger. Whether the standard icons scale is not important.

Is there any way to influence the output size?

In the TCA Reference it looks like this could be possible , since the example has larger images shown. Probably the TCA would need to be modified via ext:sitepackage/Configuration/TCA/Overrides/tt_content.php , but it's unclear to me how exactly.

These icons are rendered in SelectIcons::render() ( Code ) using the FormEngineUtility::getIconHtml() -function ( Code ).

The rendering depends on the icons declaration:

Icons as file-reference

The Icons are rendered without width/height attributes in HTML. So, it should be possible to use them sized as you want.

Sprite Icons name

The icons are finally rendered by calling IconFactory::createIcon ( Code ) with a fixed size of 16px ( Icon::SIZE_SMALL= 'small' // 16 ). On a simple way via configuration, another size won't (currently) be possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM