ssd: support window icons

The default `titleLayout` is updated to `icon:iconify,max,close` which
replaces the window menu button with the window icon.

When the icon file is not found or could not be loaded, the window menu
icon as before is shown.

The icon theme can be selected with `<theme><icon>`.

This commit adds libsfdo as an optional dependency. `-Dicon=disabled` can
be passsed to `meson setup` command in order to disable window icon, in
which case the window icon is always replaced with a window menu button.
This commit is contained in:
tokyo4j 2024-09-06 17:00:40 +09:00 committed by Hiroaki Yamamoto
parent b9414d8b8d
commit a745f91169
32 changed files with 452 additions and 142 deletions

View file

@ -437,9 +437,13 @@ extending outward from the snapped edge.
*<theme><name>*
The name of the Openbox theme to use. It is not set by default.
*<theme><icon>*
The name of the icon theme to use. It is not set by default.
*<theme><titlebar><layout>*
Selection and order of buttons in a window's titlebar.
The following identifiers can be used, each only once:
- 'icon': window icon
- 'menu': window menu
- 'iconify': iconify
- 'max': maximize toggle
@ -624,6 +628,7 @@ extending outward from the snapped edge.
buttons and the window title are shown.
- Title: The area of the titlebar (including blank space) between
the window buttons, where the window title is displayed.
- Icon: A window icon that, by default, displays a window menu.
- WindowMenu: A button that, by default, displays a window menu.
- Iconify: A button that, by default, iconifies a window.
- Maximize: A button that, by default, toggles maximization of a window.

View file

@ -28,8 +28,9 @@
<!-- <font><theme> can be defined without an attribute to set all places -->
<theme>
<name></name>
<icon></icon>
<titlebar>
<layout>menu:iconify,max,close</layout>
<layout>icon:iconify,max,close</layout>
<showTitle>yes</showTitle>
</titlebar>
<cornerRadius>8</cornerRadius>
@ -457,6 +458,15 @@
</mousebind>
</context>
<context name="Icon">
<mousebind button="Left" action="Click">
<action name="ShowMenu" menu="client-menu" atCursor="no" />
</mousebind>
<mousebind button="Right" action="Click">
<action name="ShowMenu" menu="client-menu" atCursor="no" />
</mousebind>
</context>
<context name="Shade">
<mousebind button="Left" action="Click">
<action name="ToggleShade" />