treewide: Replace hide/show with set_visible
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
This commit is contained in:
@@ -306,12 +306,12 @@ update_header (CallsSipAccountWidget *self)
|
|||||||
g_assert (CALLS_IS_SIP_ACCOUNT_WIDGET (self));
|
g_assert (CALLS_IS_SIP_ACCOUNT_WIDGET (self));
|
||||||
|
|
||||||
if (self->origin) {
|
if (self->origin) {
|
||||||
gtk_widget_show (self->header_edit);
|
gtk_widget_set_visible (self->header_edit, TRUE);
|
||||||
gtk_widget_hide (self->header_add);
|
gtk_widget_set_visible (self->header_add, FALSE);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
gtk_widget_show (self->header_add);
|
gtk_widget_set_visible (self->header_add, TRUE);
|
||||||
gtk_widget_hide (self->header_edit);
|
gtk_widget_set_visible (self->header_edit, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->connecting) {
|
if (self->connecting) {
|
||||||
|
@@ -285,6 +285,16 @@ on_accounts_changed (GListModel *accounts,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Helper for `on_providers_changed` signal callback
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
hide_widget (GtkWidget *widget)
|
||||||
|
{
|
||||||
|
gtk_widget_set_visible (widget, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_providers_changed (GListModel *providers,
|
on_providers_changed (GListModel *providers,
|
||||||
guint position,
|
guint position,
|
||||||
@@ -297,12 +307,12 @@ on_providers_changed (GListModel *providers,
|
|||||||
g_list_model_get_item (providers, position + i);
|
g_list_model_get_item (providers, position + i);
|
||||||
|
|
||||||
g_signal_connect_swapped (provider, "widget-edit-done",
|
g_signal_connect_swapped (provider, "widget-edit-done",
|
||||||
G_CALLBACK (gtk_widget_hide), self->account_window);
|
G_CALLBACK (hide_widget), self->account_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear any acccount widgets, because they might've gone stale */
|
/* Clear any acccount widgets, because they might've gone stale */
|
||||||
attach_account_widget (self, NULL);
|
attach_account_widget (self, NULL);
|
||||||
gtk_widget_hide (GTK_WIDGET (self->account_window));
|
gtk_widget_set_visible (GTK_WIDGET (self->account_window), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -314,7 +324,7 @@ on_key_pressed (GtkEventControllerKey *controller,
|
|||||||
GtkWidget *widget)
|
GtkWidget *widget)
|
||||||
{
|
{
|
||||||
if (keyval == GDK_KEY_Escape) {
|
if (keyval == GDK_KEY_Escape) {
|
||||||
gtk_widget_hide (widget);
|
gtk_widget_set_visible (widget, FALSE);
|
||||||
return GDK_EVENT_STOP;
|
return GDK_EVENT_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -70,7 +70,7 @@ set_party (CallsCallSelectorItem *self)
|
|||||||
GtkWidget *image = gtk_image_new_from_icon_name ("avatar-default-symbolic");
|
GtkWidget *image = gtk_image_new_from_icon_name ("avatar-default-symbolic");
|
||||||
|
|
||||||
gtk_box_pack_start (self->main_box, image, TRUE, TRUE, 0);
|
gtk_box_pack_start (self->main_box, image, TRUE, TRUE, 0);
|
||||||
gtk_widget_show (image);
|
gtk_widget_set_visible (image, TRUE);
|
||||||
|
|
||||||
call = cui_call_display_get_call (self->display);
|
call = cui_call_display_get_call (self->display);
|
||||||
|
|
||||||
|
@@ -41,13 +41,13 @@ insert_phonenumber (CallsContactsRow *self,
|
|||||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
|
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
|
||||||
gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
|
gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
|
||||||
gtk_widget_show (label);
|
gtk_widget_set_visible (label, TRUE);
|
||||||
gtk_grid_attach (GTK_GRID (self->grid), label, 1, self->n_phonenumbers, 1, 1);
|
gtk_grid_attach (GTK_GRID (self->grid), label, 1, self->n_phonenumbers, 1, 1);
|
||||||
|
|
||||||
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
||||||
gtk_actionable_set_action_name (GTK_ACTIONABLE (button), "app.dial");
|
gtk_actionable_set_action_name (GTK_ACTIONABLE (button), "app.dial");
|
||||||
gtk_actionable_set_action_target (GTK_ACTIONABLE (button), "s", number, NULL);
|
gtk_actionable_set_action_target (GTK_ACTIONABLE (button), "s", number, NULL);
|
||||||
gtk_widget_show (button);
|
gtk_widget_set_visible (button, TRUE);
|
||||||
gtk_grid_attach_next_to (GTK_GRID (self->grid),
|
gtk_grid_attach_next_to (GTK_GRID (self->grid),
|
||||||
button,
|
button,
|
||||||
label,
|
label,
|
||||||
|
@@ -157,9 +157,9 @@ window_update_ussd_state (CallsMainWindow *self,
|
|||||||
|
|
||||||
if (state == CALLS_USSD_STATE_USER_RESPONSE ||
|
if (state == CALLS_USSD_STATE_USER_RESPONSE ||
|
||||||
state == CALLS_USSD_STATE_ACTIVE)
|
state == CALLS_USSD_STATE_ACTIVE)
|
||||||
gtk_widget_show (GTK_WIDGET (self->ussd_cancel_button));
|
gtk_widget_set_visible (GTK_WIDGET (self->ussd_cancel_button), TRUE);
|
||||||
else
|
else
|
||||||
gtk_widget_show (GTK_WIDGET (self->ussd_close_button));
|
gtk_widget_set_visible (GTK_WIDGET (self->ussd_close_button), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -506,8 +506,8 @@ calls_main_window_dial (CallsMainWindow *self,
|
|||||||
const gchar *target)
|
const gchar *target)
|
||||||
{
|
{
|
||||||
if (calls_number_is_ussd (target)) {
|
if (calls_number_is_ussd (target)) {
|
||||||
gtk_widget_hide (GTK_WIDGET (self->ussd_cancel_button));
|
gtk_widget_set_visible (GTK_WIDGET (self->ussd_cancel_button), FALSE);
|
||||||
gtk_widget_hide (GTK_WIDGET (self->ussd_reply_button));
|
gtk_widget_set_visible (GTK_WIDGET (self->ussd_reply_button), FALSE);
|
||||||
gtk_stack_set_visible_child (self->ussd_stack, GTK_WIDGET (self->ussd_spinner));
|
gtk_stack_set_visible_child (self->ussd_stack, GTK_WIDGET (self->ussd_spinner));
|
||||||
gtk_spinner_start (self->ussd_spinner);
|
gtk_spinner_start (self->ussd_spinner);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user