* 2919_widget_focus_refactoring:
Reimplement widget focus/selection.
(dlg_set_bottom_widget): rename to widget_set_bottom.
(dlg_select_widget): rename to widget_select.
Rename WDialog APIs:
Refactoring of change of current widget.
WMenuBar: remove WMenuBar::is_active. Use WST_FOCUSED instead.
WInput: avoid double draw on resize.
Menu: avoid double draw on resize.
(widget_set_size): send MSG_DRAW after MSG_RESIZE.
Refactoring of widget drawing to avoid multiple widget redraw.
WView: remove WView::active. Use WST_FOCUSED instead.
WTree: remove WTree:active. Use WST_FOCUSED instead.
WButton: remove WButton::selected. Use WST_FOCUSED instead.
WListbox: remove WListbox::focused. Use WST_FOCUSED instead.
WST_FOCUSED: add new state and handle it.
(menubar_callback): refactoring of menu draw after get focus and resize.
(widget_set_state): return cb_ret_t instead of gboolean.
Don't focus widget that doesn't have the WOP_SELECTABLE option.
Use WOP_SELECTABLE option in menu.
Ticket #2919: refactoring of focus/unfocus of widgets.
Add new WDialog APIs:
* dlg_set_current_widget_next
* dlg_set_current_widget_prev
* dlg_get_widget_next_of
* dlg_get_widget_prev_of
and use them:
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Send MSG_DRAW message immediately after MSG_FOCUS/MSG_UNFOCUS.
Thus, the MSG_DRAW message handler is the only place where widget
should be drawn. Widget should not draw itself in other message
handlers.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If menu is not active, it is not selectable also in order to disallow
select and focus the inactive menu.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Based on existing cxx.syntax file with some extra keywords added.
Colors could be tweaked a bit still, and perhaps list of keywords
and built-in types could be extended further, but it should be a
good starting point already.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* 3641_cleanup:
lib/mcconfig/paths.c: reduce scope of 'homedir' var.
lib/mcconfig/paths.c: cleanup.
doc/man/mc.1.in: fix substitution markers.
src/vfs/fish/fish.c: apply coding guidelines.
More use link_isdir().
Get rid of #define const_cast().
Fix typos.
Define NCURSES_CONST if curses library doesn't define it.
(ftpfs_open_data_connection): fix enable/disable interrupt key.
(ftpfs_open_data_connection): fix socket leak in case of unsuccessful ftp connection.
(dlg_adjust_position): refactoring.
Ticket #3641: code cleanup before 4.8.18 release.
To ensure that nobody uses the 'homedir' variable in the future without
initializing it first, we make it private to the function, thereby effectively
removing it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
We can conclude, by reading their GLib source[1], by their documentation,
and by looking at how popular programs use them[2], that the functions
g_get_user_{config,cache,data}_dir() don't return a NULL or empty string.
So the handling of this case can go.
[1] https://git.gnome.org/browse/glib/tree/glib/gutils.c
[2] E.g., google "g_get_user_data_dir".
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This is an initial support of GLSL syntax highlight for mcedit.
Keyword and and built-in function lists are based on glsl-mode.el
from emacs (which is originally written by Xavier Decoret and
Jim Hourihan).
Supports GLSL 4.5.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
...after changing VFS in the passive one.
Steps to reproduce:
1. Make left panel active.
2. Press F9 to open menu, select 'Right', then 'FTP link...'
3. Insert a valid FTP URL and press OK (or Enter). Wait for finish of FTP
directory reading.
4. Left panel is still active. Try to change CWD here by pressing Enter
or using command line.
Result: error messages 'ftpfs: CWD failed' and 'Cannot change directory'
or 'Cannot chdir to...'.
The problem: when VFS is changed in the passive panel, VFS CWD is
changed accordingly. Then active panel tries use the new VFS CWD.
The solution: restore VFS CWD after changing VFS in the passive panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>