1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    15
    Vote Rating
    0
    nixerella is on a distinguished road

      0  

    Default Unanswered: button image width problem

    Unanswered: button image width problem


    I'm new to this and using 4.0.6. I have a panel with 9 image buttons on (3 x 3 - I'm getting them in rows by restricting the width of the panel which is probably bad but am open to other ideas). Each image is 22px by 22px. I'm using iconCls:"myClass" and myClass in css is a background image with a url and !important.

    The button doesn't display the full image - it looks as if it has sort of slid off the edge a bit. I read somewhere to try using cls:"myClass" instead of iconCls, but that results in blank buttons in IE8. Do I need to specify the widths in the button config in order to get this to work? Or if not, what?

  2. #2
    Sencha User tobiu's Avatar
    Join Date
    May 2007
    Location
    Munich (Germany)
    Posts
    2,669
    Answers
    130
    Vote Rating
    110
    tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all tobiu is a name known to all

      0  

    Default


    take a look at:
    http://docs.sencha.com/ext-js/4-0/#!...tton-cfg-scale

    there are 3 scales available, the default one is small optimized for 16px icons. medium will fit better with 24px.

    if you want exactly 22px, you would probably do best defining an own scale to achieve this.
    Best regards
    Tobias Uhlig
    __________

    S-CIRCLES Social Network Engine

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    15
    Vote Rating
    0
    nixerella is on a distinguished road

      0  

    Default


    medium scale isn't bad but I think I need exactly 22 (all the buttons together form a picture). So if I called my scale "smallMedium" how do I define the css? I can see some classes in firebug but can't quite get it right - getting a blank button again.

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,509
    Answers
    528
    Vote Rating
    288
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    I think you'd be better to approach this using Sass rather than CSS. There are a lot of subtle things going on in that CSS that the button Sass will handle for you.

Thread Participants: 2