Ticket #3721: 3721-clean-up-radio-widget-s-MSG_CURSOR.patch

File 3721-clean-up-radio-widget-s-MSG_CURSOR.patch, 1.6 KB (added by mooffie, 8 years ago)
  • lib/widget/radio.c

    From 23e2b56461609b36a2a0d7b13fb49e7e854cf689 Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Sun, 6 Nov 2016 02:37:06 +0200
    Subject: [PATCH] Ticket #3721: clean up radio widget's MSG_CURSOR.
    
    ---
     lib/widget/radio.c | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/lib/widget/radio.c b/lib/widget/radio.c
    index 4568968..a4cc7c8 100644
    a b radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    8484        { 
    8585        case ' ': 
    8686            r->sel = r->pos; 
    87             widget_set_state (w, WST_FOCUSED, TRUE); 
     87            widget_set_state (w, WST_FOCUSED, TRUE);    /* Also draws the widget. */ 
    8888            return MSG_HANDLED; 
    8989 
    9090        case KEY_UP: 
    radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    9292            if (r->pos > 0) 
    9393            { 
    9494                r->pos--; 
     95                widget_redraw (w); 
    9596                return MSG_HANDLED; 
    9697            } 
    9798            return MSG_NOT_HANDLED; 
    radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    101102            if (r->count - 1 > r->pos) 
    102103            { 
    103104                r->pos++; 
     105                widget_redraw (w); 
    104106                return MSG_HANDLED; 
    105107            } 
    106108        default: 
    radio_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *d 
    108110        } 
    109111 
    110112    case MSG_CURSOR: 
    111         widget_set_state (w, WST_FOCUSED, TRUE); 
    112113        widget_move (r, r->pos, 1); 
    113114        return MSG_HANDLED; 
    114115