Make stack control a real container instead of a controller

- Also add framed/outlined attributes to it and to LED groups
This commit is contained in:
2015-10-03 12:30:26 -04:00
parent 06ad776236
commit 8b90fa614b
9 changed files with 108 additions and 85 deletions

View File

@@ -107,6 +107,11 @@ title {
.led {
background-image: url('img/button/led-off.png');
background-position: left top;
}
.group .led {
border-color: red;
}
.button.small {

View File

@@ -175,7 +175,6 @@
<xsl:if test='./@state'>
background-image: url('img/button/led-<xsl:value-of select='./@state'/>.png');
</xsl:if>
background-position: left top;
<xsl:call-template name='set-bounds'/>
</xsl:attribute>
<xsl:value-of select='.'/>
@@ -183,33 +182,16 @@
</div>
</xsl:template>
<xsl:template match='group/led'>
<xsl:template match='group'>
<div>
<xsl:attribute name='class'>
led
group
<xsl:if test='/dialog/@debug = "true"'>debug</xsl:if>
<xsl:if test='@framed = "true"'>framed </xsl:if>
</xsl:attribute>
<xsl:if test='/dialog/@debug = "true" and @name'>
<xsl:attribute name='title'>
<xsl:value-of select='./@name'/>
</xsl:attribute>
</xsl:if>
<xsl:attribute name='style'>
color: <xsl:value-of select='./@color'/> <xsl:value-of select='/dialog/@fore'/>;
font-family:
<xsl:choose>
<xsl:when test='@font = "plain"'>'DejaVu Sans', Geneva</xsl:when>
<xsl:when test='@font = "bold"'>Capriola, Silom</xsl:when>
<xsl:otherwise><xsl:value-of select='./@font'/></xsl:otherwise>
</xsl:choose>;
border-color: red;
<xsl:if test='./@state'>
background-image: url('img/button/led-<xsl:value-of select='./@state'/>.png');
</xsl:if>
<xsl:call-template name='set-bounds'/>
</xsl:attribute>
<xsl:value-of select='.'/>
<xsl:apply-templates select='led'/>
</div>
</xsl:template>
@@ -269,7 +251,12 @@
</xsl:template>
<xsl:template match='stack'>
<div class='stack'>
<div>
<xsl:attribute name='class'>
stack
<xsl:if test='@framed = "true"'>framed </xsl:if>
</xsl:attribute>
<xsl:attribute name='style'>
color: <xsl:value-of select='./@color'/> <xsl:value-of select='/dialog/@fore'/>;

View File

@@ -77,6 +77,10 @@
<xs:attribute name="width" type="xs:integer"/>
<xs:attribute name="height" type="xs:integer"/>
</xs:attributeGroup>
<xs:attributeGroup name="frame">
<xs:attribute name="framed" default="false" type="bool"/>
<xs:attribute name="outline" default="inset" type="frameStyle"/>
</xs:attributeGroup>
<xs:attribute name="def-key" type="key"/>
<xs:attributeGroup name="font">
<xs:attribute name="font" default="bold">
@@ -130,8 +134,7 @@
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:token"/>
<xs:attribute name="framed" default="false" type="bool"/>
<xs:attribute name="outline" default="inset" type="frameStyle"/>
<xs:attributeGroup ref="frame"/>
<xs:attributeGroup ref="font"/>
<xs:attribute ref="def-key"/>
<xs:attribute name="clickable" default="false" type="bool"/>
@@ -217,6 +220,7 @@
<xs:element maxOccurs="unbounded" ref="led"/>
</xs:sequence>
<xs:attribute name="name" type="xs:token"/>
<xs:attributeGroup ref="frame"/>
<xs:attribute name="fromlist" default="none" type="xs:string"/>
</xs:complexType>
</xs:element>
@@ -232,6 +236,7 @@
<xs:element ref="slider"/>
</xs:choice>
<xs:attribute name="name" type="xs:token"/>
<xs:attributeGroup ref="frame"/>
<xs:attribute name="pages" type="xs:integer"/>
</xs:complexType>
</xs:element>
@@ -247,8 +252,7 @@
<xs:element ref="slider"/>
</xs:choice>
<xs:attribute name="name" type="xs:token"/>
<xs:attribute name="framed" default="true" type="bool"/>
<xs:attribute name="outline" default="inset" type="frameStyle"/>
<xs:attributeGroup ref="frame"/>
<xs:attribute name="style" type="scrollStyle" default="led"/>
<xs:attributeGroup ref="rect-size"/>
</xs:complexType>