/*
 * Copyright 2012 Amadeus s.a.s.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

{CSSTemplate {
    $classpath : "aria.widgets.action.ButtonStyle",
    $extends : "aria.widgets.WidgetStyle"
}}
    {var skinnableClassName="Button"/}
    {var useFrame=true/}

    {macro main()}
        .xButton {
            background:none repeat scroll 0 0 transparent;
            border:0 none;
            cursor:pointer;
            {if aria.core.Browser.isFirefox}
              margin: -1px -3px -1px -3px;
            {else/}
              margin: -1px 0px -1px 0px;
            {/if}
            padding:0;
            vertical-align:top;
            tabindex:10;
        }

        {if aria.core.Browser.isIE7}
            .xButton .xFrameContent {
                text-align: center;
            }
        {/if}

        button.xButton::-moz-focus-inner {
             border: 0;
        }

        .xButtonDisabled {
            cursor:default;
        }

        .xButtonDisabled:focus {
            outline: 1px dotted black;
        }

        {call startLooping()/}
    {/macro}

    {macro writeSkinClass(info)}
        .xBTNbkg_${info.skinClassName} {
            /* old type of button (to remove) */
            {call background("transparent",info.spriteURL,"no-repeat")/}
        }
    {/macro}

    {macro writeState(info)}
        {var buttonTextFont = info.state.frame.font /}
        {if !(buttonTextFont && buttonTextFont.fontWeight)}
            .${cssPrefix(info)}c {
                font-weight: ${info.skinClass.label.fontWeight}
            }
        {/if}
    {/macro}

{/CSSTemplate}
