Difference between revisions of "LGUI2:Skins"

From Lavish Software Wiki
Jump to navigation Jump to search
(Created page with "A Skin is a collection of LGUI2:Templates that are activated together. == Defining a Skin == A Skin is defined by a JSON Object. A "name" property is required, and spec...")
 
Line 8: Line 8:
 
A "templates" property may be provided, and must be a JSON Object. Each value within the "templates" Object is then added to the Skin as a template, identified (named) by the key. Any number of Templates may be given.
 
A "templates" property may be provided, and must be a JSON Object. Each value within the "templates" Object is then added to the Skin as a template, identified (named) by the key. Any number of Templates may be given.
  
== Example ==
+
== Examples ==
 +
; An example originally used for testing
 
  {
 
  {
 
   "name": "test skin",
 
   "name": "test skin",
Line 52: Line 53:
 
   }
 
   }
 
  }
 
  }
 +
  
 
[[Category:LavishGUI 2]]
 
[[Category:LavishGUI 2]]

Revision as of 20:01, 4 June 2018

A Skin is a collection of Templates that are activated together.

Defining a Skin

A Skin is defined by a JSON Object.

A "name" property is required, and specifies the name of the Skin. This can be used later to identify the Skin you want to activate.

A "templates" property may be provided, and must be a JSON Object. Each value within the "templates" Object is then added to the Skin as a template, identified (named) by the key. Any number of Templates may be given.

Examples

An example originally used for testing
{
  "name": "test skin",
  "templates": {
    "window.title": {
      "verticalAlignment": "center",
      "margin": [ 2, 0, 0, 0 ]
    },
    "window.titleBar": {
      "backgroundBrush": {
        "color": [ 0, 0, 1.0 ]
      }
    },
    "contextmenu": {
      "type": "contextmenu",
      "padding": [ 1, 1, 1, 1 ]
    },
    "contextmenuitem": {
      "type": "contextmenuitem",
      "padding": [ 2, 2, 2, 2 ],
      "margin": [ 1, 1, 1, 1 ],
      "styles": {
        "gotMouseOver": {
          "backgroundBrush": {
            "color": [ 0.0, 0.0, 0.3 ]
          },
          "font": {
            "bold": true
          },
          "color": [ 1.0,1.0,0]
        },
        "lostMouseOver": {
          "backgroundBrush": {
            "color": [ 0.0, 0.0, 0.0, 0.0 ]
          },
          "font": {
            "bold": false
          },
          "color": [ 1.0,1.0,1.0]
        }
      }
    }
  }
}