Merge branch '1771_menu_hide_cursor'
* 1771_menu_hide_cursor: Code cleanup for compile with -Werror option don't show cursor in listboxes. Ticket #1771: don't show cursor in menu.
Этот коммит содержится в:
Коммит
6117c5b4ca
14
src/layout.c
14
src/layout.c
@ -185,7 +185,7 @@ static struct
|
||||
/* *INDENT-ON* */
|
||||
};
|
||||
|
||||
#define LAYOUT_OPTIONS_COUNT sizeof (check_options) / sizeof (check_options[0])
|
||||
#define LAYOUT_OPTIONS_COUNT (sizeof (check_options) / sizeof (check_options[0]))
|
||||
#define OTHER_OPTIONS_COUNT (LAYOUT_OPTIONS_COUNT - 1)
|
||||
|
||||
static gsize first_width;
|
||||
@ -385,7 +385,7 @@ init_layout (void)
|
||||
{
|
||||
static int i18n_layt_flag = 0;
|
||||
static int b1, b2, b3;
|
||||
int i = sizeof (s_split_direction) / sizeof (char *);
|
||||
size_t i = sizeof (s_split_direction) / sizeof (char *);
|
||||
const char *ok_button = _("&OK");
|
||||
const char *cancel_button = _("&Cancel");
|
||||
const char *save_button = _("&Save");
|
||||
@ -410,7 +410,7 @@ init_layout (void)
|
||||
first_width = l1;
|
||||
}
|
||||
|
||||
for (i = 0; i < LAYOUT_OPTIONS_COUNT; i++)
|
||||
for (i = 0; i < (size_t) LAYOUT_OPTIONS_COUNT; i++)
|
||||
{
|
||||
check_options[i].text = _(check_options[i].text);
|
||||
l1 = str_term_width1 (check_options[i].text) + 7;
|
||||
@ -469,7 +469,7 @@ init_layout (void)
|
||||
add_widget (layout_dlg, button_new (11, b1, B_ENTER, DEFPUSH_BUTTON, ok_button, 0));
|
||||
#define XTRACT(i) *check_options[i].variable, check_options[i].text
|
||||
|
||||
for (i = 0; i < OTHER_OPTIONS_COUNT; i++)
|
||||
for (i = 0; i < (size_t) OTHER_OPTIONS_COUNT; i++)
|
||||
{
|
||||
check_options[i].widget =
|
||||
check_new (OTHER_OPTIONS_COUNT - i + 2, 7 + first_width, XTRACT (i));
|
||||
@ -531,7 +531,7 @@ void
|
||||
layout_box (void)
|
||||
{
|
||||
int result;
|
||||
int i;
|
||||
size_t i;
|
||||
int layout_do_change = 0;
|
||||
|
||||
init_layout ();
|
||||
@ -540,8 +540,8 @@ layout_box (void)
|
||||
|
||||
if (result == B_ENTER || result == B_EXIT)
|
||||
{
|
||||
for (i = 0; i < LAYOUT_OPTIONS_COUNT; i++)
|
||||
if (check_options[i].widget)
|
||||
for (i = 0; i < (size_t) LAYOUT_OPTIONS_COUNT; i++)
|
||||
if (check_options[i].widget != NULL)
|
||||
*check_options[i].variable = check_options[i].widget->state & C_BOOL;
|
||||
horizontal_split = radio_widget->sel;
|
||||
first_panel_size = _first_panel_size;
|
||||
|
16
src/menu.c
16
src/menu.c
@ -205,13 +205,9 @@ menubar_draw_drop (WMenuBar * menubar)
|
||||
menubar->widget.y + 1, menubar->widget.x + column,
|
||||
count + 2, menu->max_entry_len + 5, FALSE);
|
||||
|
||||
/* draw items except selected */
|
||||
for (i = 0; i < count; i++)
|
||||
if (i != menu->selected)
|
||||
menubar_paint_idx (menubar, i, MENU_ENTRY_COLOR);
|
||||
|
||||
/* draw selected item at last to move cursor to the nice location */
|
||||
menubar_paint_idx (menubar, menu->selected, MENU_SELECTED_COLOR);
|
||||
menubar_paint_idx (menubar, i,
|
||||
i == menu->selected ? MENU_SELECTED_COLOR : MENU_ENTRY_COLOR);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -546,8 +542,6 @@ menubar_callback (Widget * w, widget_msg_t msg, int parm)
|
||||
if (!menubar->is_active)
|
||||
return MSG_NOT_HANDLED;
|
||||
|
||||
widget_want_cursor (menubar->widget, 1);
|
||||
|
||||
/* Trick to get all the mouse events */
|
||||
menubar->widget.lines = LINES;
|
||||
|
||||
@ -571,11 +565,7 @@ menubar_callback (Widget * w, widget_msg_t msg, int parm)
|
||||
return MSG_NOT_HANDLED;
|
||||
|
||||
case WIDGET_UNFOCUS:
|
||||
if (menubar->is_active)
|
||||
return MSG_NOT_HANDLED;
|
||||
|
||||
widget_want_cursor (menubar->widget, 0);
|
||||
return MSG_HANDLED;
|
||||
return menubar->is_active ? MSG_NOT_HANDLED : MSG_HANDLED;
|
||||
|
||||
case WIDGET_DRAW:
|
||||
if (menubar_visible)
|
||||
|
@ -141,7 +141,7 @@ configure_box (void)
|
||||
{
|
||||
/* radio button */
|
||||
size_t j;
|
||||
for (j = 0; j < pause_options_num; j++)
|
||||
for (j = 0; j < (size_t) pause_options_num; j++)
|
||||
pause_options[j] = _(pause_options[j]);
|
||||
}
|
||||
else if (i == 17)
|
||||
@ -170,7 +170,7 @@ configure_box (void)
|
||||
if ((i < 13) || (i == 18) || (i > 19))
|
||||
c_len = max (c_len, str_term_width1 (quick_widgets[i].u.checkbox.text) + 3);
|
||||
/* radiobuttons */
|
||||
for (i = 0; i < pause_options_num; i++)
|
||||
for (i = 0; i < (size_t) pause_options_num; i++)
|
||||
c_len = max (c_len, str_term_width1 (pause_options[i]) + 3);
|
||||
/* label + input */
|
||||
l_len = str_term_width1 (quick_widgets[17].u.label.text);
|
||||
@ -210,7 +210,7 @@ configure_box (void)
|
||||
quick_widgets[1].relative_x = quick_widgets[2].relative_x + b2_len + 1;
|
||||
quick_widgets[0].relative_x = quick_widgets[1].relative_x + b1_len + 1;
|
||||
|
||||
g_snprintf (time_out, sizeof (time_out), "%ld", old_esc_mode_timeout);
|
||||
g_snprintf (time_out, sizeof (time_out), "%d", old_esc_mode_timeout);
|
||||
|
||||
qd_result = quick_dialog (&Quick_input);
|
||||
|
||||
|
@ -119,7 +119,7 @@ mcview_move_up (mcview_t * view, off_t lines)
|
||||
{
|
||||
size_t last_row_length = (view->dpy_start - new_offset) % view->data_area.width;
|
||||
if (last_row_length != 0 && cur_bol == view->dpy_start)
|
||||
new_offset = max (new_offset, view->dpy_start - last_row_length);
|
||||
new_offset = max (new_offset, (off_t) (view->dpy_start - last_row_length));
|
||||
else
|
||||
new_offset = max (new_offset, view->dpy_start - view->data_area.width);
|
||||
}
|
||||
|
@ -2738,6 +2738,7 @@ listbox_new (int y, int x, int height, int width, gboolean deletable, lcback cal
|
||||
l->allow_duplicates = TRUE;
|
||||
l->scrollbar = !tty_is_slow ();
|
||||
widget_want_hotkey (l->widget, 1);
|
||||
widget_want_cursor (l->widget, 0);
|
||||
|
||||
return l;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user