Eran Betzalel
Eran Betzalel

Reputation: 4203

How to remove the icon indent in Flex control Menu?

I use PopUpButton object and inside a Menu object. For some reason it has default text indent (even when an icon is not defined). How can I remove this indent?

Upvotes: 1

Views: 267

Answers (1)

Christian Nunciato
Christian Nunciato

Reputation: 10409

Someone probably has a more elegant solution, but setting the paddingLeft style of your menu to a negative number seems to work just fine (I'm using a PopUpMenuButton to illustrate, but a PopUpButton with a Menu would work just the same):

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

    <mx:Style>

        Menu
        {
            paddingLeft: -12;
        }

    </mx:Style>

    <mx:XMLList id="myData">
        <node label="One"/>
        <node label="Two"/>
        <node label="Three"/>
    </mx:XMLList>

    <mx:PopUpMenuButton id="myButton" dataProvider="{myData}" label="Click Me" labelField="@label" />

</mx:Application>

Hope that helps!

Upvotes: 2

Related Questions