background: Connect signals in swapped form

This commit is contained in:
Robert Ancell 2019-11-20 14:41:30 +13:00 committed by Robert Ancell
parent 23db1e9933
commit 4b0d47eaa4
4 changed files with 10 additions and 13 deletions

View file

@ -203,17 +203,15 @@ set_background (CcBackgroundPanel *panel,
static void
on_chooser_background_chosen_cb (CcBackgroundChooser *chooser,
CcBackgroundItem *item,
CcBackgroundPanel *self)
on_chooser_background_chosen_cb (CcBackgroundPanel *self,
CcBackgroundItem *item)
{
set_background (self, self->settings, item);
set_background (self, self->lock_settings, item);
}
static void
on_add_picture_button_clicked_cb (GtkWidget *button,
CcBackgroundPanel *self)
on_add_picture_button_clicked_cb (CcBackgroundPanel *self)
{
cc_background_chooser_select_file (self->background_chooser);
}

View file

@ -42,7 +42,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="expand">True</property>
<signal name="background-chosen" handler="on_chooser_background_chosen_cb" object="CcBackgroundPanel" swapped="no" />
<signal name="background-chosen" handler="on_chooser_background_chosen_cb" object="CcBackgroundPanel" swapped="yes" />
</object>
</child>
</object>
@ -53,6 +53,6 @@
<object class="GtkButton" id="add_picture_button">
<property name="visible">True</property>
<property name="label" translatable="yes">Add Picture…</property>
<signal name="clicked" handler="on_add_picture_button_clicked_cb" object="CcBackgroundPanel" swapped="no" />
<signal name="clicked" handler="on_add_picture_button_clicked_cb" object="CcBackgroundPanel" swapped="yes" />
</object>
</interface>

View file

@ -151,9 +151,8 @@ stop_monitor_time (CcBackgroundPreview *self)
/* Callbacks */
static gboolean
on_preview_draw_cb (GtkWidget *widget,
cairo_t *cr,
CcBackgroundPreview *self)
on_preview_draw_cb (CcBackgroundPreview *self,
cairo_t *cr)
{
g_autoptr(GdkPixbuf) pixbuf = NULL;
GtkAllocation allocation;
@ -162,8 +161,8 @@ on_preview_draw_cb (GtkWidget *widget,
if (!self->item)
return FALSE;
scale_factor = gtk_widget_get_scale_factor (widget);
gtk_widget_get_allocation (widget, &allocation);
scale_factor = gtk_widget_get_scale_factor (self->drawing_area);
gtk_widget_get_allocation (self->drawing_area, &allocation);
pixbuf = cc_background_item_get_frame_thumbnail (self->item,
self->thumbnail_factory,
allocation.width,

View file

@ -22,7 +22,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="expand">True</property>
<signal name="draw" handler="on_preview_draw_cb" object="CcBackgroundPreview" swapped="no" />
<signal name="draw" handler="on_preview_draw_cb" object="CcBackgroundPreview" swapped="yes" />
</object>
</child>