PDA

View Full Version : Button Icon not filling the entire button area



ssdesign
21 Oct 2010, 10:26 PM
Hi,
I am trying to use the "icon" property of the button and trying to change the look of the button.
I am not sure if this is the right way to do it as I could not find out how to make an image behave like a button.

So, when I use icon property of the button, there is a spacing all around the image and my image gets scaled down.

For example, I have a image which is 80x80 pixels.
I created a 80x80 pixel button.
Then assigned this image as iconfor the button.
The result is, the image sits in the middle of this buttons and the image is scaled down to 38x38 pixels.

Is there a way so that the icon image can fill the entire button area?

Thanks a lot.

steve1964
15 Dec 2010, 3:41 AM
Same problem, anyone?

tomalex0
15 Dec 2010, 6:14 AM
{
xtype: 'button',
ui: 'plain',
iconMask: false,
icon: 'yourimage.png'
}


Can you try this.

steve1964
15 Dec 2010, 6:40 AM
Not working in 1.0.1 try to give a width of 50 and a height of 200 to the button and try to put 50x200 image, the image does not scale you see only the middle of the image in a square of 25x25 pixel

tomalex0
15 Dec 2010, 10:47 PM
{
xtype: 'button',
ui: 'plain',
iconMask: false,
cls:'pickercls',
icon: 'yourimage.png'
}




.pickercls img{
width: 7em !important;
height: 2em !important;
}
.pickercls.x-button-pressed img{
background-color:transparent !important;
}


Try this.
Its working for me.