Changeset 3151


Ignore:
Timestamp:
10/12/07 14:57:47 (6 years ago)
Author:
thomas
Message:
  • src/moko-keypad.c: Clear dialer display when delete button held down,

rather than only when held and released

Location:
trunk/src/target/OM-2007.2/applications/openmoko-dialer2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007.2/applications/openmoko-dialer2/ChangeLog

    r3150 r3151  
     12007-10-12  Thomas Wood  <thomas@openedhand.com> 
     2 
     3        * src/moko-keypad.c: Clear dialer display when delete button held down, 
     4        rather than only when held and released 
     5 
    162007-10-12  Thomas Wood  <thomas@openedhand.com> 
    27 
  • trunk/src/target/OM-2007.2/applications/openmoko-dialer2/src/moko-keypad.c

    r3150 r3151  
    174174 
    175175static gboolean 
     176moko_keypad_hold_timeout (MokoDialerTextview *textview) 
     177{ 
     178  moko_dialer_textview_empty (textview); 
     179  return FALSE; 
     180} 
     181 
     182static gboolean 
    176183on_delete_event (GtkWidget *button, GdkEventButton *event, MokoKeypad *keypad) 
    177184{ 
    178 #define TAP_HOLD_TIME 800 
    179185  MokoKeypadPrivate *priv; 
    180186  MokoDialerTextview *textview; 
    181   static guint32 last_event = 0; 
    182187  GList *matches; 
    183    
     188  static gint hold_timeout_source = 0; 
     189 
    184190  g_return_val_if_fail (MOKO_IS_KEYPAD (keypad), FALSE); 
    185191  priv = keypad->priv; 
    186    
     192 
    187193  textview = MOKO_DIALER_TEXTVIEW (priv->textview); 
    188194 
    189195  if (event->type == GDK_BUTTON_PRESS) 
    190196  { 
    191     last_event = event->time; 
     197    moko_dialer_textview_delete (textview); 
     198    hold_timeout_source = g_timeout_add (800, (GSourceFunc) moko_keypad_hold_timeout, textview); 
    192199    return FALSE; 
    193200  } 
    194201  else if (event->type == GDK_BUTTON_RELEASE) 
    195202  { 
    196     guint32 diff = event->time - last_event; 
    197  
    198     if (diff < TAP_HOLD_TIME) 
    199     { 
    200       /* Normal 'clicked' event */ 
    201       moko_dialer_textview_delete (textview); 
    202     } 
    203     else 
    204     { 
    205       /* Tap-and-hold event */ 
    206       moko_dialer_textview_empty (textview); 
    207    } 
    208   } 
    209    
     203    g_source_remove (hold_timeout_source); 
     204  } 
     205 
    210206  if (!priv->pin_mode) 
    211207  { 
Note: See TracChangeset for help on using the changeset viewer.