[cheese] Add touch event handler for selecting effects
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] Add touch event handler for selecting effects
- Date: Mon, 1 Jul 2013 19:20:14 +0000 (UTC)
commit c4dec268505e2d8dac7fe18ffd8fbc48602be1c5
Author: David King <amigadave amigadave com>
Date: Mon Jul 1 19:28:59 2013 +0100
Add touch event handler for selecting effects
Use a ClutterTapAction on each effect to allow either a mouse click or a
touch tap to select effects. Depend on Clutter 1.13.2 for
ClutterTapAction. Fixes bug 692745.
configure.ac | 2 +-
src/cheese-window.vala | 15 +++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 06b278e..22fbb09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,7 @@ GSTREAMER_PLUGINS_BAD_REQUIRED="gstreamer-plugins-bad-1.0 >= $GSTREAMER_PLUGINS_
CAIRO_REQUIRED="cairo >= 1.10.0"
PANGOCAIRO_REQUIRED="pangocairo >= 1.28.0"
LIBRSVG_REQUIRED="librsvg-2.0 >= 2.32.0"
-CLUTTER_REQUIRED="clutter-1.0 >= 1.12.0"
+CLUTTER_REQUIRED="clutter-1.0 >= 1.13.2"
CLUTTERGTK_REQUIRED="clutter-gtk-1.0 >= 0.91.8"
CLUTTERGST_REQUIRED="clutter-gst-2.0 >= 1.9.0"
LIBCANBERRA_REQUIRED="libcanberra-gtk3 >= 0.26"
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index cf52e4a..9af8650 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -913,12 +913,11 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
/**
* Change the selected effect, as a new one was selected.
*
- * @param source unused
- * @param event unused
- * @return false, to allow further event processing
+ * @param tap unused
+ * @param source the actor (with associated effect) that was selected
*/
- public bool on_selected_effect_change (Clutter.Actor source,
- Clutter.ButtonEvent event)
+ public void on_selected_effect_change (Clutter.TapAction tap,
+ Clutter.Actor source)
{
/* Disable the effects selector after selecting an effect. */
effects_toggle_button.set_active (false);
@@ -926,7 +925,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
selected_effect = source.get_data ("effect");
camera.set_effect (selected_effect);
settings.set_string ("selected-effect", selected_effect.name);
- return false;
}
/**
@@ -1093,11 +1091,12 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
texture.keep_aspect_ratio = true;
box.add_child (texture);
box.reactive = true;
+ var tap = new Clutter.TapAction ();
+ box.add_action (tap);
+ tap.tap.connect (on_selected_effect_change);
box.set_data ("effect", effect);
effect.set_data ("texture", texture);
- box.button_release_event.connect (on_selected_effect_change);
-
text.text = effect.name;
text.color = Clutter.Color.from_string ("white");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]