Commit 347a4a57 authored by Julian Sparber's avatar Julian Sparber Committed by Guido Gunther
Browse files

Keypad: Do not show allow typing + when only_digits is true

The keypad shouldn't allow typing or show + when only_digits
is set to true. Therefore this adds the correct behavior.
parent a17879cc
......@@ -119,8 +119,7 @@ insert_text_cb (HdyKeypad *self,
if (g_ascii_isdigit (*text))
return;
if ((!priv->only_digits && strchr("#*", *text)) ||
(priv->show_symbols && strchr("+", *text)))
if (!priv->only_digits && strchr("#*+", *text))
return;
g_signal_stop_emission_by_name (editable, "insert-text");
......@@ -138,7 +137,7 @@ long_press_zero_cb (HdyKeypad *self,
g_return_if_fail (HDY_IS_KEYPAD (self));
priv = hdy_keypad_get_instance_private (self);
if (!priv->show_symbols)
if (priv->only_digits)
return;
g_debug ("Long press on zero button");
......
......@@ -174,7 +174,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="focus_on_click">False</property>
<property name="show-symbols" bind-source="HdyKeypad" bind-property="show-symbols" bind-flags="sync-create"/>
<property name="show-symbols" bind-source="HdyKeypad" bind-property="only-digits" bind-flags="sync-create|invert-boolean"/>
<signal name="clicked" handler="button_clicked_cb" swapped="true"/>
</object>
<packing>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment