[gnome-control-center] ce-page-details: Do not set children for CheckBtn



commit 3a96f428caf0b5f73c198020a6b65b01a9158f3b
Author: Maximiliano Sandoval R <msandova protonmail com>
Date:   Mon Jun 6 16:25:52 2022 +0200

    ce-page-details: Do not set children for CheckBtn
    
    This widget does not support adding arbitrary children, a warning was
    issued when it was disposed for still having children.

 panels/network/connection-editor/ce-page-details.c |  4 +++-
 panels/network/connection-editor/details-page.ui   | 12 ++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/panels/network/connection-editor/ce-page-details.c 
b/panels/network/connection-editor/ce-page-details.c
index 8b726cc2e..d57a291a8 100644
--- a/panels/network/connection-editor/ce-page-details.c
+++ b/panels/network/connection-editor/ce-page-details.c
@@ -52,6 +52,7 @@ struct _CEPageDetails
         GtkLabel *mac_heading_label;
         GtkLabel *mac_label;
         GtkCheckButton *restrict_data_check;
+        GtkBox *restrict_data_check_container;
         GtkLabel *route_heading_label;
         GtkLabel *route_label;
         GtkLabel *security_heading_label;
@@ -222,7 +223,7 @@ update_restrict_data (CEPageDetails *self)
 
         gtk_check_button_set_active (GTK_CHECK_BUTTON (self->restrict_data_check),
                                      metered == NM_METERED_YES || metered == NM_METERED_GUESS_YES);
-        gtk_widget_show (GTK_WIDGET (self->restrict_data_check));
+        gtk_widget_show (GTK_WIDGET (self->restrict_data_check_container));
 
         g_signal_connect_object (self->restrict_data_check, "notify::active", G_CALLBACK 
(restrict_data_changed), self, G_CONNECT_SWAPPED);
         g_signal_connect_object (self->restrict_data_check, "notify::active", G_CALLBACK (ce_page_changed), 
self, G_CONNECT_SWAPPED);
@@ -529,6 +530,7 @@ ce_page_details_class_init (CEPageDetailsClass *klass)
         gtk_widget_class_bind_template_child (widget_class, CEPageDetails, mac_heading_label);
         gtk_widget_class_bind_template_child (widget_class, CEPageDetails, mac_label);
         gtk_widget_class_bind_template_child (widget_class, CEPageDetails, restrict_data_check);
+        gtk_widget_class_bind_template_child (widget_class, CEPageDetails, restrict_data_check_container);
         gtk_widget_class_bind_template_child (widget_class, CEPageDetails, route_heading_label);
         gtk_widget_class_bind_template_child (widget_class, CEPageDetails, route_label);
         gtk_widget_class_bind_template_child (widget_class, CEPageDetails, security_heading_label);
diff --git a/panels/network/connection-editor/details-page.ui 
b/panels/network/connection-editor/details-page.ui
index d3ec5611c..c8e4595ad 100644
--- a/panels/network/connection-editor/details-page.ui
+++ b/panels/network/connection-editor/details-page.ui
@@ -393,19 +393,21 @@
 
     <!-- "Restrict Data Usage" section -->
     <child>
-      <object class="GtkCheckButton" id="restrict_data_check">
-        <property name="margin_bottom">12</property>
+      <object class="GtkBox" id="restrict_data_check_container">
         <layout>
           <property name="column">0</property>
           <property name="row">13</property>
           <property name="column-span">2</property>
           <property name="row-span">1</property>
         </layout>
-
+        <child>
+          <object class="GtkCheckButton" id="restrict_data_check">
+            <property name="margin_bottom">12</property>
+          </object>
+        </child>
         <child>
           <object class="GtkBox">
             <property name="orientation">vertical</property>
-
             <child>
               <object class="GtkLabel">
                 <property name="xalign">0</property>
@@ -415,7 +417,6 @@
                 <property name="mnemonic_widget">restrict_data_check</property>
               </object>
             </child>
-
             <child>
               <object class="GtkLabel">
                 <property name="xalign">0</property>
@@ -432,7 +433,6 @@
             </child>
           </object>
         </child>
-
       </object>
     </child>
 


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