[gtk+] placesview: Remove event box usage



commit 464ffad23e95103d4f17e1f51b2b6c0b310e79cd
Author: Benjamin Otte <otte redhat com>
Date:   Wed Aug 2 12:12:58 2017 +0100

    placesview: Remove event box usage

 gtk/gtkplacesview.c           |    2 +-
 gtk/gtkplacesviewrow.c        |   10 ---
 gtk/gtkplacesviewrowprivate.h |    2 -
 gtk/ui/gtkplacesviewrow.ui    |  151 ++++++++++++++++++++---------------------
 4 files changed, 74 insertions(+), 91 deletions(-)
---
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index e526e6d..9599bbe 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -671,7 +671,7 @@ insert_row (GtkPlacesView *view,
 
   g_object_set_data (G_OBJECT (row), "is-network", GINT_TO_POINTER (is_network));
 
-  g_signal_connect_swapped (gtk_places_view_row_get_event_box (GTK_PLACES_VIEW_ROW (row)),
+  g_signal_connect_swapped (GTK_PLACES_VIEW_ROW (row),
                             "button-press-event",
                             G_CALLBACK (on_button_press_event),
                             row);
diff --git a/gtk/gtkplacesviewrow.c b/gtk/gtkplacesviewrow.c
index 61dd1f5..eb00df7 100644
--- a/gtk/gtkplacesviewrow.c
+++ b/gtk/gtkplacesviewrow.c
@@ -48,7 +48,6 @@ struct _GtkPlacesViewRow
   GtkSpinner    *busy_spinner;
   GtkButton     *eject_button;
   GtkImage      *eject_icon;
-  GtkEventBox   *event_box;
   GtkImage      *icon_image;
   GtkLabel      *name_label;
   GtkLabel      *path_label;
@@ -382,7 +381,6 @@ gtk_places_view_row_class_init (GtkPlacesViewRowClass *klass)
   gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, busy_spinner);
   gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, eject_button);
   gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, eject_icon);
-  gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, event_box);
   gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, icon_image);
   gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, name_label);
   gtk_widget_class_bind_template_child (widget_class, GtkPlacesViewRow, path_label);
@@ -436,14 +434,6 @@ gtk_places_view_row_get_eject_button (GtkPlacesViewRow *row)
   return GTK_WIDGET (row->eject_button);
 }
 
-GtkWidget*
-gtk_places_view_row_get_event_box (GtkPlacesViewRow *row)
-{
-  g_return_val_if_fail (GTK_IS_PLACES_VIEW_ROW (row), NULL);
-
-  return GTK_WIDGET (row->event_box);
-}
-
 void
 gtk_places_view_row_set_busy (GtkPlacesViewRow *row,
                               gboolean          is_busy)
diff --git a/gtk/gtkplacesviewrowprivate.h b/gtk/gtkplacesviewrowprivate.h
index 24e39d5..ad91327 100644
--- a/gtk/gtkplacesviewrowprivate.h
+++ b/gtk/gtkplacesviewrowprivate.h
@@ -38,8 +38,6 @@ GtkWidget*         gtk_places_view_row_new                       (GVolume
 
 GtkWidget*         gtk_places_view_row_get_eject_button          (GtkPlacesViewRow   *row);
 
-GtkWidget*         gtk_places_view_row_get_event_box             (GtkPlacesViewRow   *row);
-
 GMount*            gtk_places_view_row_get_mount                 (GtkPlacesViewRow   *row);
 
 GVolume*           gtk_places_view_row_get_volume                (GtkPlacesViewRow   *row);
diff --git a/gtk/ui/gtkplacesviewrow.ui b/gtk/ui/gtkplacesviewrow.ui
index 3b44e6d..69b5dfd 100644
--- a/gtk/ui/gtkplacesviewrow.ui
+++ b/gtk/ui/gtkplacesviewrow.ui
@@ -6,97 +6,92 @@
     <property name="visible">True</property>
     <property name="can-focus">True</property>
     <child>
-      <object class="GtkEventBox" id="event_box">
+      <object class="GtkBox" id="box">
         <property name="visible">1</property>
+        <property name="margin-start">12</property>
+        <property name="margin-end">12</property>
+        <property name="margin-top">6</property>
+        <property name="margin-bottom">6</property>
+        <property name="spacing">18</property>
         <child>
-          <object class="GtkBox" id="box">
+          <object class="GtkImage" id="icon_image">
             <property name="visible">1</property>
-            <property name="margin-start">12</property>
-            <property name="margin-end">12</property>
-            <property name="margin-top">6</property>
-            <property name="margin-bottom">6</property>
-            <property name="spacing">18</property>
-            <child>
-              <object class="GtkImage" id="icon_image">
-                <property name="visible">1</property>
-                <property name="pixel-size">32</property>
-              </object>
-            </child>
-            <child>
-              <object class="GtkLabel" id="name_label">
-                <property name="visible">1</property>
-                <property name="hexpand">1</property>
-                <property name="xalign">0</property>
-                <property name="ellipsize">end</property>
-              </object>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="available_space_label">
-                <property name="xalign">1</property>
-                <style>
-                  <class name="dim-label"/>
-                </style>
-              </object>
-              <packing>
-                <property name="position">2</property>
-              </packing>
-            </child>
+            <property name="pixel-size">32</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="name_label">
+            <property name="visible">1</property>
+            <property name="hexpand">1</property>
+            <property name="xalign">0</property>
+            <property name="ellipsize">end</property>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="available_space_label">
+            <property name="xalign">1</property>
+            <style>
+              <class name="dim-label"/>
+            </style>
+          </object>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="path_label">
+            <property name="visible">1</property>
+            <property name="justify">right</property>
+            <property name="ellipsize">middle</property>
+            <property name="xalign">0</property>
+            <property name="max-width-chars">15</property>
+            <style>
+              <class name="dim-label"/>
+            </style>
+          </object>
+          <packing>
+            <property name="position">3</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkStack" id="mount_stack">
+            <property name="visible">1</property>
+            <property name="hhomogeneous">1</property>
+            <property name="vhomogeneous">1</property>
             <child>
-              <object class="GtkLabel" id="path_label">
-                <property name="visible">1</property>
-                <property name="justify">right</property>
-                <property name="ellipsize">middle</property>
-                <property name="xalign">0</property>
-                <property name="max-width-chars">15</property>
+              <object class="GtkButton" id="eject_button">
+                <property name="visible">0</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="tooltip-text" translatable="yes">Unmount</property>
+                <child>
+                  <object class="GtkImage" id="eject_icon">
+                    <property name="visible">1</property>
+                    <property name="icon-name">media-eject-symbolic</property>
+                    <property name="icon-size">1</property>
+                  </object>
+                </child>
                 <style>
-                  <class name="dim-label"/>
+                  <class name="image-button"/>
+                  <class name="sidebar-button"/>
                 </style>
               </object>
-              <packing>
-                <property name="position">3</property>
-              </packing>
             </child>
             <child>
-              <object class="GtkStack" id="mount_stack">
+              <object class="GtkSpinner" id="busy_spinner">
                 <property name="visible">1</property>
-                <property name="hhomogeneous">1</property>
-                <property name="vhomogeneous">1</property>
-                <child>
-                  <object class="GtkButton" id="eject_button">
-                    <property name="visible">0</property>
-                    <property name="halign">center</property>
-                    <property name="valign">center</property>
-                    <property name="tooltip-text" translatable="yes">Unmount</property>
-                    <child>
-                      <object class="GtkImage" id="eject_icon">
-                        <property name="visible">1</property>
-                        <property name="icon-name">media-eject-symbolic</property>
-                        <property name="icon-size">1</property>
-                      </object>
-                    </child>
-                    <style>
-                      <class name="image-button"/>
-                      <class name="sidebar-button"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkSpinner" id="busy_spinner">
-                    <property name="visible">1</property>
-                    <property name="active">1</property>
-                    <property name="halign">center</property>
-                    <property name="valign">center</property>
-                  </object>
-                </child>
+                <property name="active">1</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
               </object>
-              <packing>
-                <property name="position">4</property>
-              </packing>
             </child>
           </object>
+          <packing>
+            <property name="position">4</property>
+          </packing>
         </child>
       </object>
     </child>


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