Results 1 to 4 of 4

Thread: Button icon 20 x 16 being cropped

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    10
    Vote Rating
    0
      0  

    Default Unanswered: Button icon 20 x 16 being cropped

    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

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,412
    Answers
    3898
    Vote Rating
    1288
      0  

    Default

    Icon should be 16x16... but you can change the CSS to fit what you need
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    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 services@sencha.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.

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    10
    Vote Rating
    0
      0  

    Default

    Could you give an example of how to do this? I am using ExtJS 4.0

    Thanks

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,790
    Answers
    583
    Vote Rating
    390
      0  

    Default

    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •