• Julian Sparber's avatar
    Replace HdyDialer with HdyKeypad and bump libhandy to 0.0.12 · 497fe072
    Julian Sparber authored
    HdyDialer was deprecated and therefore is replaced with HdyKeypad.
    HdyDialer used a `gchr *` to store the entered phone number. On every
    button press the entire text of the display entry was replaced with the new
    string, which messed up selection and cursor position.
    HdyKeypad connects directly to a GtkEntry and inserts each
    button press the same way as a keyboard stroke would do.
    In the case of the `call display` entry every new digit is appended to the
    end of the input and therefore it also moves the cursor to the end of the
    entry. Instead of making the Entry not editable, only the events which
    would remove text form the entry are blocked, via the `delete-text`
    signal. And the signal `insert-text` is used to block unwanted chars
    from beeing inserted.
    Same as for the `call display` entry also the `new call box` entry is
    made editable and the signal `insert-text` is used to block unwanted
    chars. All other user action possible on a entry arn't blocked
    e.g. repositioning the cursor.
    The advantage of making the Entry editable is that we can show
    the cursor position.
    It also allows the user to select the position where new digits are
    inserted in the `new call box`.
    On a button press the focus is set to the Entry to give the correct
    feedback to the user.
    This centers the text on the entry, as required by the design.
    This also makes the delete button remove only one char at the time, to
    move closer to the desired UX.
    Related: Librem5/calls#58
    Fixes: Librem5/calls#82
meson.build 4.25 KB