mirror of
https://github.com/labwc/labwc.git
synced 2026-02-10 04:27:47 -05:00
menu: dynamically generate top-level pipemenus
This eliminates code duplications and aligns the behavior of top-level pipemenus with sub-pipemenus.
This commit is contained in:
parent
40dfee7bd5
commit
54186e5152
2 changed files with 75 additions and 162 deletions
|
|
@ -20,8 +20,6 @@ enum menuitem_type {
|
|||
|
||||
struct menuitem {
|
||||
struct wl_list actions;
|
||||
char *execute;
|
||||
char *id; /* needed for pipemenus */
|
||||
char *text;
|
||||
char *icon_name;
|
||||
const char *arrow;
|
||||
|
|
@ -33,7 +31,6 @@ struct menuitem {
|
|||
struct wlr_scene_tree *tree;
|
||||
struct wlr_scene_tree *normal_tree;
|
||||
struct wlr_scene_tree *selected_tree;
|
||||
struct menu_pipe_context *pipe_ctx;
|
||||
struct view *client_list_view; /* used by internal client-list */
|
||||
struct wl_list link; /* menu.menuitems */
|
||||
};
|
||||
|
|
@ -43,6 +40,7 @@ struct menu {
|
|||
char *id;
|
||||
char *label;
|
||||
char *icon_name;
|
||||
char *execute;
|
||||
struct menu *parent;
|
||||
struct menu_pipe_context *pipe_ctx;
|
||||
|
||||
|
|
@ -57,7 +55,7 @@ struct menu {
|
|||
struct menuitem *item;
|
||||
} selection;
|
||||
struct wlr_scene_tree *scene_tree;
|
||||
bool is_pipemenu;
|
||||
bool is_pipemenu_child;
|
||||
bool align_left;
|
||||
bool has_icons;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue