Apply 0-based y coordinates to be consistent with the MSG_MOUSE_DRAG
branch.
This bug was introduced in 54456a678f.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* 3666_iec_si_prefixes:
Update po/*.po files.
Update English, Russian, and Spanish man pages
(size_trunc_len): align to properly use either IEC or SI prefixes with the unit B (byte).
Ticket #3666: Improper use of IEC and SI prefixes for size in size_trunc().
Additionally always put a space between number and unit which is
required by the norms.
It is important to note that really small buffers have to be bigger than it
appears because they store bytes and non-Latin scripts need more than one byte
with UTF-8 to encode them, e.g., the string "1023 МиБ" in Russian requires
11 bytes + null terminator.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
size_trunc() has been aligned to properly use either IEC or SI prefixes with
the unit B (byte). Additionally always put a space between number and unit
which is required by the norms.
Obsolete gettext message ids have been removed and some cleaned up for
duplicate words or leading spaces.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(widget_replace): if new widget cannot take focus, move focus to other widget
before widget replacement.
In our case, the focused file panel is replaced by Info one. Info panel
a) isn't selectable (it never takes focus) and b) uses CWD of current
panel. Therefore focus must be moved to other file panel to make it
current and correctly set up it's CWD before first draw of Info panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This got broken in the following commit for mc-4.8.16:
a5ebb7d619
As `g_strlcpy` got replaced with `g_strndup`, the meaning of the last
argument has changed: it is no longer the destination size in bytes, but
the maximum number of bytes to copy, and so it had to be decremented by
one accordingly, hence the bug.
Signed-off-by: Roman Mikhayloff <rimf@inbox.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
* 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>