Commit a0f17eb7 authored by Jonathan Matthew's avatar Jonathan Matthew 🕳

Merge branch 'rb-rating-issue-1773' into 'master'

rating: emit 'rated' signal when rating is updated via keyboard too

Closes #1773

See merge request !49
parents f117433b b98f6196
Pipeline #220362 passed with stage
in 8 minutes and 21 seconds
......@@ -455,14 +455,27 @@ rb_rating_button_press_cb (GtkWidget *widget,
static gboolean
rb_rating_set_rating_cb (RBRating *rating, gdouble score)
{
rb_rating_set_rating (rating, score);
g_signal_emit (G_OBJECT (rating), rb_rating_signals[RATED], 0, score);
return TRUE;
}
static gboolean
rb_rating_adjust_rating_cb (RBRating *rating, gdouble adjust)
{
rb_rating_set_rating (rating, rating->priv->rating + adjust);
gdouble new_rating;
new_rating = rating->priv->rating + adjust;
/* clip to the rating range */
if (new_rating > RB_RATING_MAX_SCORE) {
new_rating = RB_RATING_MAX_SCORE;
} else if (new_rating < 0.0) {
new_rating = 0.0;
}
g_signal_emit (G_OBJECT (rating), rb_rating_signals[RATED], 0, new_rating);
return TRUE;
}
......
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