PDA

View Full Version : Removing Icon Space in Toolbar



Wesling
6 Jul 2010, 10:53 AM
I am having trouble configuring the menu items of a toolbar. I am not using any icons in the menu and would therefore like to remove that space all together. See screenshots below:

Here is the default:
21302

He is a mockup of what I would like to see:
21301

I have tried "hideLabel" but that does not seem to do anything. Am I missing another configuration option or is this not possible?

Wesling
6 Jul 2010, 10:56 AM
After posting this thread, I saw the answer in a "related thread."

http://www.sencha.com/forum/showthread.php?98019-Removing-the-icon-space.

mankz
6 Jul 2010, 10:59 AM
Try the setting "plain : true" when creating the menu. Along with some CSS it might work (untested):



a.x-menu-item {
padding-left:5px !important;
}

Wesling
6 Jul 2010, 12:47 PM
Thanks for the suggestion mankz but the plain: true approach didn't seem to remove background line on the menu.

I did get it to work with Condor's x-menu-no-icon approach. Another thing that is nice about this approach is that it does not change the default style for menu items. This way, if other menus do use the space for the icon, they will not be affected.

One thing that threw me off was that I was initializing my menu with an array of buttons so it was not immediately apparent where to add the x-menu-no-icon class. Placing it either on the menu buttons or the button that opens the menu will not work. You will need to explicitly define the menu configuration and add the cls property there.

If this issue comes up often, a hideIcons parameter might be a nice addition to the menu object.