This removes the need to call update_client_list_combined_menu()
and update_client_send_to_menu() every time a root menu is opened.
This commit also fixed the incorrect menu position with following
configuration:
<menu id="foo" label="foo">
<item label="aaaaaa"/>
<item label="bbbbbb"/>
</menu>
<menu id="root-menu">
<menu id="foo" />
<menu id="foo" />
</menu>
This commit delegates the calculation for menu position into wlroots
utilities for xdg_positioner.
Notable functional changes are:
- Slide the menu to fit in the output when it's opened out of the output
(e.g. top-left window menu is opened when the window is overflowing to
the left), rather than not updating the menu at all.
- The horizontal alignment of menus is now determined based on the size of
each (sub)menu alone rather than the total width of entire menu tree.
This means submenus can now overlap with is parents, but this is no
longer a problem since we recently added support for menu borders.
- Fixed that pipemenus always follow the alignment of its parent even when
it overflows from the output.
- Don't store font/background buffers in menuitem struct since we no
longer dynamically update buffers of existing menuitems.
- Factor out the duplicated codes for creating menu item scenes for each
unselected/selected states.
This commit separates the process of creating scene-trees of the menu
items into `{item,separator,title}_create_scene()`. This will make it
easier to draw richer menu designs like borders, paddings and rounded
corners.
Shows all workspaces that current view can be sent to.
Works best when added to Client menu.
<menu id="client-send-to-menu" label="Send to..." />
Menu uses ">" and "<" to highlight the current workspace
...defined by `<separator label="">`.
Also add the theme option `menu.title.bg.color: #589bda`
The following will be added in separate commits
- menu.title.bg.border.color: #7cb6ec
- menu.title.text.color: #ffffff
- menu.title.text.justify: center
Made all header files to have LABWC_ prefix in include guard identifers.
Converted from __LABWC_ in 35 include/ files.
Converted from __LAB_ in 5 include/ files.
Added LABWC prefix to 3 include/ files.
Added include guards to 3 include/ files.
The double underscores were removed since according to C standard
those "are always reserved for any use".
Adds two new theme vars:
- menu.width.min (menu will never be smaller than this)
- menu.width.max (menu will never be wider than this + padding)
A fixed menu width can be achieved by setting
menu.width.min == menu.width.max.
Add theme options:
- menu.separator.width
- menu.separator.padding.width
- menu.separator.padding.height
- menu.separator.color
Support separator lines defined by <separator />
Note that separator labels (with text) defined by <separator label="" />
are not supported.
Move font_texture_create() to font.c so it can be used for purposes other
than rendering the menu, for example server side decoration.
Refactor menu.c and menu.h to use this more generic font_texture_create()