blob: b06593c595e746f830f0e340c77df61048fdadeb [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<!--- The Spark skin class for the border of the Halo TextInput component.
@langversion 3.0
@playerversion Flash 10
@playerversion AIR 1.5
@productversion Flex 4
-->
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
implements="mx.core.IBorder">
<fx:Script>
<![CDATA[
import mx.core.EdgeMetrics;
import mx.core.IUIComponent;
static private const metrics:EdgeMetrics = new EdgeMetrics(2, 2, 2, 2);
public function get borderMetrics():EdgeMetrics
{
if (getStyle("borderStyle") == "none")
return EdgeMetrics.EMPTY;
return metrics;
}
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
if (getStyle("borderStyle") == "none")
{
border.visible = false;
shadow.visible = false;
background.visible = false;
}
else
{
if (getStyle("borderVisible") == false)
{
border.visible = false;
shadow.visible = false;
background.left = background.top = background.right = background.bottom = 0;
shadow.left = shadow.top = shadow.right = 0;
}
else
{
border.visible = true;
shadow.visible = true;
background.left = background.top = background.right = background.bottom = 1;
shadow.left = shadow.top = shadow.right = 1;
}
}
super.updateDisplayList(unscaledWidth, unscaledHeight);
if (parent && parent is IUIComponent && !IUIComponent(parent).enabled)
alpha = 0.5;
else
alpha = 1;
}
]]>
</fx:Script>
<!-- border -->
<s:Rect left="0" right="0" top="0" bottom="0" id="border">
<s:stroke>
<s:SolidColorStroke id="borderStroke" weight="1" color="0x82826b" />
</s:stroke>
</s:Rect>
<!-- fill -->
<s:Rect id="background" left="1" right="1" top="1" bottom="1">
<s:fill>
<s:SolidColor id="bgFill" color="0xf3f4de" />
</s:fill>
</s:Rect>
<!-- shadow -->
<s:Rect id="shadow" left="1" top="1" right="1" height="1">
<s:fill>
<s:SolidColor color="0x000000" alpha="0.12" />
</s:fill>
</s:Rect>
</s:Skin>