Link to home
Start Free TrialLog in
Avatar of Member_2_4694817
Member_2_4694817

asked on

Custom button type in DVD-Styler

I want to create a button with DVD-Styler (on Kubuntu) that is not covered by the available button types: The button should consist of an image that cahanges visibility or opacity when selecting/highlighting. Existing button templates allow other changes of style, e.g. stroke and fill colour changes with selecting/highlighting.
I tried the following by letting me inspire from the syntax of existing files:
In directory /usr/share/dvdstyler/buttons I copied frame.xml to appear.xml and slightly edited it (see code below) - actually I originally tried something different with giving decimal values to parameter "opacity" directly instead of giving text values to "style", but the result (i.e. none) was the same.

After that, DVD-Styler indeed offerd another button type in its GUI, however with no option to change my newly created parameter. I attempted to control it directly by editing the dvd project xml file, but without success.
Is there any way to produce such a "button image appears only when selected" effect with DVD-Styler?
<?xml version="1.0" encoding="utf-8"?>
<button>
  <title>Appearing Image</title>
  <svg>
    <image id="image" x="10%" y="10%" width="80%" height="80%" style="opacity:0.1;"/>
        <rect id="rect" x="10%" y="10%" width="80%" height="80%"
      rx="5" ry="5" stroke="#FFFFFF" stroke-width="5" fill="none"/>
  </svg>
  <parameters>
    <parameter>
      <title>Image</title>
      <name>href</name>
      <type>image</type>
      <element>image</element>
      <attribute>xlink:href</attribute>
    </parameter>
    <parameter>
      <title>Image style</title>
      <name>imgstyle</name>
      <type>text</type>
      <element>image</element>
      <attribute>style</attribute>
      <changeable/>
        <default-value>
                <highlighted>opacity:1.0;</highlighted>
                <selected>opacity:1.0;</selected>
        </default-value>
    </parameter>
    <parameter>
      <title>Rx</title>
      <name>rx</name>
      <type>integer</type>
      <element>rect</element>
          <attribute>rx</attribute>
    </parameter>
    <parameter>
      <title>Ry</title>
      <name>ry</name>
      <type>integer</type>
      <element>rect</element>
          <attribute>ry</attribute>
    </parameter>
    <parameter>
      <title>Border width</title>
      <name>stroke-width</name>
      <type>integer</type>
      <element>rect</element>
          <attribute>stroke-width</attribute>
    </parameter>
        <parameter>
      <title>Border colour</title>
      <name>stroke</name>
      <type>colour</type>
      <element>rect</element>
          <attribute>stroke</attribute>
          <changeable/>
          <default-value>
             <highlighted>#0000FF</highlighted>
                 <selected>#FF0000</selected>
          </default-value>
    </parameter>
        <parameter>
      <title>Inner colour</title>
      <name>fill</name>
      <type>colour</type>
      <element>rect</element>
          <attribute>fill</attribute>
          <changeable/>
          <default-value>
             <highlighted>none</highlighted>
                 <selected>none</selected>
          </default-value>
    </parameter>
  </parameters>
  <init-parameter>href</init-parameter>
  <default-size>
    <width>160</width>
    <height>120</height>
  </default-size>
  <min-size>
    <width>8</width>
    <height>8</height>
  </min-size>
</button>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Member_2_1239314
Member_2_1239314

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_4694817
Member_2_4694817

ASKER

Hm, good idea - add the intended image to the background and make the button transparent (selected) or backgroud colour (when not selected).
However, this won't help with non-constant background.
Maybe I can explore that anyway ...
Not exactly what I was after, but could make good use of this trick