summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid King <amigadave@amigadave.com>2013-07-01 19:28:59 +0100
committerDavid King <amigadave@amigadave.com>2013-07-01 20:20:09 +0100
commitc4dec268505e2d8dac7fe18ffd8fbc48602be1c5 (patch)
tree9c8499a03969f8f02fe8ef92959d87111895f092
parentc5533cbbf5fe791fc8e652c1cdc0275afae3d8da (diff)
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.
-rw-r--r--configure.ac2
-rw-r--r--src/cheese-window.vala15
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");