# Summary

deKorator is a kwin engine that takes several user-defined images and presents them as a window decoration. deKorator expects to find those in a theme. Here is a guide for building such a theme.

# In the package

deKorator comes with:

- default-theme - Used by default, illustrates some of deKorator's features.
- ugly-theme - It's purpose is to understand the way deKorator paints the decorations.

# Names

deKorator expects the same directory structure and file names as the ones in default-theme. Every theme file should end with "-theme" (as in "default-theme"), and should contain all the folders that are in default-theme (deco, buttons, masks).

# Sizes

deKorator determines the 4 borders' sizes from:

Property | Source
--- | ---
the left border width | midLeftFrameBg's width
the right border width | midRightFrameBg's width
the top bar height | midTitleBg's height
the bottom border height | midBottomFrameBg's height

All parts that build up a specific border should be in the same width or height correspondingly. An example follows for a window decoration with a 10px high top bar, a 20px wide left border, a 30px wide right border and a 40px high bottom border.

All tiles in the top bar should be 10 pixel high:

- topLeftCornerBg
- leftButtonsBg
- leftTitleBg
- midTitleBg
- rightTitleBg
- rightButtonsBg
- topRightCornerBg

All tiles in the left border should be 20 pixel wide:

- topLeftFrameBg
- midLeftFrameBg
- bottomLeftFrameBg

All tiles in the right border should be 30 pixel wide:

- topRightFrameBg
- midRightFrameBg
- bottomRightFrameBg

All tiles in the bottom border should be 40 pixel high:

- leftBottomFrameBg
- midBottomFrameBg
- rightBottomFrameBg

The corner tiles should fit into the tile grid:

Tile | Height | Width
--- | --- | ---
topLeftCornerBg | 10 | 20
topRightCornerBg | 10 | 30
leftBottomFrameBg | 40 | 20
rightBottomFrameBg | 40 | 30

# Buttons

The button images are separated into background and foreground ones.

## Background

The button background uses the leftButtonsBg and the rightButtonsBg tiles. Their height should be the same as the top bar's. The background's repeated horizontally to fit the buttons in.

## Foreground

The width is determined by the button width. This way theme makers can put the buttons as close as they wish. To make space between buttons you can add transparent pixels to the right and left. A button with a smaller height than the top bar's gets centered vertically. To place the button in a custom height use transparent pixels, too.

# Masks

Masks contain only black and white. Black pixels are subtracted from the decoration.

# Image format

All images should be in PNG.