[sysprof/wip/gtk4-port: 89/132] libsysprof-ui: port a number of properties to GTK 4




commit 4f03d45556c521e7772e7ba1e50ffe68af33b516
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 1 11:37:02 2021 -0700

    libsysprof-ui: port a number of properties to GTK 4

 src/libsysprof-ui/sysprof-aid-icon.ui              | 35 ++-------
 src/libsysprof-ui/sysprof-details-page.ui          |  5 +-
 src/libsysprof-ui/sysprof-environ-editor.c         |  5 +-
 src/libsysprof-ui/sysprof-marks-page.ui            |  5 +-
 src/libsysprof-ui/sysprof-memprof-page.ui          |  5 +-
 src/libsysprof-ui/sysprof-process-model-row.ui     |  5 +-
 src/libsysprof-ui/sysprof-profiler-assistant.c     |  7 ++
 src/libsysprof-ui/sysprof-profiler-assistant.ui    | 91 +++++++++++-----------
 .../sysprof-visualizer-group-header.c              |  5 +-
 9 files changed, 82 insertions(+), 81 deletions(-)
---
diff --git a/src/libsysprof-ui/sysprof-aid-icon.ui b/src/libsysprof-ui/sysprof-aid-icon.ui
index 1a430846..f16b6ba0 100644
--- a/src/libsysprof-ui/sysprof-aid-icon.ui
+++ b/src/libsysprof-ui/sysprof-aid-icon.ui
@@ -1,32 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.22.0 -->
 <interface>
-  <requires lib="gtk+" version="3.12"/>
+  <requires lib="gtk" version="4.0"/>
   <template class="SysprofAidIcon" parent="GtkFlowBoxChild">
-    <property name="can_focus">False</property>
-    <child>
+    <property name="child">
       <object class="GtkBox">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">6</property>
         <child>
           <object class="GtkOverlay">
             <property name="halign">center</property>
-            <property name="visible">true</property>
-            <child>
+            <property name="child">
               <object class="GtkImage" id="image">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="pixel_size">64</property>
                 <property name="width-request">92</property>
                 <property name="icon_name">org.gnome.Sysprof-symbolic</property>
               </object>
-            </child>
+            </property>
             <child type="overlay">
               <object class="GtkImage" id="check">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
                 <property name="pixel_size">16</property>
                 <property name="icon_name">object-select-symbolic</property>
                 <property name="halign">end</property>
@@ -34,29 +25,17 @@
               </object>
             </child>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="use_underline">True</property>
+            <property name="use_underline">1</property>
             <property name="justify">center</property>
-            <property name="wrap">True</property>
+            <property name="wrap">1</property>
             <property name="mnemonic_widget">SysprofAidIcon</property>
             <property name="max_width_chars">12</property>
           </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
         </child>
       </object>
-    </child>
+    </property>
   </template>
 </interface>
diff --git a/src/libsysprof-ui/sysprof-details-page.ui b/src/libsysprof-ui/sysprof-details-page.ui
index 2e803b22..66e8f86b 100644
--- a/src/libsysprof-ui/sysprof-details-page.ui
+++ b/src/libsysprof-ui/sysprof-details-page.ui
@@ -9,7 +9,10 @@
         <property name="visible">true</property>
         <child>
           <object class="EggThreeGrid" id="three_grid">
-            <property name="margin">36</property>
+            <property name="margin-start">36</property>
+            <property name="margin-end">36</property>
+            <property name="margin-top">36</property>
+            <property name="margin-bottom">36</property>
             <property name="column-spacing">12</property>
             <property name="row-spacing">6</property>
             <property name="visible">true</property>
diff --git a/src/libsysprof-ui/sysprof-environ-editor.c b/src/libsysprof-ui/sysprof-environ-editor.c
index 9776a537..96f70166 100644
--- a/src/libsysprof-ui/sysprof-environ-editor.c
+++ b/src/libsysprof-ui/sysprof-environ-editor.c
@@ -70,7 +70,10 @@ sysprof_environ_editor_create_dummy_row (SysprofEnvironEditor *self)
 
   label = g_object_new (GTK_TYPE_LABEL,
                         "label", _("New variable…"),
-                        "margin", 6,
+                        "margin-start", 6,
+                        "margin-end", 6,
+                        "margin-top", 6,
+                        "margin-bottom", 6,
                         "visible", TRUE,
                         "xalign", 0.0f,
                         NULL);
diff --git a/src/libsysprof-ui/sysprof-marks-page.ui b/src/libsysprof-ui/sysprof-marks-page.ui
index 131079d0..0697c835 100644
--- a/src/libsysprof-ui/sysprof-marks-page.ui
+++ b/src/libsysprof-ui/sysprof-marks-page.ui
@@ -12,7 +12,10 @@
             <child>
               <object class="GtkBox" id="details_box">
                 <property name="orientation">vertical</property>
-                <property name="margin">6</property>
+                <property name="margin-top">6</property>
+                <property name="margin-bottom">6</property>
+                <property name="margin-start">6</property>
+                <property name="margin-end">6</property>
                 <property name="visible">true</property>
                 <child>
                   <object class="GtkLabel">
diff --git a/src/libsysprof-ui/sysprof-memprof-page.ui b/src/libsysprof-ui/sysprof-memprof-page.ui
index f17f38d6..08cb8758 100644
--- a/src/libsysprof-ui/sysprof-memprof-page.ui
+++ b/src/libsysprof-ui/sysprof-memprof-page.ui
@@ -72,7 +72,10 @@
                 <property name="visible">true</property>
                 <child>
                   <object class="GtkBox">
-                    <property name="margin">16</property>
+                    <property name="margin-top">16</property>
+                    <property name="margin-bottom">16</property>
+                    <property name="margin-start">16</property>
+                    <property name="margin-end">16</property>
                     <property name="orientation">vertical</property>
                     <property name="visible">true</property>
                     <child>
diff --git a/src/libsysprof-ui/sysprof-process-model-row.ui b/src/libsysprof-ui/sysprof-process-model-row.ui
index 53ed2841..721c26fe 100644
--- a/src/libsysprof-ui/sysprof-process-model-row.ui
+++ b/src/libsysprof-ui/sysprof-process-model-row.ui
@@ -4,7 +4,10 @@
     <child>
       <object class="GtkBox">
         <property name="visible">true</property>
-        <property name="margin">6</property>
+        <property name="margin-start">6</property>
+        <property name="margin-end">6</property>
+        <property name="margin-top">6</property>
+        <property name="margin-bottom">6</property>
         <property name="spacing">6</property>
         <child>
           <object class="GtkImage" id="image">
diff --git a/src/libsysprof-ui/sysprof-profiler-assistant.c b/src/libsysprof-ui/sysprof-profiler-assistant.c
index 7a989bdd..28827544 100644
--- a/src/libsysprof-ui/sysprof-profiler-assistant.c
+++ b/src/libsysprof-ui/sysprof-profiler-assistant.c
@@ -24,6 +24,8 @@
 
 #include <sysprof.h>
 
+#include "egg-three-grid.h"
+
 #include "sysprof-platform.h"
 
 #include "sysprof-aid-icon.h"
@@ -61,6 +63,7 @@ struct _SysprofProfilerAssistant
   GtkSwitch            *whole_system_switch;
   GtkSwitch            *launch_switch;
   GtkSwitch            *inherit_switch;
+  GtkWidget            *scroller;
 };
 
 enum {
@@ -352,6 +355,7 @@ sysprof_profiler_assistant_dispose (GObject *object)
   SysprofProfilerAssistant *self = (SysprofProfilerAssistant *)object;
 
   g_clear_object (&self->process_model);
+  g_clear_pointer (&self->scroller, gtk_widget_unparent);
 
   G_OBJECT_CLASS (sysprof_profiler_assistant_parent_class)->dispose (object);
 }
@@ -392,6 +396,9 @@ sysprof_profiler_assistant_class_init (SysprofProfilerAssistantClass *klass)
   gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, launch_switch);
   gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, inherit_switch);
   gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, search_entry);
+  gtk_widget_class_bind_template_child (widget_class, SysprofProfilerAssistant, scroller);
+
+  g_type_ensure (EGG_TYPE_THREE_GRID);
 
   g_type_ensure (SYSPROF_TYPE_AID_ICON);
   g_type_ensure (SYSPROF_TYPE_BATTERY_AID);
diff --git a/src/libsysprof-ui/sysprof-profiler-assistant.ui b/src/libsysprof-ui/sysprof-profiler-assistant.ui
index 0f0b59b0..5ad2c4dc 100644
--- a/src/libsysprof-ui/sysprof-profiler-assistant.ui
+++ b/src/libsysprof-ui/sysprof-profiler-assistant.ui
@@ -63,19 +63,22 @@
   </object>
   <template class="SysprofProfilerAssistant" parent="GtkWidget">
     <child>
-      <object class="GtkScrolledWindow">
+      <object class="GtkScrolledWindow" id="scroller">
         <property name="propagate-natural-width">true</property>
         <property name="propagate-natural-height">true</property>
         <property name="hscrollbar-policy">never</property>
         <property name="visible">true</property>
         <child>
           <object class="GtkBox">
-            <property name="margin">36</property>
+            <property name="margin-top">36</property>
+            <property name="margin-bottom">36</property>
+            <property name="margin-start">36</property>
+            <property name="margin-end">36</property>
             <property name="spacing">12</property>
             <property name="orientation">vertical</property>
             <property name="visible">true</property>
             <child>
-              <object class="DzlThreeGrid" id="three_grid">
+              <object class="EggThreeGrid" id="three_grid">
                 <property name="column-spacing">12</property>
                 <property name="row-spacing">6</property>
                 <property name="visible">true</property>
@@ -198,11 +201,11 @@
                         </child>
                       </object>
                     </child>
+                    <layout>
+                      <property name="column">center</property>
+                      <property name="row">5</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">center</property>
-                    <property name="row">5</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="label1">
@@ -212,11 +215,11 @@
                     <style>
                       <class name="dim-label"/>
                     </style>
+                    <layout>
+                      <property name="column">left</property>
+                      <property name="row">0</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">left</property>
-                    <property name="row">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkSwitch" id="whole_system_switch">
@@ -224,11 +227,11 @@
                     <property name="halign">start</property>
                     <property name="valign">center</property>
                     <property name="visible">true</property>
+                    <layout>
+                      <property name="column">center</property>
+                      <property name="row">0</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">center</property>
-                    <property name="row">0</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkBox">
@@ -270,7 +273,6 @@
                             </child>
                             <child>
                               <object class="GtkScrolledWindow">
-                                <property name="shadow-type">in</property>
                                 <property name="hscrollbar-policy">never</property>
                                 <property name="min-content-height">175</property>
                                 <property name="max-content-height">175</property>
@@ -281,8 +283,8 @@
                                     <property name="visible">true</property>
                                     <child type="placeholder">
                                       <object class="GtkLabel">
-                                        <property name="margin-left">12</property>
-                                        <property name="margin-right">12</property>
+                                        <property name="margin-start">12</property>
+                                        <property name="margin-end">12</property>
                                         <property name="label" translatable="yes">Loading 
Processes…</property>
                                         <property name="valign">center</property>
                                         <property name="visible">true</property>
@@ -299,11 +301,11 @@
                         </child>
                       </object>
                     </child>
+                    <layout>
+                      <property name="column">center</property>
+                      <property name="row">1</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">center</property>
-                    <property name="row">1</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="label2">
@@ -314,11 +316,11 @@
                     <style>
                       <class name="dim-label"/>
                     </style>
+                    <layout>
+                      <property name="column">left</property>
+                      <property name="row">2</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">left</property>
-                    <property name="row">2</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkBox">
@@ -398,7 +400,6 @@
                             </child>
                             <child>
                               <object class="GtkFrame">
-                                <property name="shadow-type">in</property>
                                 <property name="visible">true</property>
                                 <child>
                                   <object class="SysprofEnvironEditor" id="environ_editor">
@@ -451,11 +452,11 @@
                         </child>
                       </object>
                     </child>
+                    <layout>
+                      <property name="column">center</property>
+                      <property name="row">2</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">center</property>
-                    <property name="row">2</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkLabel" id="label3">
@@ -466,11 +467,11 @@
                     <style>
                       <class name="dim-label"/>
                     </style>
+                    <layout>
+                      <property name="column">left</property>
+                      <property name="row">3</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">left</property>
-                    <property name="row">3</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkBox">
@@ -500,11 +501,11 @@
                         </style>
                       </object>
                     </child>
+                    <layout>
+                      <property name="column">center</property>
+                      <property name="row">3</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">center</property>
-                    <property name="row">3</property>
-                  </packing>
                 </child>
                 <child>
                   <object class="GtkButton" id="record_button">
@@ -518,17 +519,13 @@
                     <style>
                       <class name="suggested-action"/>
                     </style>
+                    <layout>
+                      <property name="column">center</property>
+                      <property name="row">4</property>
+                    </layout>
                   </object>
-                  <packing>
-                    <property name="column">center</property>
-                    <property name="row">4</property>
-                  </packing>
                 </child>
               </object>
-              <packing>
-                <property name="pack-type">start</property>
-                <property name="position">2</property>
-              </packing>
             </child>
           </object>
         </child>
diff --git a/src/libsysprof-ui/sysprof-visualizer-group-header.c 
b/src/libsysprof-ui/sysprof-visualizer-group-header.c
index 7078ba9c..84957b89 100644
--- a/src/libsysprof-ui/sysprof-visualizer-group-header.c
+++ b/src/libsysprof-ui/sysprof-visualizer-group-header.c
@@ -109,7 +109,10 @@ _sysprof_visualizer_group_header_add_row (SysprofVisualizerGroupHeader *self,
       label = g_object_new (GTK_TYPE_LABEL,
                             "attributes", attrs,
                             "ellipsize", PANGO_ELLIPSIZE_MIDDLE,
-                            "margin", 6,
+                            "margin-top", 6,
+                            "margin-bottom", 6,
+                            "margin-start", 6,
+                            "margin-end", 6,
                             "hexpand", TRUE,
                             "label", title,
                             "visible", TRUE,


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