[gnome-software: 18/110] Replace gtk_container_add by their subclass-specific counterparts
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 18/110] Replace gtk_container_add by their subclass-specific counterparts
- Date: Tue, 5 Oct 2021 20:32:35 +0000 (UTC)
commit 9990c3506a5c6437b31509dea197e15ade56bb7b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Aug 21 19:23:02 2021 -0300
Replace gtk_container_add by their subclass-specific counterparts
GtkContainer doesn't exist anymore. Each widget has its own function to
add and remove children. This commit replaces all gtk_container_add() by
the widget-specific one.
Note: AdwDeck doesn't exist. I made up an API until I port it.
src/gs-app-details-page.c | 10 +++++-----
src/gs-app-row.c | 7 +++----
src/gs-category-page.c | 8 ++++----
src/gs-common.c | 9 ++++-----
src/gs-details-page.c | 6 +++---
src/gs-extras-page.c | 2 +-
src/gs-featured-carousel.c | 2 +-
src/gs-installed-page.c | 8 ++++----
src/gs-moderate-page.c | 4 ++--
src/gs-os-update-page.c | 8 ++++----
src/gs-overview-page.c | 10 +++++-----
src/gs-page.c | 4 ++--
src/gs-removal-dialog.c | 4 ++--
src/gs-repos-dialog.c | 14 ++++++++------
src/gs-repos-section.c | 2 +-
src/gs-screenshot-carousel.c | 3 +--
src/gs-search-page.c | 4 ++--
src/gs-star-widget.c | 4 ++--
src/gs-update-dialog.c | 2 +-
src/gs-update-list.c | 2 +-
src/gs-updates-page.c | 12 ++++++------
src/gs-updates-section.c | 4 ++--
22 files changed, 64 insertions(+), 65 deletions(-)
---
diff --git a/src/gs-app-details-page.c b/src/gs-app-details-page.c
index 18af0d791..641dbbfc9 100644
--- a/src/gs-app-details-page.c
+++ b/src/gs-app-details-page.c
@@ -104,24 +104,24 @@ populate_permissions_section (GsAppDetailsPage *page, GsAppPermissions permissio
gtk_widget_set_opacity (image, 0);
gtk_widget_show (image);
- gtk_container_add (GTK_CONTAINER (row), image);
+ gtk_box_append (GTK_BOX (row), image);
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_show (box);
- gtk_container_add (GTK_CONTAINER (row), box);
+ gtk_box_append (GTK_BOX (row), box);
label = gtk_label_new (_(permission_display_data[i].title));
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_widget_show (label);
- gtk_container_add (GTK_CONTAINER (box), label);
+ gtk_box_append (GTK_BOX (row), label);
label = gtk_label_new (_(permission_display_data[i].subtitle));
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
gtk_widget_show (label);
- gtk_container_add (GTK_CONTAINER (box), label);
+ gtk_box_append (GTK_BOX (row), label);
- gtk_container_add (GTK_CONTAINER (page->permissions_section_content), row);
+ gtk_box_append (GTK_BOX (page->permissions_section_content), row);
}
}
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index d36501eb5..8d8eda829 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -557,7 +557,7 @@ gs_app_row_unreveal (GsAppRow *app_row)
g_return_if_fail (GS_IS_APP_ROW (app_row));
- child = gtk_bin_get_child (GTK_BIN (app_row));
+ child = gtk_list_box_row_get_child (GTK_LIST_BOX_ROW (app_row));
gtk_widget_set_sensitive (child, FALSE);
revealer = gtk_revealer_new ();
@@ -565,11 +565,10 @@ gs_app_row_unreveal (GsAppRow *app_row)
gtk_widget_show (revealer);
g_object_ref (child);
- gtk_container_remove (GTK_CONTAINER (app_row), child);
- gtk_container_add (GTK_CONTAINER (revealer), child);
+ gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (app_row), revealer);
+ gtk_revealer_set_child (GTK_REVEALER (revealer), child);
g_object_unref (child);
- gtk_container_add (GTK_CONTAINER (app_row), revealer);
g_signal_connect (revealer, "notify::child-revealed",
G_CALLBACK (child_unrevealed), app_row);
gtk_revealer_set_reveal_child (GTK_REVEALER (revealer), FALSE);
diff --git a/src/gs-category-page.c b/src/gs-category-page.c
index d37e0dabb..6a0a7325f 100644
--- a/src/gs-category-page.c
+++ b/src/gs-category-page.c
@@ -92,7 +92,7 @@ gs_category_page_add_placeholders (GsCategoryPage *self,
for (guint i = 0; i < n_placeholders; ++i) {
GtkWidget *tile = gs_summary_tile_new (NULL);
- gtk_container_add (GTK_CONTAINER (flow_box), tile);
+ gtk_flow_box_insert (flow_box, tile, -1);
gtk_widget_set_can_focus (gtk_widget_get_parent (tile), FALSE);
}
@@ -293,11 +293,11 @@ load_category_finish (LoadCategoryData *data)
G_CALLBACK (app_tile_clicked), self);
if (is_featured)
- gtk_container_add (GTK_CONTAINER (self->featured_flow_box), tile);
+ gtk_flow_box_insert (GTK_FLOW_BOX (self->featured_flow_box), tile, -1);
else if (is_recently_updated)
- gtk_container_add (GTK_CONTAINER (self->recently_updated_flow_box), tile);
+ gtk_flow_box_insert (GTK_FLOW_BOX (self->recently_updated_flow_box), tile, -1);
else
- gtk_container_add (GTK_CONTAINER (self->category_detail_box), tile);
+ gtk_flow_box_insert (GTK_FLOW_BOX (self->category_detail_box), tile, -1);
gtk_widget_set_can_focus (gtk_widget_get_parent (tile), FALSE);
}
diff --git a/src/gs-common.c b/src/gs-common.c
index ce88f6320..e90b20d02 100644
--- a/src/gs-common.c
+++ b/src/gs-common.c
@@ -502,7 +502,7 @@ insert_details_widget (GtkMessageDialog *dialog, const gchar *details)
/* make the hbox expand */
box = gtk_widget_get_parent (message_area);
gtk_container_child_set (GTK_CONTAINER (gtk_widget_get_parent (box)), box,
- "expand", TRUE, "fill", TRUE, NULL);
+ "expand", TRUE, "fill", TRUE, NULL);
/* make the labels not expand */
gtk_container_foreach (GTK_CONTAINER (message_area), do_not_expand, NULL);
@@ -516,7 +516,7 @@ insert_details_widget (GtkMessageDialog *dialog, const gchar *details)
label = gtk_label_new (_("Details"));
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_visible (label, TRUE);
- gtk_container_add (GTK_CONTAINER (message_area), label);
+ gtk_box_append (GTK_BOX (message_area), label);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
@@ -536,10 +536,9 @@ insert_details_widget (GtkMessageDialog *dialog, const gchar *details)
gtk_text_buffer_set_text (buffer, msg->str, -1);
gtk_widget_set_visible (tv, TRUE);
- gtk_container_add (GTK_CONTAINER (sw), tv);
+ gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), tv);
gtk_widget_set_vexpand (sw, TRUE);
- gtk_container_add (GTK_CONTAINER (message_area), sw);
- gtk_container_child_set (GTK_CONTAINER (message_area), sw, "pack-type", GTK_PACK_END, NULL);
+ gtk_box_append (GTK_BOX (message_area), sw);
g_signal_connect (dialog, "map-event", G_CALLBACK (unset_focus), NULL);
}
diff --git a/src/gs-details-page.c b/src/gs-details-page.c
index aa4c2655c..576e5d1f1 100644
--- a/src/gs-details-page.c
+++ b/src/gs-details-page.c
@@ -726,7 +726,7 @@ gs_details_page_get_alternates_cb (GObject *source_object,
}
gs_origin_popover_row_set_size_group (GS_ORIGIN_POPOVER_ROW (row),
self->size_group_origin_popover);
- gtk_container_add (GTK_CONTAINER (self->origin_popover_list_box), row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->origin_popover_list_box), row, -1);
if (origin_by_packaging_format) {
const gchar *packaging_format = gs_app_get_packaging_format_raw (app);
@@ -1226,7 +1226,7 @@ gs_details_page_refresh_addons (GsDetailsPage *self)
G_CALLBACK (gs_details_page_addon_remove_cb),
self);
- gtk_container_add (GTK_CONTAINER (self->list_box_addons), row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_addons), row, -1);
gtk_widget_show (row);
}
@@ -1383,7 +1383,7 @@ gs_details_page_refresh_reviews (GsDetailsPage *self)
actions = possible_actions & ~(1u << GS_REVIEW_ACTION_REMOVE);
}
gs_review_row_set_actions (GS_REVIEW_ROW (row), actions);
- gtk_container_add (GTK_CONTAINER (self->list_box_reviews), row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_reviews), row, -1);
gtk_widget_set_visible (row, self->show_all_reviews ||
i < SHOW_NR_REVIEWS_INITIAL);
gs_review_row_set_network_available (GS_REVIEW_ROW (row),
diff --git a/src/gs-extras-page.c b/src/gs-extras-page.c
index 17549024d..72de050e5 100644
--- a/src/gs-extras-page.c
+++ b/src/gs-extras-page.c
@@ -316,7 +316,7 @@ gs_extras_page_add_app (GsExtrasPage *self, GsApp *app, GsAppList *list, SearchD
G_CALLBACK (app_row_button_clicked_cb),
self);
- gtk_container_add (GTK_CONTAINER (self->list_box_results), app_row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_results), app_row, -1);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
self->sizegroup_image,
self->sizegroup_name,
diff --git a/src/gs-featured-carousel.c b/src/gs-featured-carousel.c
index bb99587a7..20007b834 100644
--- a/src/gs-featured-carousel.c
+++ b/src/gs-featured-carousel.c
@@ -437,7 +437,7 @@ gs_featured_carousel_set_apps (GsFeaturedCarousel *self,
gtk_widget_set_can_focus (tile, FALSE);
g_signal_connect (tile, "clicked",
G_CALLBACK (app_tile_clicked_cb), self);
- gtk_container_add (GTK_CONTAINER (self->carousel), tile);
+ adw_carousel_append (self->carousel, tile);
}
gtk_widget_set_visible (GTK_WIDGET (self->next_button), self->apps != NULL && gs_app_list_length
(self->apps) > 1);
diff --git a/src/gs-installed-page.c b/src/gs-installed-page.c
index 5ac7ae959..21d1fa334 100644
--- a/src/gs-installed-page.c
+++ b/src/gs-installed-page.c
@@ -233,16 +233,16 @@ gs_installed_page_add_app (GsInstalledPage *self, GsAppList *list, GsApp *app)
switch (gs_installed_page_get_app_section (app)) {
case GS_UPDATE_LIST_SECTION_INSTALLING_AND_REMOVING:
- gtk_container_add (GTK_CONTAINER (self->list_box_install_in_progress), app_row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install_in_progress), app_row, -1);
break;
case GS_UPDATE_LIST_SECTION_REMOVABLE_APPS:
- gtk_container_add (GTK_CONTAINER (self->list_box_install_apps), app_row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install_apps), app_row, -1);
break;
case GS_UPDATE_LIST_SECTION_SYSTEM_APPS:
- gtk_container_add (GTK_CONTAINER (self->list_box_install_system_apps), app_row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install_system_apps), app_row, -1);
break;
case GS_UPDATE_LIST_SECTION_ADDONS:
- gtk_container_add (GTK_CONTAINER (self->list_box_install_addons), app_row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install_addons), app_row, -1);
break;
default:
g_assert_not_reached ();
diff --git a/src/gs-moderate-page.c b/src/gs-moderate-page.c
index 69d560a44..bebc3ede2 100644
--- a/src/gs-moderate-page.c
+++ b/src/gs-moderate-page.c
@@ -158,7 +158,7 @@ gs_moderate_page_add_app (GsModeratePage *self, GsApp *app)
/* add top level app */
app_row = gs_app_row_new (app);
gs_app_row_set_show_buttons (GS_APP_ROW (app_row), TRUE);
- gtk_container_add (GTK_CONTAINER (self->list_box_install), app_row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install), app_row, -1);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
self->sizegroup_image,
self->sizegroup_name,
@@ -183,7 +183,7 @@ gs_moderate_page_add_app (GsModeratePage *self, GsApp *app)
g_object_set_data_full (G_OBJECT (row), "GsApp",
g_object_ref (app),
(GDestroyNotify) g_object_unref);
- gtk_container_add (GTK_CONTAINER (self->list_box_install), row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_install), row, -1);
}
gtk_widget_show (app_row);
}
diff --git a/src/gs-os-update-page.c b/src/gs-os-update-page.c
index e74ebcab6..5c935c8e7 100644
--- a/src/gs-os-update-page.c
+++ b/src/gs-os-update-page.c
@@ -145,7 +145,7 @@ create_app_row (GsApp *app)
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_hexpand (label, TRUE);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_container_add (GTK_CONTAINER (row), label);
+ gtk_box_append (GTK_BOX (row), label);
if (gs_app_get_state (app) == GS_APP_STATE_UPDATABLE ||
gs_app_get_state (app) == GS_APP_STATE_UPDATABLE_LIVE) {
g_autofree gchar *verstr = format_version_update (app, gtk_widget_get_direction (row));
@@ -163,7 +163,7 @@ create_app_row (GsApp *app)
NULL);
gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
- gtk_container_add (GTK_CONTAINER (row), label);
+ gtk_box_append (GTK_BOX (row), label);
gtk_widget_show_all (row);
return row;
@@ -292,7 +292,7 @@ get_section_header (GsOsUpdatePage *page, GsOsUpdatePageSection section)
/* put label into the header */
gtk_widget_set_hexpand (label, TRUE);
- gtk_container_add (GTK_CONTAINER (header), label);
+ gtk_box_append (GTK_BOX (header), label);
gtk_widget_set_visible (label, TRUE);
gtk_widget_set_margin_start (label, 6);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
@@ -338,7 +338,7 @@ create_section (GsOsUpdatePage *page, GsOsUpdatePageSection section)
G_CALLBACK (row_activated_cb), page);
gtk_widget_set_visible (page->list_boxes[section], TRUE);
gtk_widget_set_vexpand (page->list_boxes[section], TRUE);
- gtk_container_add (GTK_CONTAINER (page->box), page->list_boxes[section]);
+ gtk_box_append (GTK_BOX (page->box), page->list_boxes[section]);
gtk_widget_set_margin_top (page->list_boxes[section], 24);
/* reorder the children */
diff --git a/src/gs-overview-page.c b/src/gs-overview-page.c
index 938c1bb3e..6b3e5f1e0 100644
--- a/src/gs-overview-page.c
+++ b/src/gs-overview-page.c
@@ -157,7 +157,7 @@ gs_overview_page_get_popular_cb (GObject *source_object,
tile = gs_summary_tile_new (app);
g_signal_connect (tile, "clicked",
G_CALLBACK (app_tile_clicked), self);
- gtk_container_add (GTK_CONTAINER (self->box_popular), tile);
+ gtk_flow_box_insert (GTK_FLOW_BOX (self->box_popular), tile, -1);
}
gtk_widget_set_visible (self->box_popular, TRUE);
gtk_widget_set_visible (self->popular_heading, TRUE);
@@ -213,8 +213,8 @@ gs_overview_page_get_recent_cb (GObject *source_object, GAsyncResult *res, gpoin
*/
gtk_widget_set_can_focus (child, FALSE);
gtk_widget_show (child);
- gtk_container_add (GTK_CONTAINER (child), tile);
- gtk_container_add (GTK_CONTAINER (self->box_recent), child);
+ gtk_flow_box_child_set_child (GTK_FLOW_BOX_CHILD (child), tile);
+ gtk_flow_box_insert (GTK_FLOW_BOX (self->box_recent), child, -1);
}
gtk_widget_set_visible (self->box_recent, TRUE);
gtk_widget_set_visible (self->recent_heading, TRUE);
@@ -627,12 +627,12 @@ gs_overview_page_setup (GsPage *page,
for (i = 0; i < N_TILES; i++) {
tile = gs_summary_tile_new (NULL);
- gtk_container_add (GTK_CONTAINER (self->box_popular), tile);
+ gtk_flow_box_insert (GTK_FLOW_BOX (self->box_popular), tile, -1);
}
for (i = 0; i < N_TILES; i++) {
tile = gs_summary_tile_new (NULL);
- gtk_container_add (GTK_CONTAINER (self->box_recent), tile);
+ gtk_flow_box_insert (GTK_FLOW_BOX (self->box_recent), tile, -1);
}
return TRUE;
diff --git a/src/gs-page.c b/src/gs-page.c
index dfaadbc39..6528c134c 100644
--- a/src/gs-page.c
+++ b/src/gs-page.c
@@ -112,7 +112,7 @@ gs_page_show_update_message (GsPageHelper *helper, AsScreenshot *ss)
gtk_widget_set_margin_start (ssimg, 24);
gtk_widget_set_margin_end (ssimg, 24);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
- gtk_container_add (GTK_CONTAINER (content_area), ssimg);
+ gtk_box_append (GTK_BOX (content_area), ssimg);
gtk_container_child_set (GTK_CONTAINER (content_area), ssimg, "pack-type", GTK_PACK_END,
NULL);
}
@@ -384,7 +384,7 @@ gs_page_needs_user_action (GsPageHelper *helper, AsScreenshot *ss)
gtk_widget_set_margin_start (ssimg, 24);
gtk_widget_set_margin_end (ssimg, 24);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
- gtk_container_add (GTK_CONTAINER (content_area), ssimg);
+ gtk_box_append (GTK_BOX (content_area), ssimg);
gtk_container_child_set (GTK_CONTAINER (content_area), ssimg, "pack-type", GTK_PACK_END, NULL);
/* handle this async */
diff --git a/src/gs-removal-dialog.c b/src/gs-removal-dialog.c
index 1c8e5f787..fcbde8a54 100644
--- a/src/gs-removal-dialog.c
+++ b/src/gs-removal-dialog.c
@@ -53,7 +53,7 @@ add_app (GtkListBox *listbox, GsApp *app)
gtk_widget_set_halign (widget, GTK_ALIGN_START);
gtk_widget_set_tooltip_text (widget, gs_app_get_name (app));
gtk_label_set_ellipsize (GTK_LABEL (widget), PANGO_ELLIPSIZE_END);
- gtk_container_add (GTK_CONTAINER (box), widget);
+ gtk_box_append (GTK_BOX (box), widget);
if (gs_app_get_name (app) != NULL) {
sort_key = gs_utils_sort_key (gs_app_get_name (app));
@@ -91,7 +91,7 @@ insert_details_widget (GtkMessageDialog *dialog, GtkWidget *widget)
gtk_label_set_max_width_chars (GTK_LABEL (l->data), 40);
}
- gtk_container_add (GTK_CONTAINER (message_area), widget);
+ gtk_box_append (GTK_BOX (message_area), widget);
}
void
diff --git a/src/gs-repos-dialog.c b/src/gs-repos-dialog.c
index 3b1aac363..654e93856 100644
--- a/src/gs-repos-dialog.c
+++ b/src/gs-repos-dialog.c
@@ -501,8 +501,8 @@ get_sources_cb (GsPluginLoader *plugin_loader,
sections = g_hash_table_get_values (dialog->sections);
sections = g_list_sort (sections, repos_dialog_compare_sections_cb);
for (GList *link = sections; link; link = g_list_next (link)) {
- GtkWidget *section = link->data;
- gtk_container_add (GTK_CONTAINER (dialog->content_page), section);
+ AdwPreferencesGroup *section = link->data;
+ adw_preferences_page_add (ADW_PREFERENCES_PAGE (dialog->content_page), section);
}
gtk_widget_set_visible (dialog->content_page, sections != NULL);
@@ -525,7 +525,7 @@ get_sources_cb (GsPluginLoader *plugin_loader,
adw_preferences_row_set_title (ADW_PREFERENCES_ROW (row), _("Enable New Repositories"));
adw_action_row_set_subtitle (ADW_ACTION_ROW (row), _("Turn on new repositories when they are
added."));
adw_action_row_set_activatable_widget (ADW_ACTION_ROW (row), widget);
- gtk_container_add (GTK_CONTAINER (row), widget);
+ adw_action_row_add_suffix (ADW_ACTION_ROW (row), widget);
gtk_widget_show (row);
anchor = g_strdup_printf ("<a href=\"%s\">%s</a>",
@@ -552,8 +552,9 @@ get_sources_cb (GsPluginLoader *plugin_loader,
#endif
gtk_widget_show (widget);
- gtk_container_add (GTK_CONTAINER (widget), row);
- gtk_container_add (GTK_CONTAINER (dialog->content_page), widget);
+ adw_preferences_group_add (ADW_PREFERENCES_GROUP (widget), row);
+ adw_preferences_page_add (ADW_PREFERENCES_PAGE (dialog->content_page),
+ ADW_PREFERENCES_GROUP (widget));
section = GS_REPOS_SECTION (gs_repos_section_new (dialog->plugin_loader, TRUE));
gs_repos_section_set_sort_key (section, "900");
@@ -566,7 +567,8 @@ get_sources_cb (GsPluginLoader *plugin_loader,
gs_repos_section_add_repo (section, repo);
}
- gtk_container_add (GTK_CONTAINER (dialog->content_page), GTK_WIDGET (section));
+ adw_preferences_page_add (ADW_PREFERENCES_PAGE (dialog->content_page),
+ ADW_PREFERENCES_GROUP (widget));
}
}
diff --git a/src/gs-repos-section.c b/src/gs-repos-section.c
index 9577d7287..4519026c5 100644
--- a/src/gs-repos-section.c
+++ b/src/gs-repos-section.c
@@ -125,7 +125,7 @@ gs_repos_section_init (GsReposSection *self)
style_context = gtk_widget_get_style_context (GTK_WIDGET (self->list));
gtk_style_context_add_class (style_context, "content");
- gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->list));
+ adw_preferences_group_add (ADW_PREFERENCES_GROUP (self), GTK_WIDGET (self->list));
g_signal_connect (self->list, "row-activated",
G_CALLBACK (gs_repos_section_row_activated_cb), self);
diff --git a/src/gs-screenshot-carousel.c b/src/gs-screenshot-carousel.c
index 6bba44b44..8857590c3 100644
--- a/src/gs-screenshot-carousel.c
+++ b/src/gs-screenshot-carousel.c
@@ -148,8 +148,7 @@ gs_screenshot_carousel_load_screenshots (GsScreenshotCarousel *self, GsApp *app,
continue;
}
- gtk_container_add (GTK_CONTAINER (self->carousel),
- ssimg);
+ adw_carousel_append (ADW_CAROUSEL (self->carousel), ssimg);
gtk_widget_show (ssimg);
gs_screenshot_image_set_description (GS_SCREENSHOT_IMAGE (ssimg),
as_screenshot_get_caption (ss));
diff --git a/src/gs-search-page.c b/src/gs-search-page.c
index e210e172a..c266961c1 100644
--- a/src/gs-search-page.c
+++ b/src/gs-search-page.c
@@ -151,7 +151,7 @@ gs_search_page_get_search_cb (GObject *source_object,
g_signal_connect (app_row, "button-clicked",
G_CALLBACK (gs_search_page_app_row_clicked_cb),
self);
- gtk_container_add (GTK_CONTAINER (self->list_box_search), app_row);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_search), app_row, -1);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
self->sizegroup_image,
self->sizegroup_name,
@@ -180,7 +180,7 @@ gs_search_page_get_search_cb (GObject *source_object,
gtk_widget_set_margin_end (w, 20);
context = gtk_widget_get_style_context (w);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_DIM_LABEL);
- gtk_container_add (GTK_CONTAINER (self->list_box_search), w);
+ gtk_list_box_insert (GTK_LIST_BOX (self->list_box_search), w, -1);
gtk_widget_show (w);
} else {
/* reset to default */
diff --git a/src/gs-star-widget.c b/src/gs-star-widget.c
index 5090249e5..e617a1685 100644
--- a/src/gs-star-widget.c
+++ b/src/gs-star-widget.c
@@ -139,7 +139,7 @@ gs_star_widget_refresh (GsStarWidget *star)
g_object_set_data (G_OBJECT (w),
"GsStarWidget::value",
GINT_TO_POINTER (rate_to_star[i]));
- gtk_container_add (GTK_CONTAINER (w), im);
+ gtk_button_set_child (GTK_BUTTON (w), im);
gtk_widget_set_visible (im, TRUE);
} else {
w = im;
@@ -147,7 +147,7 @@ gs_star_widget_refresh (GsStarWidget *star)
gtk_widget_set_sensitive (w, priv->interactive);
gtk_style_context_add_class (gtk_widget_get_style_context (w), "star");
gtk_widget_set_visible (w, TRUE);
- gtk_container_add (GTK_CONTAINER (priv->box1), w);
+ gtk_box_append (GTK_BOX (priv->box1), w);
}
gs_star_widget_refresh_rating (star);
diff --git a/src/gs-update-dialog.c b/src/gs-update-dialog.c
index 2109f86d2..4f2a3a2ac 100644
--- a/src/gs-update-dialog.c
+++ b/src/gs-update-dialog.c
@@ -210,7 +210,7 @@ gs_update_dialog_show_update_details (GsUpdateDialog *dialog, GsApp *app)
gtk_widget_show (page);
- gtk_container_add (GTK_CONTAINER (dialog->deck), page);
+ adw_deck_add (ADW_DECK (dialog->deck), page);
adw_deck_set_visible_child (ADW_DECK (dialog->deck), page);
}
diff --git a/src/gs-update-list.c b/src/gs-update-list.c
index 98cd44658..c0d319da1 100644
--- a/src/gs-update-list.c
+++ b/src/gs-update-list.c
@@ -44,7 +44,7 @@ gs_update_list_add_app (GsUpdateList *update_list, GsApp *app)
gs_app_row_set_show_description (GS_APP_ROW (app_row), FALSE);
gs_app_row_set_show_update (GS_APP_ROW (app_row), FALSE);
gs_app_row_set_show_buttons (GS_APP_ROW (app_row), FALSE);
- gtk_container_add (GTK_CONTAINER (update_list), app_row);
+ gtk_list_box_insert (GTK_LIST_BOX (update_list), app_row, -1);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
priv->sizegroup_image,
priv->sizegroup_name,
diff --git a/src/gs-updates-page.c b/src/gs-updates-page.c
index 4e9febec9..ba2e2ef57 100644
--- a/src/gs-updates-page.c
+++ b/src/gs-updates-page.c
@@ -1247,7 +1247,7 @@ gs_updates_page_setup (GsPage *page,
g_object_bind_property (G_OBJECT (self), "is-narrow",
self->sections[i], "is-narrow",
G_BINDING_SYNC_CREATE);
- gtk_container_add (GTK_CONTAINER (self->updates_box), GTK_WIDGET (self->sections[i]));
+ gtk_box_append (GTK_BOX (self->updates_box), GTK_WIDGET (self->sections[i]));
}
self->shell = shell;
@@ -1289,20 +1289,20 @@ gs_updates_page_setup (GsPage *page,
widget = gtk_label_new (_("Checking…"));
gtk_widget_show (widget);
- gtk_container_add (GTK_CONTAINER (self->header_checking_label), widget);
+ adw_squeezer_add (ADW_SQUEEZER (self->header_checking_label), widget);
/* FIXME: This box is just a 0x0 widget the squeezer will show when it
* hasn't enough space to show the label. In GTK 4, we will be able to
* use AdwSqueezer:allow-none instead. */
widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (widget);
- gtk_container_add (GTK_CONTAINER (self->header_checking_label), widget);
+ adw_squeezer_add (ADW_SQUEEZER (self->header_checking_label), widget);
- gtk_container_add (GTK_CONTAINER (self->header_start_box), self->header_checking_label);
+ gtk_box_prepend (GTK_BOX (self->header_start_box), self->header_checking_label);
gtk_container_child_set(GTK_CONTAINER (self->header_start_box), self->header_checking_label,
"pack-type", GTK_PACK_END, NULL);
self->header_spinner_start = gtk_spinner_new ();
- gtk_container_add (GTK_CONTAINER (self->header_start_box), self->header_spinner_start);
+ gtk_box_prepend (GTK_BOX (self->header_start_box), self->header_spinner_start);
gtk_container_child_set (GTK_CONTAINER (self->header_start_box), self->header_spinner_start,
"pack-type", GTK_PACK_END, NULL);
@@ -1311,7 +1311,7 @@ gs_updates_page_setup (GsPage *page,
accessible = gtk_widget_get_accessible (self->button_refresh);
if (accessible != NULL)
atk_object_set_name (accessible, _("Check for updates"));
- gtk_container_add (GTK_CONTAINER (self->header_start_box), self->button_refresh);
+ gtk_box_prepend (GTK_BOX (self->header_start_box), self->button_refresh);
g_signal_connect (self->button_refresh, "clicked",
G_CALLBACK (gs_updates_page_button_refresh_cb),
self);
diff --git a/src/gs-updates-section.c b/src/gs-updates-section.c
index 6e9c8de19..bee59bf3c 100644
--- a/src/gs-updates-section.c
+++ b/src/gs-updates-section.c
@@ -142,7 +142,7 @@ gs_updates_section_add_app (GsUpdatesSection *self, GsApp *app)
g_signal_connect (app_row, "button-clicked",
G_CALLBACK (_app_row_button_clicked_cb),
self);
- gtk_container_add (GTK_CONTAINER (self), app_row);
+ gtk_box_append (GTK_BOX (self), app_row);
gs_app_list_add (self->list, app);
gs_app_row_set_size_groups (GS_APP_ROW (app_row),
@@ -553,7 +553,7 @@ gs_updates_section_add (GtkContainer *container, GtkWidget *child)
GTK_CONTAINER_CLASS (gs_updates_section_parent_class)->add (container, child);
} else {
/* Add external children to the listbox. */
- gtk_container_add (GTK_CONTAINER (self->listbox), child);
+ gtk_list_box_insert (GTK_LIST_BOX (self->listbox), child, -1);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]