Professional Documents
Culture Documents
Pesterchum 3.14 themes are very flexible and allow you to create
almost any kind of main window you can imagine (notable exception
being animation). This document should help you make your own themes
or make adjustments to existing themes!
Try following along with existing themes -- it'll make this document
much less confusing!
CREATING A THEME
----------------
Every theme is just a separate directory in the "themes"
directory. That directory contains all the images used in that theme
as well as a "style.js" file which is the configuration file for the
theme.
FORMAT
------
The theme file is unlike most configuration files. It uses a format
called JSON, which at its core looks like this:
means "color" is "red, and "size" is 50. Note that strings should have
quotes around them and numbers should not. You can also make certain
values into categories by making the value a bracketed list, like so:
This creates two categories: memos and convos, each with their own
color and size value. Also note that spaces don't really matter. It
helps to indent each category:
or even
SETTINGS
--------
INHERITS: You can make writing themes easier on yourself by using the
"inherits" setting. This sets all the settings to be the same as the
inherited theme unless you change it. So you only need to set the
settings you want to change!
When specifying file locations, you use the term "$path" to represent
the path to the current theme. The program will automatically
subtitute the correct location.
PC3.14 uses Qt's Stylesheets. That means that there are several
options in the style file that use CSS-like options. Most CSS options
are actually available in these settings. See this page for details
about Qt's stylesheets:
http://doc.qt.nokia.com/latest/stylesheet.html
http://www.w3schools.com/css/default.asp
NOTE that if you change a style from a theme you inherited, you MUST
put in all the options the old style had if you want to keep them!
border: Sets the border of the item. Should be in the form "Xpx style
color". Example: "border: 2px solid black;" See reference for styles.
font: A shortcut. You can specify most different font properties from
this setting. Read on...
margin: Sets the amount of space between this object and other
objects. This is really only useful in memo and conversation
settings. You can set individual margins for right/left/top/bottom
by margin-top/left/right/bottom. Examples: "margin-top: 15px;" "margin:
5px;"
padding: Same thing as margin, kinda... basically this sets the space
between the outside of the box and the stuff inside it. See
http://doc.qt.nokia.com/latest/stylesheet-customizing.html#the-box-model
for more detail.
--------
"size": [232,280]
Same with coordinates, and with coordinates, they are always the
distance away from the top left corner. So [50, 60] would be 50 pixels
to the right and 60 pixels down.
MAIN
----
"main": { .... }
"style": Sets the style of the main window (as above). This value will
affect other parts of the window. DO NOT put a background image
here. You must set that separately; this is necessary to support
themes that are not square (e.g. gold xl).
"size": The size of the window. Usually this is the same as the size
of your background image.
"icon": The file name of the image you want to appear in the tray and
your taskbar. Example: "icon": "$path/trayicon.png"
"newmsgicon": The file name of the image that will appear in the tray
when you have a new message.
"close": Category:
"image": Location of the image of the "X" button.
"loc": The coordinates of the "X" button.
Example:
"close": {"image": "$path/x.png", "loc": [210,2]}
"menu": Category.
"style": Style of each individual menu.
"menuitem": Affects each menu item on the main menu. Usually used
for spacing.
"selected": Style information for when you hover over a menu option.
"loc": Location of the main menubar.
"sounds": Category.
"alertsound": Path to the alert sound. Should be a wav.
"ceasesound": Path to the sound when people cease pestering.
"menus": Category. This is where you change the text of the menus.
"client": Category. The client menu.
"_name": The text for the client menu header.
(These are self explanatory:)
"options"
"memos"
"userlist"
"import"
"reconnect"
"idle"
"exit"
"profile": Category. Profile menu.
"_name": Text of the profile menu header.
"switch"
"color"
"theme"
"block"
"quirks"
"help": Category. Help menu.
"_name": Text of the help menu header
"about"
"rclickchumlist": Category. Text for right click menus.
"pester"
"removechum"
"blockchum"
"addchum"
"unblockchum"
"banuser"
"opuser"
"quirksoff"
"chums": Category. Creates your chumroll, where all the users are. All
of them.
"defaultwindow": Category.
"style": Style of the default window. (Quirks, profile changer,
etc)
CONVO SECTION
-------------
{"main": { ... },
"convo": { ... }
MEMOS SECTION
------------
{"main": { .... }
"convo": { .... }
"memos": { .... }