mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
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>
This commit is contained in:
parent
ddf6555557
commit
b878db57a7
4 changed files with 260 additions and 116 deletions
|
|
@ -1,3 +1,4 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef __LABWC_MENU_H
|
||||
#define __LABWC_MENU_H
|
||||
|
||||
|
|
@ -7,6 +8,7 @@
|
|||
struct menuitem {
|
||||
char *action;
|
||||
char *command;
|
||||
struct menu *submenu;
|
||||
struct wlr_box box;
|
||||
struct {
|
||||
struct wlr_texture *active;
|
||||
|
|
@ -18,14 +20,18 @@ struct menuitem {
|
|||
struct wl_list link; /* menu::menuitems */
|
||||
};
|
||||
|
||||
/* This could be the root-menu or a submenu */
|
||||
struct menu {
|
||||
struct server *server;
|
||||
char *id;
|
||||
char *label;
|
||||
bool visible;
|
||||
struct wlr_box box;
|
||||
struct wl_list menuitems;
|
||||
struct server *server;
|
||||
};
|
||||
|
||||
void menu_init_rootmenu(struct server *server, struct menu *menu);
|
||||
void menu_finish(struct menu *menu);
|
||||
void menu_init_rootmenu(struct server *server);
|
||||
void menu_finish(void);
|
||||
|
||||
/* menu_move - move to position (x, y) */
|
||||
void menu_move(struct menu *menu, int x, int y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue