Improved window themes with deKorator 0.5

If you love to customize the appearance of your KDE Desktop, then you probably already know deKorator, a pixmap window decoration engine initially written by Moty Rahamim for KDE 3.

When I ported it to KDE 4, I did not try to improve it in any way; my first goal was to have it available at all. The only new feature in deKorator 0.4 was support for transparent themes to make use of the ARGB ability of KWin 4.3.

Today, deKorator version 0.5.1 has been released, and it comes packed with a whole lot of new features and bug fixes. I was too lazy to update the ChangeLog file (you can get the svn log from playground/artwork/dekorator, though), but since the changes need to be documented somewhere for theme writers, I decided to write a small “changeblog”.

Improved theme installation and selection

The most often reported bug required a rewrite of the theme selection dialog.

deKorator new theme selection dialog
The new theme selection dialog shows previews of the themes

When you installed a theme and clicked on it in the list, it was not selected as the current theme, but you had to “apply paths” first. The feature to set individual paths has been removed from the dialog; simply clicking on a theme selects the paths automatically (you can still set them in the config file manually).

Improved detection of theme files

Another problem was that installation of themes often failed because of the strict naming requirements. Now the detection is much better, it even detects old deKorator 0.1 themes, and tries to find decoration archives inside the installed archive. Some themes still do not install correctly because of wired bugs in the theme files. For example, there are themes that have the “deco” and “buttons” directories directly in the root of the archive, without any directory for the theme name …

GetHotNewStuff support

For many themes, installation can now be done directly from the KNewStuff interface to the openDesktop.org site “kde-look.org”, where over 150 deKorator themes can be downloaded.

deKorator KNewStuff download dialog
Download and rate deKorator themes using the GHNS dialog

Thanks to improvements in the coming KDE SC 4.5 release, you will even be able to rate themes or upload your own themes. With that, we come to a feature that will be appreciated by theme creators.

Separate images for inactive windows

User “Shirakawasuna” requested a set of different images for buttons on inactive windows, and later suggested to use Emerald compatible button files. This has now be implemented in deKorator 0.5.1.

deKorator buttons image file from Emerald themes
A single image contains all button states
(the chessboard pattern shows transparency)

Inside the “buttons” directory, there are usually the directories “normal”, “hover”, and “press”, but you can now also place a single file for each button type directly inside the “buttons” directory. The file has to be named “buttons<Type>.png”, where <Type> is “Close”, “Max”, “Min”, “Restore”, etc. as before.

Example-theme/
deco/
leftTitleBg.png
midTitleBg.png

inactive/
leftTitleBg.png
midTitleBg.png
buttons/
buttonsClose.png
buttonsMax.png

normal/
buttonClose.png
buttonMax.png

press/
hover/
masks/
topLeftCornerBitmap.png
topRightCornerBitmap.png

Contents of deKorator theme archive “Example-theme.tar.gz”

This file must have six images in a single row, all equally sized. The order is “normal”, “hover”, “press” for active windows, then “normal”, “hover”, “press” for inactive windows. For compatibility, you should keep the old individual button files until the new version has been adopted by users.

Note: When porting Emerald themes, you have to rename the files, e.g. from “buttons.max.png” to “buttonsMax.png”. You might also need to add some transparent padding to get them aligned correctly within the frame, as deKorator always centers images that are smaller than the frame.

Additionally, you can now also supply separate images for the frame of inactive windows.

Example of separate decoration images
deKorator supports separate decoration images for active and inactive windows

Inside the “deco” directory, you can place a directory named “inactive” with the same file layout. You do not need to add all images; those that are not provided are used from the “deco” directory.

Attention! Use this feature with care!

deKorator has been designed to allow the user to colorize active and inactive window frames by using the respective colors from Systemsettings, so do not provide separate images if you just want different colors. It is intended that this feature is used to make graphics for inactive windows less detailed (for example, by removing stripes or other decorations). Check the “Modern System” or “KDE 2” themes to see what I mean.

I hope that these improvements give theme writers more freedom in their design or porting efforts; I am looking forward to new themes, maybe even some with real alpha transparency.

Bug fixes in deKorator 0.5.1

  • Fix borders on maximized windows (requested by user “Shirakawasuna”)
  • Fix resize region with small borders (thanks to “Shirakawasuna” for reporting the issue, clearly seen on his “Dots” theme)
  • Fix “hand” cursor over buttons (requested by “Shirakawasuna”)
  • Fix possible crash with NoBorder option (reported by “Ace2016”, thanks!)
  • Fix large images being cropped instead of scaled (reported/requested by “Shirakawasuna”, clearly seen on his Reluna-Bluetiful port)
  • Fix stuck windows when shading windows with masks (this was first reported by “Thailandian”, and later “greggel” found out how to trigger it. Thanks to both!)
  • Fix spelling mistake for masks (found by “Shirakawasuna”)
  • Fix wrong button image “StickyDownPress” used instead of “StickyPress” (thanks to user “greggel” for reporting)
  • Fix partial transparency on button backgrounds (that bug was unnoticed, because there are no partially transparent themes yet)

If you find anything else that needs to be improved, please use the bugs.kde.org bugtracker.

ARGB Window Themes in deKorator

The KWin team works hard to add support for ARGB window decorations to KDE 4. While it is not yet clear if the feature will make it into KDE 4.3 as planned, deKorator in trunk is now prepared to support these.

ARGB means RGB with alpha transparency. This color model makes it possible to have smooth rounding at the edges, while also allowing for different transparency levels in different parts of the decorations. For example, you could have the background of the window title be transparent, while the text and the buttons are opaque.

Only two lines needed to be added to deKorator to support ARGB. It had already been possible to use transparent PNG files, but the background was always filled with the Window color, instead of leaving it transparent. In a future version of deKorator the amount of transparency will be configurable to support the old method.

If you want to try ARGB decorations, you need:

  • a recent KWin from trunk/KDE/workspace/kwin (r957718 or newer)
  • a recent deKorator from trunk/playground/artwork/deKorator (r961812 or newer)
  • a deKorator theme that has (partially) transparent PNG files

Of course the choice of themes that have transparent PNG files is rare (1, 2), so you are invited to create your own theme, and make it available on kde-look.org.

KCalc with transparent window decoration

Theme previews in deKorator

After porting deKorator to KDE 4 I thought that it could need some improvements. There are currently two issues that I (any many other users) find irritating.

The first issue is theme selection. After you selected a theme from the list, you need to click “Apply Theme Paths” to apply the paths to the Paths tab page. This seems intuitive in the light that the engine only sees these paths, but I guess most users do not want to create a theme, but just select it from the list.

The other issue is colorization. There are many check boxes and options that affect colors of the theme and buttons, and one can only guess how they all play together.

Well, none of the above issues are addressed yet, but I started hacking on a new theme selector, which has in-list previews and offers a “Get New Themes…” download button to invoke the standard GHNS dialog.

You can find deKorator in KDE svn trunk, path is playground/artwork/dekorator.

deKorator themes