19 Dec 2011 12:11 PM #1
Unanswered: Button icon 20 x 16 being cropped
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?
19 Dec 2011 1:06 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Icon should be 16x16... but you can change the CSS to fit what you needMitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
19 Dec 2011 1:35 PM #3
Could you give an example of how to do this? I am using ExtJS 4.0
19 Dec 2011 6:02 PM #4
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.