Plugin:TabSRMM/Skinning format

From Miranda NG
Jump to navigation Jump to search
Other languages:

The format of a TabSRMM .tsk skin.

A skin definition contains the following elements

  • skin elements
  • assigned image items
  • independent image items
  • a settings section
A skin does not need to be complete. TabSRMM supports partially skinning, so you can define a skin which only changes the look of a few elements (buttons for example).

Skin elements specify the skinnable parts of the message window. These elements must start with a % character and the name must be one of the recognized element names. A skin element usually defines a color value or color gradient and can (optionally) have rounded corners and transparency. For more flexibility, image items can be assigned to defined skin elements. In that case, the color values are ignored and the image item will be rendered.

List of known element types

The order in which they appear in the skin file doesn't matter. Each skin element is a single section in the .tsk file, enclosed in square brackets and the section name corresponds to the name of a skin item. The item names are case-sensitive.

  • Container
  • Button
  • Buttonpressed
  • Buttonmouseover
  • InfoPanelBackground
  • Titlebutton
  • Titlebuttonpressed
  • Titlebuttonmouseover
  • Tabpage
  • Tabitem
  • Tabitem_hottrack
  • Tabitem_bottom
  • Tabitem_hottrack_bottom
  • Tabitem_active
  • Tabitem_active_bottom
  • Frame
  • FrameInactive
  • InputArea
  • MessageLog
  • Statusbarpanel
  • Statusbar
  • Userlist

A sample skin element


Items which are not configured in the skin definition file are ignored by the skinning engine (that is, these items are then rendered unskinned and will look like in any other TabSRMM window which does not use a skin).

Item records contain information about the item itself. It offers similar options like the skinning system in Clist nicer There are default values for each of these parameters; most of them are using system defaults (like default background color and such).

The meaning of the parameters

COLOR1 First color
COLOR2 Second color (only needed when a gradient should be rendered)
TOP/LEFT/RIGHT/BOTTOM The item margins (in pixels). These margins will be clipped from the target rectangle where the item should be rendered
ALPHA The transparency value (alpha). Values go from 0 (completely transparent) to 100 (completely opaque – values are therefore in percent)
GRADIENT Set this to one of up, down, right, left (without the quotes) to specify the gradient direction. Default is no gradient. The gradient direction is defined by COLOR1COLOR2
CORNER A string which may contain the values tl, tr, bl, br (again, w/o quotes). Separate multiple entries by commas. tl = top left, tr = top right, bl = bottom left, br = bottom right. Example: Corner=tl,tr (will result in rounded corners for the top left and top right corner)
COLOR2_TRANSPARENT Set it to 1 if you want to have the second color transparent, so that the gradient will blend with the background
RADIUS A numeric value specifying the corner radius when rounded corners are used

It is possible to skin only some items and leave the others unskinned. If a skin is loaded, items which are left out by the skin definition will be rendered in a standard way, so they will look like ordinary windows screen elements.

Image items

Image items are separated from the normal skin elements definitions. This allows to re-use a single image for multiple skin elements. Images are optional, because the skinning engine can work without them and draw skin items in a traditional way, using gradients only.

Images have to be 32-bit PNG images – other formats are not supported. They can be partially transparent using per-pixel alpha values.

There are 2 types of image items available

  • assigned image items – these are directly linked to at least one of the skin elements. The name of an assigned image item must start with the $ character.
  • independent image items – these are not linked and their main purpose is to provide the look for custom buttons. The name of an independent image item must start with the @ character.

Specifying the image source for an image item

There are 2 ways to do this:

  • with the Image=xxx.png statement, you can specify the source file.
  • with the Glyph=x,y,x1,y1 statement, you specify the rectangle in the glyph image. The glyphs image is a special item. Its name must be $glyphs and it must exist when you use reference the glyph image in any other image item. It's not mandatory though – if you don't want to use it, you can load each image item from an independent .png image using the Image= statement. The advantage of using glyphs is that it will provide faster rendering and consume much less resources. The glyph way allows that all skin textures can exist within a single image file.

Sizing margins

Sizing margins have to be specified as Left, Right, Top and Bottom. These margins divide the image into 9 parts. The corner parts are rendered without stretching or shrinking, other parts of the image are stretched to make it fit the target area. Sizing margins are only valid and used when all 4 margin values are specified.

Alpha is a constant alpha value which is applied after perpixel alpha values – this can be used to make a non-transparent image translucent. Alpha values are in percent, so the valid range is from 0 (completely transparent) to 100 (completely opaque).

Perpixel is a boolean value (0 or 1). If it is 1 (or any other value different from zero), the image will be rendered with per pixel alpha values.

Assign images to actual skin item(s) (assigned image items only)

This is done with the ItemX=Itemname statement. X is a 0-based index number, so the first assignment has to be Item0=foo, the second Item1=bar and so on. Itemname refers to one of the skin item names listed at the beginning of this document, without the % character.

ColorKey is a special color value which will be used to make areas of the container transparent (e.g. it can be used for rounded corners). The color key can be any value you want, but remember that any pixel with this color will appear completely transparent. the color key does only make sense for the container skin item and is ignored elsewhere.

FillColor is a color value, which, if present, will be used to fill the inner part of the target area. You can use this if you only need the margin areas of the image (one example would be the Tab page which is usually invisible covered by the message log and other message window elements). The advantage is that by using a fill color, rendering will be faster. Only makes sense for a "divided" image item (all 4 sizing margins present).

Let's look at a few examples for image items:

; Defining the global glyph image





;reference the rectangle in the glpyh image
;(top/left, bottom/right corner)


The global section has some general settings for the skin. The 3 glyphs are used for the min/max/close button on the title bar.

SbarHeight is height of the status bar in pixels. Using this, you can override the systems default status bar height and make your status bar "match" the background skin image for the container window.

FontColor is the color for text output in the message window which is normally printed with the system text color (black). this affects: the info panel labels, the status bar text, text on buttons and elsewhere.

Version=1 Mandatory, don't remove or change, or the skin won't load
Signature=101 Same – don't remove or change
FrameLessMode If set to a value not equal to zero, containers will enter frameless mode. That means, they do not use Windows theme to skin the border and caption bar. Using this mode, you can define your own border and caption bar look by configuring the skin items $Frame and $FrameInactive. They are defined in the same way as other skin items. See the next page for more info on skinning the window frame
LightShadow / DarkShadow Simple color definitions to draw "beveled" 3D shadow effects in some cases. They should match your overall skin color theme
TabTextNormal/Active/Unread/Hottrack Defines with which colors tab labels are drawn depending on the state of the tab


The client area section defines the inner padding of the message container. The values Left, Top, Bottom and Right are padding values added to the container itself and the Inner value is a padding value added to the tab control. Setting it to 0 will make the tab control border invisible, setting one or all of the Left, Top, Bottom, Right values to 0 will make the borders as small as possible.


The WindowFrame section is only valid in frameless mode (that is, when you are using your own border and caption bar skinning). It defines the width of the Window border(s) – one value per side and one for the caption bar itself.

The other values in this section define the metrics for the title bar buttons – width, height and a top offset and the CaptionOffset defines the top offset for the window icon and the title bar text.

TitleButtonWidth = 12
TitleButtonHeight = 12
TitleButtonTopOffset = 7
CaptionOffset = 6

Skinning the window frame

This is a somewhat special case. To skin the window frame, you have to define the following 2 items:

  • Frame
  • FrameInactive

Of course, you can add image items to these skin definitions like everywhere else.

To enable the skinned frame, you need to add:


to the [Global] section. Note that, both items (Frame and FrameInactive) must be properly defined, because the message window will always use both, depending on the active state of the window. When FramelessMode is undefined or set to 0, the frame will appear with the operating systems theme.

When using frame skin definitions, you also have to define the title buttons, that is, you have to valid skin definitions for the 3 items starting with Titlebutton.

When using image items for the frame, you really should use the FillColor statement to speed up drawing of the inner part which will always be invisible anyway, because the frame is only a few pixels wide. Adjust the sizing margins of the image items in a way that it will properly stretch on the frame, and then setup the window frame metrics:


Left, Right, Bottom and Caption are the widths (in pixels) for the respective border elements (Caption is title bar height).