1
by Thomas Moenicke
initial commit |
1 |
Overview
|
2 |
========
|
|
3 |
||
4 |
Maliit Keyboard supports styling (also known as theming) via "styling |
|
5 |
profiles". A styling profile is a self-contained directory with graphical |
|
6 |
assets, fonts, sounds etc. Users can choose the styling profile through the |
|
7 |
current_style setting, for instance (requires running maliit-server): |
|
8 |
||
9 |
$ maliit-exampleapp-settings-python3.py \ |
|
10 |
$ set libmaliit-keyboard-plugin.so current_style gnome3 |
|
11 |
||
12 |
The styling profiles are found in "data/styles". For an example style named |
|
13 |
"my-style", the directory structure would be: |
|
14 |
||
15 |
..+- data/
|
|
16 |
+- styles/
|
|
17 |
+- my-style/
|
|
18 |
| +- images/
|
|
19 |
| +- sounds/
|
|
20 |
| +- fonts/
|
|
21 |
| +- main.ini
|
|
22 |
| +- extended-keys.ini
|
|
23 |
||
24 |
The directories "images", "sounds" and "fonts" are used for binary data. The |
|
25 |
files "main.ini" and "extended-keys.ini" define the styling attributes (one for |
|
26 |
the regular qwerty area, one for the extended keys that pop up on long-press), |
|
27 |
such as key size, background graphics etc. Changes will only become visible |
|
28 |
upon maliit-server restart. |
|
29 |
||
30 |
||
31 |
INI files for styling
|
|
32 |
=====================
|
|
33 |
||
34 |
Styling attributes are simple key-value pairs, organized by section. The INI |
|
35 |
file format offers a perfect match and is simple to read/edit manually. |
|
36 |
||
37 |
The sections in [main|extended-keys].ini are: |
|
38 |
||
39 |
[background] - Describes background graphics for different keyboard elements. |
|
40 |
Keys ending with "-borders" allow for 9-tiling of graphics. The value consists |
|
41 |
of 4 integers (left, top, right, bottom), separated by spaces. Example: |
|
42 |
word-ribbon-borders=0 0 0 0 |
|
43 |
word-ribbon=background.png |
|
44 |
||
45 |
[icon] - Maps icon names found in layout files to graphics assets. Example: |
|
46 |
shift=shift-icon.png |
|
47 |
||
48 |
[sound] - Maps events that support sound to sound files, such as key presses. |
|
49 |
Example: |
|
50 |
key-press=typewriter.wav |
|
51 |
||
52 |
[default] - Contains default values for a layout file, such as key size and key |
|
53 |
area width, for both landscape and portrait mode orientation. Example: |
|
54 |
landscape\key-area-width=854 |
|
55 |
portrait\key-area-width=480 |
|
56 |
||
57 |
[keys35] - Layout files can specify a style name for each section. If no style |
|
58 |
name is given, it's computed by the amount of keys found in the section. So a |
|
59 |
layout file section with 35 keys gets the auto-computed styling id of "keys35". |
|
60 |
In the INI files, this can be used to define a section of the same name which |
|
61 |
contains override values for the values of the "default" section. Whenever the |
|
62 |
layout file section with this id is used (= actively displayed on screen), the |
|
63 |
override values take precedence over the default values. Example: |
|
64 |
landscape/key-width-xlarge=118 |
|
65 |
portrait/key-width-xlarge=64 |
|
66 |
||
67 |
See data/styles/nokia-n9/main.ini for a complete example and all possible |
|
68 |
key-value pairs. |