From 6b90a1468a005e6299d797632a12686b87e60309 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 23 Apr 2013 15:56:43 +0400 Subject: [PATCH] (button_set_text): update value of WButton::hotpos. Signed-off-by: Andrew Borodin --- lib/widget/button.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/widget/button.c b/lib/widget/button.c index 50d31bd5b..10d0955ff 100644 --- a/lib/widget/button.c +++ b/lib/widget/button.c @@ -2,7 +2,7 @@ Widgets for the Midnight Commander Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2009, 2010, 2011 + 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2013 The Free Software Foundation, Inc. Authors: @@ -11,7 +11,7 @@ Jakub Jelinek, 1995 Andrej Borsenkow, 1996 Norbert Warmuth, 1997 - Andrew Borodin , 2009, 2010 + Andrew Borodin , 2009, 2010, 2013 This file is part of the Midnight Commander. @@ -240,6 +240,7 @@ button_set_text (WButton * b, const char *text) release_hotkey (b->text); b->text = parse_hotkey (text); + b->hotpos = (b->text.hotkey != NULL) ? str_term_width1 (b->text.start) : -1; w->cols = button_get_len (b); widget_redraw (w); }