Commit graph

31 commits

Author SHA1 Message Date
tokyo4j
7651531632 menu: refactor in preparation for richer menu design
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.
2024-11-13 20:08:15 +00:00
Johan Malm
e912964f73 menu: fix UAF in client-list-combined-menu after window destruction
Update client-list-combined-menu when a window is destroyed to avoid
SEGFAULT when selecting an that window entry in it.
2024-10-24 20:52:17 +01:00
Droc
4a1375c701 client send to menu
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
2024-09-19 06:36:27 +01:00
Droc
71b2b5a4bc menu: support client-list-combined-menu
...showing windows across all workspaces.

<action name="ShowMenu" menu="client-list-combined-menu"/>
2024-09-17 22:13:23 +01:00
Johan Malm
9bc381d9e8 menu: use theme->menu_item_height instead of menu->item_height
...and set it in theme.c post_processing()
2024-08-20 18:01:22 +01:00
Johan Malm
0552c6b7f0 menu: support titles
...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
2024-08-20 18:01:22 +01:00
Consolatis
5ae9eed1ac
src/menu: prevent delayed pipe menu response on item destroy (#2094)
Without this patch we would happily access `pipe_ctx->item`
members even if the item had been destroyed in the meantime.
2024-08-20 17:09:17 +01:00
Johan Malm
f3b68b8fb5 menu: support pipe menus
See labwc-menu(5) for usage.

Co-authored-by: @Consolatis
2024-03-24 21:44:16 +00:00
Johan Malm
138979c506 menu: s/menu_open/menu_open_root/
...to be consistent with the 'close' equivalent
2024-03-24 21:44:16 +00:00
Johan Malm
a105c8781a menu: use wl_list instead of array
...to make it easier to split menu.c into smaller chunks without
exposing nr_menus variable.
2023-10-10 06:17:37 +01:00
Johan Malm
db41b5eec0 s/::/./ 2023-10-04 06:06:52 +01:00
Consolatis
1703b4d6cc src/menu/menu.c: support keyboard driven selection
Fixes: #1058
Requested-by: @stefonarch
2023-09-05 19:57:14 +01:00
Tomi Ollila
7ad5200f2e includes: identifier consistency in include guards
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".
2023-05-13 22:29:21 +01:00
Consolatis
d00327bc32 menu: Dynamically adjust menu width based on widest item
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.
2022-12-06 21:08:43 +00:00
Consolatis
ccf68c5950 menu: Add generic menu_init() entry point 2022-12-06 21:08:43 +00:00
Johan Malm
437230b3a0 menu: support <separator />
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.
2022-06-25 14:56:35 +02:00
Consolatis
b25965d03e Convert menu entries to scaled font buffer 2022-06-14 22:03:08 +01:00
Consolatis
5a4c5de332 src/menu: Attach view to menu and use it when executing actions
This fixes #380
2022-06-09 22:09:40 +01:00
Consolatis
65a5315e42 Chase wlroots: prep work: menu to tree 2022-06-07 07:13:37 +01:00
Consolatis
8444ba4075 Convert menu to node_descriptors 2022-03-03 17:49:54 +00:00
Consolatis
f2d40a8d69 Scene Menu 2022-02-23 21:47:01 +00:00
Consolatis
759b26b5c1 Add window menu 2022-01-26 06:17:41 +00:00
Consolatis
0b45cce648 Rewrite action handling to allow multiple actions at once 2022-01-05 16:22:41 +00:00
Johan Malm
cd31283ba3 menu: support inline submenus
...for example:

<menu id="root-menu" label="">
  <menu id="submenu" label="submenu">
    <item label="foo"></item>
  </menu>
  <item label="bar"></item>
</menu>
2021-11-08 17:20:37 +00:00
Johan Malm
b878db57a7 menu: support submenus
Support submenus defined as follows:

<menu id="submenu" label="Submenu">
  <item label="item1.1"></item>
  <item label="item1.2"></item>
</menu>

<menu id="root-menu" label="">
  <menu id="submenu" />
  <item label="item0"></item>
</menu>
2021-11-02 18:31:19 +00:00
Johan Malm
9a9cd609f6 menu: fix breakage caused by f857aea8 2021-08-09 17:28:39 +01:00
Johan Malm
5ecf0e1e7e Make font_texture_create() more generic
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()
2021-08-07 08:35:46 +01:00
Johan Malm
6cdf3d68f3 menu: minor refactoring 2021-02-19 23:31:30 +00:00
Johan Malm
f0d8eb0a60 menu: reload on SIGHUP 2021-02-19 23:05:14 +00:00
Johan Malm
d39b158cec menu: add menu_finish() 2020-10-22 19:43:27 +01:00
Johan Malm
dc5d1ab976 Support a very simple root-menu 2020-10-19 22:14:17 +01:00