I'm trying to track down the specification of Unity window button themes.
By this I mean the specification specific to Unity, (/usr/share/themes/Radiance/unity
), not the gtk or metacity specifications (/usr/share/themes/Radiance/metacity-1
or /usr/share/themes/Radiance/gtk-x.0
).
The only themes I've found that appear to use this specification are the Radiance and Ambiance ones (in package light-themes
).
Upon looking in /usr/share/themes/(Ambiance|Radiance)/unity
, I see the images:
- role.png
- role_focusstate_state.png
where
role
is one ofclose
,maximize
,minimize
orunmaximize
;focusstate
isfocused
orunfocused
;state
isnormal
,prelight
orpressed
.
Is there some specification on how to create a unity window theme? Which of the above files is required at minimum? when each is used?
(For example, is the close.png
ever used if close_[focusstate]_[state].png
exists for all focus states and states already? If so, when? If not, why is close.png
included with Ambiance/Radiance, which appear to cover all focus states and all states already?)
I've done a bit more digging, and I suspect that:
metacity-1
subfolder) for all window decorations;unity
subfolder to draw window buttons in the top unity panel only (when a window is maximized and the titlebar has been hidden (?))(I don't currently have Unity available to me to test).
The relevant bug: https://bugs.launchpad.net/unity/+bug/740232
In particular, comment 22:
The relevant code (3/Jun/2013): http://bazaar.launchpad.net/~unity-team/unity/trunk/view/3355/unity-shared/PanelStyle.cpp#L197
I do not believe there is any documentation.
However, reading the relevant code (above) it seems like
CLOSE
,MINIMIZE
,UNMAXIMIZE
,MAXIMIZE
NORMAL
,PRELIGHT
,PRESSED
,DISABLED
,UNFOCUSED
,UNFOCUSED_PRELIGHT
,UNFOCUSED_PRESSED
These seem much the same as metacity.
To find the image corresponding to the button with type
type
and statestate
, we look upunity/<type_><state_>.png
, where:type_
is:CLOSE
;MINIMIZE
;MAXIMIZE
;UNMAXIMIZE
.state_
is:NORMAL
(a button on the active window);PRELIGHT
(a button on the active window that is being hovered over);PRESSED
(a button on the active window that is being pressed);DISABLED
; (??)UNFOCUSED
(a button on an unfocused window);UNFOCUSED_PRELIGHT
(a button on an unfocused window that is being hovered over);UNFOCUSED_PRESSED
(a button on an unfocused window that is being pressed).Hence note that of the images in the
unity
subfolder of (say) Ambiance,<role>_focused_normal.png
is not used, even though it's provided in the package (??).If the image for a particular (type, state) is not found, it looks like some sort of default button is drawn (rather than using one of the existing images).