1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-04 20:07:36 +00:00

treewide: Replace hide/show with set_visible

Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/714>
This commit is contained in:
Anton Lazarev 2023-12-13 16:05:27 -08:00
parent 12b78ca5f6
commit 34a7651f44
5 changed files with 24 additions and 14 deletions

View file

@ -306,12 +306,12 @@ update_header (CallsSipAccountWidget *self)
g_assert (CALLS_IS_SIP_ACCOUNT_WIDGET (self));
if (self->origin) {
gtk_widget_show (self->header_edit);
gtk_widget_hide (self->header_add);
gtk_widget_set_visible (self->header_edit, TRUE);
gtk_widget_set_visible (self->header_add, FALSE);
} else {
gtk_widget_show (self->header_add);
gtk_widget_hide (self->header_edit);
gtk_widget_set_visible (self->header_add, TRUE);
gtk_widget_set_visible (self->header_edit, FALSE);
}
if (self->connecting) {

View file

@ -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
on_providers_changed (GListModel *providers,
guint position,
@ -297,12 +307,12 @@ on_providers_changed (GListModel *providers,
g_list_model_get_item (providers, position + i);
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 */
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)
{
if (keyval == GDK_KEY_Escape) {
gtk_widget_hide (widget);
gtk_widget_set_visible (widget, FALSE);
return GDK_EVENT_STOP;
}

View file

@ -70,7 +70,7 @@ set_party (CallsCallSelectorItem *self)
GtkWidget *image = gtk_image_new_from_icon_name ("avatar-default-symbolic");
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);

View file

@ -41,13 +41,13 @@ insert_phonenumber (CallsContactsRow *self,
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
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_widget_set_valign (button, GTK_ALIGN_CENTER);
gtk_actionable_set_action_name (GTK_ACTIONABLE (button), "app.dial");
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),
button,
label,

View file

@ -157,9 +157,9 @@ window_update_ussd_state (CallsMainWindow *self,
if (state == CALLS_USSD_STATE_USER_RESPONSE ||
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
gtk_widget_show (GTK_WIDGET (self->ussd_close_button));
gtk_widget_set_visible (GTK_WIDGET (self->ussd_close_button), TRUE);
}
static void
@ -506,8 +506,8 @@ calls_main_window_dial (CallsMainWindow *self,
const gchar *target)
{
if (calls_number_is_ussd (target)) {
gtk_widget_hide (GTK_WIDGET (self->ussd_cancel_button));
gtk_widget_hide (GTK_WIDGET (self->ussd_reply_button));
gtk_widget_set_visible (GTK_WIDGET (self->ussd_cancel_button), FALSE);
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_spinner_start (self->ussd_spinner);