Commit d03cefdf authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko Committed by Guido Gunther
Browse files

feedback-manager: Stop using deprecated signals

This will be useful when PhoshActivity stops subclassing GtkButton.
parent b53bb1ef
......@@ -56,11 +56,12 @@ on_event_triggered (LfbEvent *event,
}
static void
on_button_event_triggered (GtkButton *button,
const char* event)
static gboolean
on_button_event_triggered (const char* event)
{
phosh_trigger_feedback (event);
return GDK_EVENT_PROPAGATE;
}
......@@ -245,21 +246,21 @@ phosh_trigger_feedback (const char *name)
/**
* phosh_connect_feedback:
* @button: The button that should trigger feedback
* @widget: The widget that should trigger feedback
*
* Installs "pressed" and "released" signal handlers
* for haptic feedback.
*/
void
phosh_connect_button_feedback (GtkButton *button)
phosh_connect_feedback (GtkWidget *widget)
{
g_signal_connect (button,
"pressed",
G_CALLBACK (on_button_event_triggered),
"button-pressed");
g_signal_connect (button,
"released",
G_CALLBACK (on_button_event_triggered),
"button-released");
g_signal_connect_swapped (widget,
"button-press-event",
G_CALLBACK (on_button_event_triggered),
"button-pressed");
g_signal_connect_swapped (widget,
"button-release-event",
G_CALLBACK (on_button_event_triggered),
"button-released");
}
......@@ -23,4 +23,4 @@ const char * phosh_feedback_manager_get_icon_name (PhoshFeedbackManager
const char * phosh_feedback_manager_get_profile (PhoshFeedbackManager *self);
void phosh_feedback_manager_trigger_feedback (PhoshFeedbackManager *self, const char *event);
void phosh_trigger_feedback (const char *name);
void phosh_connect_button_feedback (GtkButton *button);
void phosh_connect_feedback (GtkWidget *widget);
......@@ -305,7 +305,7 @@ phosh_home_constructed (GObject *object)
NULL);
add_keybindings (self);
phosh_connect_button_feedback (GTK_BUTTON (self->btn_home));
phosh_connect_feedback (self->btn_home);
G_OBJECT_CLASS (phosh_home_parent_class)->constructed (object);
......
......@@ -248,7 +248,7 @@ add_activity (PhoshOverview *self, PhoshToplevel *toplevel)
g_signal_connect (activity, "size-allocate", G_CALLBACK (on_activity_size_allocated), toplevel);
g_signal_connect_swapped (activity, "notify::has-focus", G_CALLBACK (on_activity_has_focus_changed), self);
phosh_connect_button_feedback (GTK_BUTTON (activity));
phosh_connect_feedback (activity);
if (phosh_toplevel_is_activated (toplevel)) {
hdy_carousel_scroll_to (HDY_CAROUSEL (priv->carousel_running_activities), activity);
......
......@@ -294,7 +294,7 @@ phosh_panel_constructed (GObject *object)
self,
G_CONNECT_SWAPPED);
phosh_connect_button_feedback (GTK_BUTTON (priv->btn_top_panel));
phosh_connect_feedback (priv->btn_top_panel);
gtk_window_set_title (GTK_WINDOW (self), "phosh panel");
gtk_style_context_add_class (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment