PDA

View Full Version : Button icon 20 x 16 being cropped



johnterran
19 Dec 2011, 12:11 PM
Hi,

I am a ExtJS newbie and I am trying to create a button with icon 20x16, but it is being cropped at 16px width.
What is the best way to create a button that displays 20x16 icon?

Thanks
John

mitchellsimoens
19 Dec 2011, 1:06 PM
Icon should be 16x16... but you can change the CSS to fit what you need

johnterran
19 Dec 2011, 1:35 PM
Could you give an example of how to do this? I am using ExtJS 4.0

Thanks

skirtle
19 Dec 2011, 6:02 PM
I don't have an example to hand but I can explain the technique.

Break out Firebug or a similar tool and inspect the HTML elements used to create the button. See how the iconCls is applied and the styling used by the various elements to support a 16x16 icon. Adjust the styles inline in Firebug to get it looking the way you want. If all the styles you change are on elements below the iconCls then you just need to add the appropriate CSS rules to your stylesheet. However, if you need to change elements further up the chain then add a cls config to the button. This will add a CSS class to the outermost div. Your CSS selectors can then be written in terms of this class.