[gnome-control-center] background: Connect signals in swapped form
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] background: Connect signals in swapped form
- Date: Mon, 30 Mar 2020 02:10:30 +0000 (UTC)
commit 4b0d47eaa4401e35ae81ae0db88a519b8d76f740
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Nov 20 14:41:30 2019 +1300
background: Connect signals in swapped form
panels/background/cc-background-panel.c | 8 +++-----
panels/background/cc-background-panel.ui | 4 ++--
panels/background/cc-background-preview.c | 9 ++++-----
panels/background/cc-background-preview.ui | 2 +-
4 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index fe44f227d..926239dbc 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -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);
}
diff --git a/panels/background/cc-background-panel.ui b/panels/background/cc-background-panel.ui
index 946974b78..e418d1ae0 100644
--- a/panels/background/cc-background-panel.ui
+++ b/panels/background/cc-background-panel.ui
@@ -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>
diff --git a/panels/background/cc-background-preview.c b/panels/background/cc-background-preview.c
index 1f2e682a0..fa2bc90f8 100644
--- a/panels/background/cc-background-preview.c
+++ b/panels/background/cc-background-preview.c
@@ -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,
diff --git a/panels/background/cc-background-preview.ui b/panels/background/cc-background-preview.ui
index da1f23943..0906847e1 100644
--- a/panels/background/cc-background-preview.ui
+++ b/panels/background/cc-background-preview.ui
@@ -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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]