diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c index 993428fb2..67ad4cb00 100644 --- a/lib/widget/dialog.c +++ b/lib/widget/dialog.c @@ -510,7 +510,7 @@ dlg_key_event (WDialog * h, int d_key) h->current = h->widgets; /* TAB used to cycle */ - if ((h->flags & DLG_WANT_TAB) == 0) + if (!widget_get_options (WIDGET (h), WOP_WANT_TAB)) { if (d_key == '\t') { diff --git a/lib/widget/dialog.h b/lib/widget/dialog.h index 27778e156..2533718b0 100644 --- a/lib/widget/dialog.h +++ b/lib/widget/dialog.h @@ -35,8 +35,7 @@ typedef enum DLG_NONE = 0, /* No options */ DLG_CENTER = (1 << 0), /* Center the dialog */ DLG_TRYUP = (1 << 1), /* Try to move two lines up the dialog */ - DLG_COMPACT = (1 << 2), /* Suppress spaces around the frame */ - DLG_WANT_TAB = (1 << 3) /* Should the tab key be sent to the dialog? */ + DLG_COMPACT = (1 << 2) /* Suppress spaces around the frame */ } dlg_flags_t; /* Dialog color constants */ diff --git a/lib/widget/widget-common.h b/lib/widget/widget-common.h index 1bc3fdb34..7365c7d1d 100644 --- a/lib/widget/widget-common.h +++ b/lib/widget/widget-common.h @@ -18,6 +18,7 @@ /* Sets/clear the specified flag in the options field */ #define widget_want_cursor(w,i) widget_set_options(w, WOP_WANT_CURSOR, i) #define widget_want_hotkey(w,i) widget_set_options(w, WOP_WANT_HOTKEY, i) +#define widget_want_tab(w,i) widget_set_options(w, WOP_WANT_TAB, i) #define widget_idle(w,i) widget_set_state(w, WST_IDLE, i) #define widget_disable(w,i) widget_set_state(w, WST_DISABLED, i) @@ -67,8 +68,9 @@ typedef enum WOP_DEFAULT = (0 << 0), WOP_WANT_HOTKEY = (1 << 1), WOP_WANT_CURSOR = (1 << 2), - WOP_IS_INPUT = (1 << 3), - WOP_TOP_SELECT = (1 << 4) + WOP_WANT_TAB = (1 << 3), /* Should the tab key be sent to the dialog? */ + WOP_IS_INPUT = (1 << 4), + WOP_TOP_SELECT = (1 << 5) } widget_options_t; /* Widget state */ diff --git a/src/diffviewer/ydiff.c b/src/diffviewer/ydiff.c index b30f0cd90..85d2915f0 100644 --- a/src/diffviewer/ydiff.c +++ b/src/diffviewer/ydiff.c @@ -3461,7 +3461,8 @@ diff_view (const char *file1, const char *file2, const char *label1, const char /* Create dialog and widgets, put them on the dialog */ dview_dlg = dlg_create (FALSE, 0, 0, LINES, COLS, NULL, dview_dialog_callback, NULL, - "[Diff Viewer]", NULL, DLG_WANT_TAB); + "[Diff Viewer]", NULL, DLG_NONE); + widget_want_tab (WIDGET (dview_dlg), TRUE); dview = g_new0 (WDiff, 1); w = WIDGET (dview); diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c index 1e8145732..306cf9947 100644 --- a/src/editor/editcmd_dialogs.c +++ b/src/editor/editcmd_dialogs.c @@ -321,7 +321,8 @@ editcmd_dialog_raw_key_query (const char *heading, const char *query, gboolean c raw_dlg = dlg_create (TRUE, 0, 0, cancel ? 7 : 5, w, dialog_colors, editcmd_dialog_raw_key_query_cb, - NULL, NULL, heading, DLG_CENTER | DLG_TRYUP | DLG_WANT_TAB); + NULL, NULL, heading, DLG_CENTER | DLG_TRYUP); + widget_want_tab (WIDGET (raw_dlg), TRUE); add_widget (raw_dlg, label_new (y, 3, query)); add_widget (raw_dlg, input_new (y++, 3 + wq + 1, input_colors, diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c index a86e9a318..9e99d9f08 100644 --- a/src/editor/editwidget.c +++ b/src/editor/editwidget.c @@ -1224,7 +1224,8 @@ edit_files (const GList * files) /* Create a new dialog and add it widgets to it */ edit_dlg = dlg_create (FALSE, 0, 0, LINES, COLS, NULL, edit_dialog_callback, - edit_dialog_mouse_callback, "[Internal File Editor]", NULL, DLG_WANT_TAB); + edit_dialog_mouse_callback, "[Internal File Editor]", NULL, DLG_NONE); + widget_want_tab (WIDGET (edit_dlg), TRUE); edit_dlg->get_shortcut = edit_get_shortcut; edit_dlg->get_title = edit_get_title; diff --git a/src/help.c b/src/help.c index b7adbc3ab..fe9502d8c 100644 --- a/src/help.c +++ b/src/help.c @@ -1097,9 +1097,9 @@ help_interactive_display (const gchar * event_group_name, const gchar * event_na help_lines = MIN (LINES - 4, MAX (2 * LINES / 3, 18)); whelp = - dlg_create (TRUE, 0, 0, help_lines + 4, HELP_WINDOW_WIDTH + 4, - help_colors, help_callback, NULL, "[Help]", _("Help"), - DLG_TRYUP | DLG_CENTER | DLG_WANT_TAB); + dlg_create (TRUE, 0, 0, help_lines + 4, HELP_WINDOW_WIDTH + 4, help_colors, + help_callback, NULL, "[Help]", _("Help"), DLG_TRYUP | DLG_CENTER); + widget_want_tab (WIDGET (whelp), TRUE); selected_item = search_string_node (main_node, STRING_LINK_START) - 1; currentpoint = main_node + 1; /* Skip the newline following the start of the node */ diff --git a/src/viewer/mcviewer.c b/src/viewer/mcviewer.c index 80833edef..57abbccb8 100644 --- a/src/viewer/mcviewer.c +++ b/src/viewer/mcviewer.c @@ -233,7 +233,8 @@ mcview_viewer (const char *command, const vfs_path_t * file_vpath, int start_lin /* Create dialog and widgets, put them on the dialog */ view_dlg = dlg_create (FALSE, 0, 0, LINES, COLS, NULL, mcview_dialog_callback, NULL, - "[Internal File Viewer]", NULL, DLG_WANT_TAB); + "[Internal File Viewer]", NULL, DLG_NONE); + widget_want_tab (WIDGET (view_dlg), TRUE); lc_mcview = mcview_new (0, 0, LINES - 1, COLS, FALSE); add_widget (view_dlg, lc_mcview);