forked from GiuseppeCigala/antico
-
Notifications
You must be signed in to change notification settings - Fork 4
Creating decorations
gustavosbarreto edited this page Sep 14, 2010
·
19 revisions
The window decoration styles are made with Qt Style Sheets. You only need to read the Qt Style Sheets document and follow certain naming rules to create a new style.
The directory which contains the source code of the style must contain three required files:
- info.ini – Contains information about the style (name, author)
- style.qss – Contains a textual description of customizations to the decoration’s style
- resources.qrc – The Resource collection files (the resource prefix must be “/styles/stylename”)
Some objects can be decorated with the “id selector”.
- Frame – Decoration frame
- TitleBar – Title bar of the decoration
- ButtonContainer – Container of the buttons
- CloseButton – Cose button
- MinimizeButton – Minimize button
- MaximizeButton – Maximize button
To decorate the frame according to the state of decoration (active, inactive) the “property selector” can be used (use the “active” property to this).
First, you need to compile the style using the Qt resource compiler:
rcc -binary -o mystyle.rcc resources.qrc
Now you have the compiled style ready to distribute (mystyle.rcc)
This example is based on metacity theme “Ambiance”. Preview:
You can see the files here or download them.