mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 12:56:51 +03:00
Merge branch '3775_hostlist_refresh'
* 3775_hostlist_refresh: Pressing <right> and <left> in hotlist dialog doesn't refresh it.
This commit is contained in:
commit
fc6e3832a6
@ -471,6 +471,9 @@ widget_replace (Widget * old_w, Widget * new_w)
|
|||||||
/**
|
/**
|
||||||
* Select specified widget in it's owner.
|
* Select specified widget in it's owner.
|
||||||
*
|
*
|
||||||
|
* Note: this function (and widget_focus(), which it calls) is a no-op
|
||||||
|
* if the widget is already selected.
|
||||||
|
*
|
||||||
* @param w widget to be selected
|
* @param w widget to be selected
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -581,8 +581,34 @@ hotlist_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void
|
|||||||
return hotlist_handle_key (h, parm);
|
return hotlist_handle_key (h, parm);
|
||||||
|
|
||||||
case MSG_POST_KEY:
|
case MSG_POST_KEY:
|
||||||
/* always stay on hotlist */
|
/*
|
||||||
widget_select (h == hotlist_dlg ? WIDGET (l_hotlist) : WIDGET (l_movelist));
|
* The code here has two purposes:
|
||||||
|
*
|
||||||
|
* (1) Always stay on the hotlist.
|
||||||
|
*
|
||||||
|
* Activating a button using its hotkey (and even pressing ENTER, as
|
||||||
|
* there's a "default button") moves the focus to the button. But we
|
||||||
|
* want to stay on the hotlist, to be able to use the usual keys (up,
|
||||||
|
* down, etc.). So we do `widget_select (lst)`.
|
||||||
|
*
|
||||||
|
* (2) Refresh the hotlist.
|
||||||
|
*
|
||||||
|
* We may have run a command that changed the contents of the list.
|
||||||
|
* We therefore need to refresh it. So we do `widget_redraw (lst)`.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
Widget *lst;
|
||||||
|
|
||||||
|
lst = WIDGET (h == hotlist_dlg ? l_hotlist : l_movelist);
|
||||||
|
|
||||||
|
/* widget_select() already redraws the widget, but since it's a
|
||||||
|
* no-op if the widget is already selected ("focused"), we have
|
||||||
|
* to call widget_redraw() separately. */
|
||||||
|
if (!widget_get_state (lst, WST_FOCUSED))
|
||||||
|
widget_select (lst);
|
||||||
|
else
|
||||||
|
widget_redraw (lst);
|
||||||
|
}
|
||||||
return MSG_HANDLED;
|
return MSG_HANDLED;
|
||||||
|
|
||||||
case MSG_RESIZE:
|
case MSG_RESIZE:
|
||||||
|
Loading…
Reference in New Issue
Block a user