mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-11 22:35:31 +00:00
new-call-box: Hide empty results
Because the empty result looks weird.
This commit is contained in:
parent
b1c22e4310
commit
9c777b7db8
2 changed files with 16 additions and 1 deletions
|
@ -50,6 +50,7 @@ struct _CallsNewCallBox
|
|||
HdyKeypad *keypad;
|
||||
GtkButton *dial;
|
||||
GtkEntry *address_entry;
|
||||
HdyActionRow *result;
|
||||
GtkButton *dial_result;
|
||||
GtkGestureLongPress *long_press_back_gesture;
|
||||
|
||||
|
@ -113,6 +114,17 @@ address_activate_cb (CallsNewCallBox *self)
|
|||
calls_origin_dial (origin, address);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
address_changed_cb (CallsNewCallBox *self)
|
||||
{
|
||||
const char *address = gtk_entry_get_text (self->address_entry);
|
||||
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->result),
|
||||
address && *address != '\0');
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
set_numeric (CallsNewCallBox *self,
|
||||
gboolean enable)
|
||||
|
@ -347,6 +359,8 @@ calls_new_call_box_class_init (CallsNewCallBoxClass *klass)
|
|||
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, dial);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, address_entry);
|
||||
gtk_widget_class_bind_template_callback (widget_class, address_activate_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, address_changed_cb);
|
||||
gtk_widget_class_bind_template_child (widget_class, CallsNewCallBox, result);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, dial_result_clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, backspace_clicked_cb);
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<property name="xalign">0.5</property>
|
||||
<property name="placeholder-text" translatable="yes">Enter a VoIP address</property>
|
||||
<signal name="activate" handler="address_activate_cb" swapped="yes"/>
|
||||
<signal name="changed" handler="address_changed_cb" swapped="yes"/>
|
||||
<style>
|
||||
<class name="address-entry"/>
|
||||
</style>
|
||||
|
@ -138,7 +139,7 @@
|
|||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="HdyActionRow" id="result">
|
||||
<property name="visible">True</property>
|
||||
<property name="visible">False</property>
|
||||
<property name="title" bind-source="address_entry" bind-property="text"/>
|
||||
<property name="width-request">300</property>
|
||||
<property name="subtitle" translatable="yes">SIP Account</property>
|
||||
|
|
Loading…
Reference in a new issue