[gnome-initial-setup/wip/port-to-gtk4: 97/110] language: Port to GTK4




commit 8f0b781cfecb1e89d61fe5d27e491b30e856906b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jul 5 14:48:30 2022 -0300

    language: Port to GTK4
    
    Port all 3 widgets to GTK4. Make GisWelcomeWidget use an AdwCarousel
    internally, which simplifies a lot of code. Other than that, the rest
    of the changes are essentially API updates to build.
    
    Use an AdwClamp to center-limit the widgetry.

 gnome-initial-setup/gnome-initial-setup.c          |   4 +-
 gnome-initial-setup/meson.build                    |   2 +-
 .../pages/language/cc-language-chooser.c           | 123 ++++++++-------------
 .../pages/language/gis-language-page.ui            |  66 +++++------
 .../pages/language/gis-welcome-widget.c            |  43 ++++---
 .../pages/language/gis-welcome-widget.h            |   6 +-
 .../pages/language/gis-welcome-widget.ui           |   9 +-
 .../pages/language/language-chooser.ui             |  30 ++---
 gnome-initial-setup/pages/meson.build              |   2 +-
 9 files changed, 122 insertions(+), 163 deletions(-)
---
diff --git a/gnome-initial-setup/gnome-initial-setup.c b/gnome-initial-setup/gnome-initial-setup.c
index 4fccd2ad..9f912bca 100644
--- a/gnome-initial-setup/gnome-initial-setup.c
+++ b/gnome-initial-setup/gnome-initial-setup.c
@@ -30,7 +30,7 @@
 #include <glib/gi18n.h>
 
 #include "pages/welcome/gis-welcome-page.h"
-//#include "pages/language/gis-language-page.h"
+#include "pages/language/gis-language-page.h"
 //#include "pages/keyboard/gis-keyboard-page.h"
 //#include "pages/network/gis-network-page.h"
 //#include "pages/timezone/gis-timezone-page.h"
@@ -63,7 +63,7 @@ typedef struct {
 
 static PageData page_table[] = {
   PAGE (welcome, FALSE),
-  //PAGE (language, FALSE),
+  PAGE (language, FALSE),
   //PAGE (keyboard, FALSE),
   //PAGE (network,  FALSE),
   //PAGE (privacy,  FALSE),
diff --git a/gnome-initial-setup/meson.build b/gnome-initial-setup/meson.build
index 1f5b1122..2a4b0655 100644
--- a/gnome-initial-setup/meson.build
+++ b/gnome-initial-setup/meson.build
@@ -37,7 +37,7 @@ libadwaita_dep = dependency(
 dependencies = [
     #dependency ('libnm', version: '>= 1.2'),
     #dependency ('libnma', version: '>= 1.0'),
-    #dependency ('polkit-gobject-1', version: '>= 0.103'),
+    dependency ('polkit-gobject-1', version: '>= 0.103'),
     dependency ('accountsservice'),
     #dependency ('geocode-glib-2.0'),
     dependency ('gnome-desktop-4'),
diff --git a/gnome-initial-setup/pages/language/cc-language-chooser.c 
b/gnome-initial-setup/pages/language/cc-language-chooser.c
index fa8531cc..309704c6 100644
--- a/gnome-initial-setup/pages/language/cc-language-chooser.c
+++ b/gnome-initial-setup/pages/language/cc-language-chooser.c
@@ -42,7 +42,6 @@ struct _CcLanguageChooserPrivate
         GtkWidget *filter_entry;
         GtkWidget *language_list;
 
-        GtkWidget *scrolled_window;
         GtkWidget *no_results;
         GtkWidget *more_item;
 
@@ -90,11 +89,11 @@ static GtkWidget *
 padded_label_new (char *text)
 {
         GtkWidget *widget;
-        widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
+        widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
         gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
-        gtk_widget_set_margin_top (widget, 10);
-        gtk_widget_set_margin_bottom (widget, 10);
-        gtk_box_pack_start (GTK_BOX (widget), gtk_label_new (text), FALSE, FALSE, 0);
+        gtk_widget_set_margin_top (widget, 12);
+        gtk_widget_set_margin_bottom (widget, 12);
+        gtk_box_append (GTK_BOX (widget), gtk_label_new (text));
         return widget;
 }
 
@@ -143,22 +142,21 @@ language_widget_new (const char *locale_id,
         locale_current_name = gnome_get_language_from_locale (locale_id, NULL);
         locale_untranslated_name = gnome_get_language_from_locale (locale_id, "C");
 
-        widget->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
-        gtk_widget_set_margin_top (widget->box, 10);
-        gtk_widget_set_margin_bottom (widget->box, 10);
-        gtk_widget_set_margin_start (widget->box, 10);
-        gtk_widget_set_margin_end (widget->box, 10);
+        widget->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+        gtk_widget_set_margin_top (widget->box, 12);
+        gtk_widget_set_margin_bottom (widget->box, 12);
+        gtk_widget_set_margin_start (widget->box, 12);
+        gtk_widget_set_margin_end (widget->box, 12);
         gtk_widget_set_halign (widget->box, GTK_ALIGN_FILL);
 
         label = gtk_label_new (language_name);
         gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
         gtk_label_set_max_width_chars (GTK_LABEL (label), 30);
         gtk_label_set_xalign (GTK_LABEL (label), 0);
-        gtk_box_pack_start (GTK_BOX (widget->box), label, FALSE, FALSE, 0);
+        gtk_box_append (GTK_BOX (widget->box), label);
 
-        widget->checkmark = gtk_image_new_from_icon_name ("object-select-symbolic", GTK_ICON_SIZE_MENU);
-        gtk_box_pack_start (GTK_BOX (widget->box), widget->checkmark, FALSE, FALSE, 0);
-        gtk_widget_show (widget->checkmark);
+        widget->checkmark = gtk_image_new_from_icon_name ("object-select-symbolic");
+        gtk_box_append (GTK_BOX (widget->box), widget->checkmark);
 
         if (country_name) {
                 label = gtk_label_new (country_name);
@@ -166,8 +164,9 @@ language_widget_new (const char *locale_id,
                 gtk_label_set_max_width_chars (GTK_LABEL (label), 30);
                 gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
                 gtk_label_set_xalign (GTK_LABEL (label), 0);
+                gtk_widget_set_hexpand (label, TRUE);
                 gtk_widget_set_halign (label, GTK_ALIGN_END);
-                gtk_box_pack_end (GTK_BOX (widget->box), label, FALSE, FALSE, 0);
+                gtk_box_append (GTK_BOX (widget->box), label);
         }
 
         widget->locale_id = g_strdup (locale_id);
@@ -189,32 +188,28 @@ language_widget_new (const char *locale_id,
 }
 
 static void
-sync_checkmark (GtkWidget *row,
-                gpointer   user_data)
+sync_all_checkmarks (CcLanguageChooser *chooser)
 {
-        GtkWidget *child;
-        LanguageWidget *widget;
-        gchar *locale_id;
-        gboolean should_be_visible;
+        CcLanguageChooserPrivate *priv = cc_language_chooser_get_instance_private (chooser);
+        GtkWidget *row;
 
-        child = gtk_bin_get_child (GTK_BIN (row));
-        widget = get_language_widget (child);
+        row = gtk_widget_get_first_child (priv->language_list);
+        while (row) {
+                LanguageWidget *widget;
+                GtkWidget *child;
+                gboolean should_be_visible;
 
-        if (widget == NULL)
-                return;
+                child = gtk_list_box_row_get_child (GTK_LIST_BOX_ROW (row));
+                widget = get_language_widget (child);
 
-        locale_id = user_data;
-        should_be_visible = g_str_equal (widget->locale_id, locale_id);
-        gtk_widget_set_opacity (widget->checkmark, should_be_visible ? 1.0 : 0.0);
-}
+                if (widget == NULL)
+                        return;
 
-static void
-sync_all_checkmarks (CcLanguageChooser *chooser)
-{
-        CcLanguageChooserPrivate *priv = cc_language_chooser_get_instance_private (chooser);
+                should_be_visible = g_str_equal (widget->locale_id, priv->language);
+                gtk_widget_set_opacity (widget->checkmark, should_be_visible ? 1.0 : 0.0);
 
-        gtk_container_foreach (GTK_CONTAINER (priv->language_list),
-                               sync_checkmark, priv->language);
+                row = gtk_widget_get_next_sibling (row);
+        }
 }
 
 static GtkWidget *
@@ -223,14 +218,18 @@ more_widget_new (void)
         GtkWidget *widget;
         GtkWidget *arrow;
 
-        widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
+        widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
         gtk_widget_set_tooltip_text (widget, _("Moreā€¦"));
 
-        arrow = gtk_image_new_from_icon_name ("view-more-symbolic", GTK_ICON_SIZE_MENU);
+        arrow = g_object_new (GTK_TYPE_IMAGE,
+                              "icon-name", "view-more-symbolic",
+                              "hexpand", TRUE,
+                              "halign", GTK_ALIGN_CENTER,
+                              NULL);
         gtk_style_context_add_class (gtk_widget_get_style_context (arrow), "dim-label");
-        gtk_widget_set_margin_top (widget, 10);
-        gtk_widget_set_margin_bottom (widget, 10);
-        gtk_box_pack_start (GTK_BOX (widget), arrow, TRUE, TRUE, 0);
+        gtk_widget_set_margin_top (widget, 12);
+        gtk_widget_set_margin_bottom (widget, 12);
+        gtk_box_append (GTK_BOX (widget), arrow);
 
         return widget;
 }
@@ -242,7 +241,7 @@ no_results_widget_new (void)
 
         widget = padded_label_new (_("No languages found"));
         gtk_widget_set_sensitive (widget, FALSE);
-        gtk_widget_show_all (widget);
+
         return widget;
 }
 
@@ -260,7 +259,7 @@ add_one_language (CcLanguageChooser *chooser,
 
        widget = language_widget_new (locale_id, !is_initial);
         if (widget)
-                gtk_container_add (GTK_CONTAINER (priv->language_list), widget);
+                gtk_list_box_append (GTK_LIST_BOX (priv->language_list), widget);
 }
 
 static void
@@ -287,10 +286,8 @@ add_languages (CcLanguageChooser  *chooser,
                         add_one_language (chooser, locale_id, FALSE);
         }
 
-        gtk_container_add (GTK_CONTAINER (priv->language_list), priv->more_item);
+        gtk_list_box_append (GTK_LIST_BOX (priv->language_list), priv->more_item);
         gtk_list_box_set_placeholder (GTK_LIST_BOX (priv->language_list), priv->no_results);
-
-        gtk_widget_show_all (priv->language_list);
 }
 
 static void
@@ -315,7 +312,7 @@ language_visible (GtkListBoxRow *row,
         GtkWidget *child;
         const char *search_term;
 
-        child = gtk_bin_get_child (GTK_BIN (row));
+        child = gtk_list_box_row_get_child (row);
         if (child == priv->more_item)
                 return !priv->showing_extra;
 
@@ -324,7 +321,7 @@ language_visible (GtkListBoxRow *row,
         if (!priv->showing_extra && widget->is_extra)
                 return FALSE;
 
-        search_term = gtk_entry_get_text (GTK_ENTRY (priv->filter_entry));
+        search_term = gtk_editable_get_text (GTK_EDITABLE (priv->filter_entry));
         if (!search_term || !*search_term)
                 return TRUE;
 
@@ -354,8 +351,8 @@ sort_languages (GtkListBoxRow *a,
         LanguageWidget *la, *lb;
         int ret;
 
-        la = get_language_widget (gtk_bin_get_child (GTK_BIN (a)));
-        lb = get_language_widget (gtk_bin_get_child (GTK_BIN (b)));
+        la = get_language_widget (gtk_list_box_row_get_child (a));
+        lb = get_language_widget (gtk_list_box_row_get_child (b));
 
         if (la == NULL)
                 return 1;
@@ -389,12 +386,8 @@ show_more (CcLanguageChooser *chooser)
 {
         CcLanguageChooserPrivate *priv = cc_language_chooser_get_instance_private (chooser);
 
-        gtk_widget_show (priv->filter_entry);
         gtk_widget_grab_focus (priv->filter_entry);
 
-       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window),
-                                       GTK_POLICY_NEVER,
-                                       GTK_POLICY_AUTOMATIC);
        gtk_widget_set_valign (GTK_WIDGET (chooser), GTK_ALIGN_FILL);
 
         priv->showing_extra = TRUE;
@@ -441,7 +434,7 @@ row_activated (GtkListBox        *box,
         if (row == NULL)
                 return;
 
-        child = gtk_bin_get_child (GTK_BIN (row));
+        child = gtk_list_box_row_get_child (row);
         if (child == priv->more_item) {
                 show_more (chooser);
         } else {
@@ -455,23 +448,6 @@ row_activated (GtkListBox        *box,
         }
 }
 
-static void
-update_header_func (GtkListBoxRow *child,
-                    GtkListBoxRow *before,
-                    gpointer       user_data)
-{
-        GtkWidget *header;
-
-        if (before == NULL) {
-                gtk_list_box_row_set_header (child, NULL);
-                return;
-        }
-
-        header = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
-        gtk_list_box_row_set_header (child, header);
-        gtk_widget_show (header);
-}
-
 static void
 cc_language_chooser_constructed (GObject *object)
 {
@@ -487,8 +463,6 @@ cc_language_chooser_constructed (GObject *object)
                                     sort_languages, chooser, NULL);
         gtk_list_box_set_filter_func (GTK_LIST_BOX (priv->language_list),
                                       language_visible, chooser, NULL);
-        gtk_list_box_set_header_func (GTK_LIST_BOX (priv->language_list),
-                                      update_header_func, chooser, NULL);
         gtk_list_box_set_selection_mode (GTK_LIST_BOX (priv->language_list),
                                          GTK_SELECTION_NONE);
         add_all_languages (chooser);
@@ -563,7 +537,6 @@ cc_language_chooser_class_init (CcLanguageChooserClass *klass)
 
         gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), CcLanguageChooser, 
filter_entry);
         gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), CcLanguageChooser, 
language_list);
-        gtk_widget_class_bind_template_child_private (GTK_WIDGET_CLASS (klass), CcLanguageChooser, 
scrolled_window);
 
        object_class->finalize = cc_language_chooser_finalize;
         object_class->get_property = cc_language_chooser_get_property;
@@ -599,7 +572,7 @@ void
 cc_language_chooser_clear_filter (CcLanguageChooser *chooser)
 {
         CcLanguageChooserPrivate *priv = cc_language_chooser_get_instance_private (chooser);
-        gtk_entry_set_text (GTK_ENTRY (priv->filter_entry), "");
+        gtk_editable_set_text (GTK_EDITABLE (priv->filter_entry), "");
 }
 
 const gchar *
diff --git a/gnome-initial-setup/pages/language/gis-language-page.ui 
b/gnome-initial-setup/pages/language/gis-language-page.ui
index 8f2a08cf..307360cc 100644
--- a/gnome-initial-setup/pages/language/gis-language-page.ui
+++ b/gnome-initial-setup/pages/language/gis-language-page.ui
@@ -1,43 +1,45 @@
 <?xml version="1.0"?>
 <interface>
-  <requires lib="gtk+" version="3.0"/>
   <template class="GisLanguagePage" parent="GisPage">
     <child>
-      <object class="GtkBox" id="box">
-        <property name="visible">True</property>
-        <property name="orientation">vertical</property>
-        <property name="halign">center</property>
+      <object class="AdwPreferencesPage">
         <child>
-          <object class="GtkBox">
-            <property name="visible">True</property>
-            <property name="orientation">vertical</property>
-            <property name="halign">center</property>
-            <property name="valign">center</property>
-            <property name="expand" bind-source="language_chooser" bind-property="visible" 
bind-flags="invert-boolean|sync-create"/>
+          <object class="AdwPreferencesGroup">
+
             <child>
-              <object class="GtkImage" id="logo">
-                <property name="visible" bind-source="GisLanguagePage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
-                <property name="can_focus">False</property>
-                <property name="margin_top">24</property>
-                <property name="pixel_size">96</property>
-                <property name="icon_name">start-here-symbolic</property>
+              <object class="GtkBox" id="box">
+                <property name="orientation">vertical</property>
+                <child>
+                  <object class="GtkBox">
+                    <property name="orientation">vertical</property>
+                    <property name="hexpand" bind-source="language_chooser" bind-property="visible" 
bind-flags="invert-boolean|sync-create"/>
+                    <property name="vexpand" bind-source="language_chooser" bind-property="visible" 
bind-flags="invert-boolean|sync-create"/>
+                    <child>
+                      <object class="GtkImage" id="logo">
+                        <property name="visible" bind-source="GisLanguagePage" bind-property="small-screen" 
bind-flags="invert-boolean|sync-create"/>
+                        <property name="margin_top">24</property>
+                        <property name="pixel_size">96</property>
+                        <property name="icon_name">start-here-symbolic</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GisWelcomeWidget" id="welcome_widget">
+                        <property name="margin_top">18</property>
+                        <property name="margin_bottom">40</property>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+                <child>
+                  <object class="CcLanguageChooser" id="language_chooser">
+                    <property name="margin_bottom">18</property>
+                    <property name="width_request">400</property>
+                    <property name="valign">start</property>
+                  </object>
+                </child>
               </object>
             </child>
-            <child>
-              <object class="GisWelcomeWidget" id="welcome_widget">
-                <property name="visible">True</property>
-                <property name="margin_top">18</property>
-                <property name="margin_bottom">40</property>
-              </object>
-            </child>
-          </object>
-        </child>
-        <child>
-          <object class="CcLanguageChooser" id="language_chooser">
-            <property name="margin_bottom">18</property>
-            <property name="width_request">400</property>
-            <property name="visible">True</property>
-            <property name="valign">start</property>
+
           </object>
         </child>
       </object>
diff --git a/gnome-initial-setup/pages/language/gis-welcome-widget.c 
b/gnome-initial-setup/pages/language/gis-welcome-widget.c
index a44d5665..4d58a37f 100644
--- a/gnome-initial-setup/pages/language/gis-welcome-widget.c
+++ b/gnome-initial-setup/pages/language/gis-welcome-widget.c
@@ -30,7 +30,7 @@
 
 struct _GisWelcomeWidgetPrivate
 {
-  GtkWidget *stack;
+  AdwCarousel *carousel;
   GHashTable *translation_widgets;  /* (element-type owned utf8 unowned GtkWidget) (owned) */
 
   guint timeout_id;
@@ -39,34 +39,30 @@ typedef struct _GisWelcomeWidgetPrivate GisWelcomeWidgetPrivate;
 
 #define TIMEOUT 5
 
-G_DEFINE_TYPE_WITH_PRIVATE (GisWelcomeWidget, gis_welcome_widget, GTK_TYPE_BIN);
+G_DEFINE_TYPE_WITH_PRIVATE (GisWelcomeWidget, gis_welcome_widget, ADW_TYPE_BIN);
 
 static gboolean
 advance_stack (gpointer user_data)
 {
   GisWelcomeWidget *widget = user_data;
   GisWelcomeWidgetPrivate *priv = gis_welcome_widget_get_instance_private (widget);
-  GList *children, *l;
+  GtkWidget *child;
+  unsigned int next_page;
+  unsigned int n_pages;
+  double current_page;
 
-  children = gtk_container_get_children (GTK_CONTAINER (priv->stack));
-  if (children == NULL)
+  n_pages = adw_carousel_get_n_pages (priv->carousel);
+  if (n_pages == 0)
     goto out;
 
-  for (l = children; l != NULL; l = l->next)
-    {
-      if (l->data == gtk_stack_get_visible_child (GTK_STACK (priv->stack)))
-        break;
-    }
-
-  /* wrap around */
-  if (l->next)
-    l = l->next;
-  else
-    l = children;
+  current_page = ceil (adw_carousel_get_position (priv->carousel));
+  next_page = ((int) current_page + 1) % n_pages;
 
-  gtk_stack_set_visible_child (GTK_STACK (priv->stack), l->data);
+  child = gtk_widget_get_first_child (GTK_WIDGET (priv->carousel));
+  while (next_page-- > 0)
+    child = gtk_widget_get_next_sibling (child);
 
-  g_list_free (children);
+  adw_carousel_scroll_to (priv->carousel, child, TRUE);
 
  out:
   return G_SOURCE_CONTINUE;
@@ -152,7 +148,7 @@ big_label (const char *text)
 }
 
 static void
-fill_stack (GisWelcomeWidget *widget)
+fill_carousel (GisWelcomeWidget *widget)
 {
   GisWelcomeWidgetPrivate *priv = gis_welcome_widget_get_instance_private (widget);
   g_autoptr(GHashTable) initial = cc_common_language_get_initial_languages ();
@@ -176,8 +172,7 @@ fill_stack (GisWelcomeWidget *widget)
       label = g_hash_table_lookup (added_translations, text);
       if (label == NULL) {
         label = big_label (text);
-        gtk_container_add (GTK_CONTAINER (priv->stack), label);
-        gtk_widget_show (label);
+        adw_carousel_append (priv->carousel, label);
         g_hash_table_insert (added_translations, (gpointer) text, label);
       }
 
@@ -190,7 +185,7 @@ gis_welcome_widget_constructed (GObject *object)
 {
   G_OBJECT_CLASS (gis_welcome_widget_parent_class)->constructed (object);
 
-  fill_stack (GIS_WELCOME_WIDGET (object));
+  fill_carousel (GIS_WELCOME_WIDGET (object));
 }
 
 static void
@@ -212,7 +207,7 @@ gis_welcome_widget_class_init (GisWelcomeWidgetClass *klass)
 
   gtk_widget_class_set_template_from_resource (widget_class, 
"/org/gnome/initial-setup/gis-welcome-widget.ui");
 
-  gtk_widget_class_bind_template_child_private (widget_class, GisWelcomeWidget, stack);
+  gtk_widget_class_bind_template_child_private (widget_class, GisWelcomeWidget, carousel);
 
   object_class->constructed = gis_welcome_widget_constructed;
   object_class->dispose = gis_welcome_widget_dispose;
@@ -243,5 +238,5 @@ gis_welcome_widget_show_locale (GisWelcomeWidget *widget,
 
   label = g_hash_table_lookup (priv->translation_widgets, locale_id);
   if (label)
-    gtk_stack_set_visible_child (GTK_STACK (priv->stack), label);
+    adw_carousel_scroll_to (priv->carousel, label, FALSE);
 }
diff --git a/gnome-initial-setup/pages/language/gis-welcome-widget.h 
b/gnome-initial-setup/pages/language/gis-welcome-widget.h
index 33afe8b7..212b45f5 100644
--- a/gnome-initial-setup/pages/language/gis-welcome-widget.h
+++ b/gnome-initial-setup/pages/language/gis-welcome-widget.h
@@ -22,7 +22,7 @@
 #ifndef __GIS_WELCOME_WIDGET_H__
 #define __GIS_WELCOME_WIDGET_H__
 
-#include <gtk/gtk.h>
+#include <adwaita.h>
 
 G_BEGIN_DECLS
 
@@ -38,12 +38,12 @@ typedef struct _GisWelcomeWidgetClass   GisWelcomeWidgetClass;
 
 struct _GisWelcomeWidget
 {
-  GtkBin parent;
+  AdwBin parent;
 };
 
 struct _GisWelcomeWidgetClass
 {
-  GtkBinClass parent_class;
+  AdwBinClass parent_class;
 };
 
 GType gis_welcome_widget_get_type (void);
diff --git a/gnome-initial-setup/pages/language/gis-welcome-widget.ui 
b/gnome-initial-setup/pages/language/gis-welcome-widget.ui
index 251ad46f..f6a26df1 100644
--- a/gnome-initial-setup/pages/language/gis-welcome-widget.ui
+++ b/gnome-initial-setup/pages/language/gis-welcome-widget.ui
@@ -1,14 +1,13 @@
 <?xml version="1.0"?>
 <interface>
   <requires lib="gtk+" version="3.0"/>
-  <template class="GisWelcomeWidget" parent="GtkBin">
+  <template class="GisWelcomeWidget" parent="AdwBin">
     <property name="margin-top">10</property>
     <property name="margin-bottom">10</property>
     <child>
-      <object class="GtkStack" id="stack">
-        <property name="visible">True</property>
-        <property name="transition-type">slide-left</property>
-        <property name="transition-duration">1000</property>
+      <object class="AdwCarousel" id="carousel">
+        <property name="halign">center</property>
+        <property name="interactive">False</property>
       </object>
     </child>
   </template>
diff --git a/gnome-initial-setup/pages/language/language-chooser.ui 
b/gnome-initial-setup/pages/language/language-chooser.ui
index fc61d597..90ee096a 100644
--- a/gnome-initial-setup/pages/language/language-chooser.ui
+++ b/gnome-initial-setup/pages/language/language-chooser.ui
@@ -1,31 +1,21 @@
 <?xml version="1.0"?>
 <interface>
-  <requires lib="gtk+" version="3.0"/>
   <template class="CcLanguageChooser" parent="GtkBox">
-    <property name="visible">True</property>
     <property name="orientation">vertical</property>
-    <property name="spacing">10</property>
+    <property name="spacing">18</property>
     <child>
-      <object class="GtkScrolledWindow" id="scrolled_window">
-        <property name="visible">True</property>
-        <property name="hscrollbar-policy">never</property>
-        <property name="vscrollbar-policy">never</property>
-        <property name="shadow-type">in</property>
-        <child>
-          <object class="GtkListBox" id="language_list">
-            <property name="visible">True</property>
-            <property name="can-focus">True</property>
-            <property name="vexpand">True</property>
-            <property name="halign">fill</property>
-            <property name="valign">fill</property>
-          </object>
-        </child>
+      <object class="GtkSearchEntry" id="filter_entry">
+        <property name="hexpand">True</property>
       </object>
     </child>
     <child>
-      <object class="GtkSearchEntry" id="filter_entry">
-        <property name="visible">False</property>
-        <property name="hexpand">True</property>
+      <object class="GtkListBox" id="language_list">
+        <property name="vexpand">True</property>
+        <property name="halign">fill</property>
+        <property name="valign">start</property>
+        <style>
+          <class name="boxed-list" />
+        </style>
       </object>
     </child>
   </template>
diff --git a/gnome-initial-setup/pages/meson.build b/gnome-initial-setup/pages/meson.build
index 194117f4..15fdf392 100644
--- a/gnome-initial-setup/pages/meson.build
+++ b/gnome-initial-setup/pages/meson.build
@@ -1,6 +1,6 @@
 pages = [
    #'account',
-   #'language',
+   'language',
    #'keyboard',
    #'network',
    #'timezone',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]