iconbrowser: Remove GtkEventBox usage

This commit is contained in:
Benjamin Otte 2017-08-02 14:50:19 +01:00
parent 5be94c1fd7
commit b555638600
2 changed files with 19 additions and 47 deletions

View File

@ -92,7 +92,7 @@ set_image (GtkWidget *image, const gchar *name, gint size)
gtk_image_set_from_icon_name (GTK_IMAGE (image), name, 1);
gtk_image_set_pixel_size (GTK_IMAGE (image), size);
pixbuf = get_icon (image, name, size);
gtk_drag_source_set_icon_pixbuf (gtk_widget_get_parent (image), pixbuf);
gtk_drag_source_set_icon_pixbuf (image, pixbuf);
g_object_unref (pixbuf);
}
@ -383,12 +383,9 @@ get_image_data (GtkWidget *widget,
static void
setup_image_dnd (GtkWidget *image)
{
GtkWidget *parent;
parent = gtk_widget_get_parent (image);
gtk_drag_source_set (parent, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
gtk_drag_source_add_image_targets (parent);
g_signal_connect (parent, "drag-data-get", G_CALLBACK (get_image_data), NULL);
gtk_drag_source_set (image, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY);
gtk_drag_source_add_image_targets (image);
g_signal_connect (image, "drag-data-get", G_CALLBACK (get_image_data), NULL);
}
static void

View File

@ -151,15 +151,10 @@
<property name="row-spacing">18</property>
<property name="column-spacing">18</property>
<child>
<object class="GtkEventBox">
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
<packing>
<property name="left-attach">0</property>
@ -167,15 +162,10 @@
</packing>
</child>
<child>
<object class="GtkEventBox">
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<child>
<object class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
<packing>
<property name="left-attach">1</property>
@ -183,15 +173,10 @@
</packing>
</child>
<child>
<object class="GtkEventBox">
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<child>
<object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
<packing>
<property name="left-attach">2</property>
@ -199,15 +184,10 @@
</packing>
</child>
<child>
<object class="GtkEventBox">
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<child>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
<packing>
<property name="left-attach">3</property>
@ -215,15 +195,10 @@
</packing>
</child>
<child>
<object class="GtkEventBox">
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<child>
<object class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
</child>
<property name="halign">center</property>
<property name="valign">end</property>
</object>
<packing>
<property name="left-attach">4</property>