Menubar is always on top line of screen.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2019-08-14 11:37:50 +03:00
parent 9c0c2b77af
commit 2b55c54efc
4 changed files with 6 additions and 5 deletions

View File

@ -935,14 +935,15 @@ destroy_menu (menu_t * menu)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
WMenuBar * WMenuBar *
menubar_new (int y, int x, int cols, GList * menu, gboolean visible) menubar_new (GList * menu, gboolean visible)
{ {
WMenuBar *menubar; WMenuBar *menubar;
Widget *w; Widget *w;
menubar = g_new0 (WMenuBar, 1); menubar = g_new0 (WMenuBar, 1);
w = WIDGET (menubar); w = WIDGET (menubar);
widget_init (w, y, x, 1, cols, menubar_callback, menubar_mouse_callback); widget_init (w, 0, 0, 1, COLS, menubar_callback, menubar_mouse_callback);
w->pos_flags = WPOS_KEEP_HORZ | WPOS_KEEP_TOP;
/* initially, menubar is not selectable */ /* initially, menubar is not selectable */
widget_set_options (w, WOP_SELECTABLE, FALSE); widget_set_options (w, WOP_SELECTABLE, FALSE);
w->options |= WOP_TOP_SELECT; w->options |= WOP_TOP_SELECT;

View File

@ -48,7 +48,7 @@ menu_t *create_menu (const char *name, GList * entries, const char *help_node);
void menu_set_name (menu_t * menu, const char *name); void menu_set_name (menu_t * menu, const char *name);
void destroy_menu (menu_t * menu); void destroy_menu (menu_t * menu);
WMenuBar *menubar_new (int y, int x, int cols, GList * menu, gboolean visible); WMenuBar *menubar_new (GList * menu, gboolean visible);
void menubar_set_menu (WMenuBar * menubar, GList * menu); void menubar_set_menu (WMenuBar * menubar, GList * menu);
void menubar_add_menu (WMenuBar * menubar, menu_t * menu); void menubar_add_menu (WMenuBar * menubar, menu_t * menu);
void menubar_arrange (WMenuBar * menubar); void menubar_arrange (WMenuBar * menubar);

View File

@ -1251,7 +1251,7 @@ edit_files (const GList * files)
edit_dlg->get_shortcut = edit_get_shortcut; edit_dlg->get_shortcut = edit_get_shortcut;
edit_dlg->get_title = edit_get_title; edit_dlg->get_title = edit_get_title;
menubar = menubar_new (0, 0, COLS, NULL, TRUE); menubar = menubar_new (NULL, TRUE);
add_widget (edit_dlg, menubar); add_widget (edit_dlg, menubar);
edit_init_menu (menubar); edit_init_menu (menubar);

View File

@ -922,7 +922,7 @@ create_file_manager (void)
/* allow rebind tab */ /* allow rebind tab */
widget_want_tab (WIDGET (midnight_dlg), TRUE); widget_want_tab (WIDGET (midnight_dlg), TRUE);
the_menubar = menubar_new (0, 0, COLS, NULL, menubar_visible); the_menubar = menubar_new (NULL, menubar_visible);
add_widget (midnight_dlg, the_menubar); add_widget (midnight_dlg, the_menubar);
init_menu (); init_menu ();