[cheese/three-point-oh] Added text overlay to effects with their names on it
- From: Yuvaraj Pandian <yuvipanda src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/three-point-oh] Added text overlay to effects with their names on it
- Date: Fri, 16 Jul 2010 19:58:00 +0000 (UTC)
commit 8b0fd0c75afb0540e946bda2caf3bbf310e4d451
Author: Yuvaraj Pandian T <yuvipanda gmail com>
Date: Sat Jul 17 01:27:33 2010 +0530
Added text overlay to effects with their names on it
src/cheese-window.vala | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index 8a5ce4e..a727624 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -744,16 +744,33 @@ public class Cheese.MainWindow : Gtk.Window
camera.stop ();
for (int i = 0; i < effects_manager.effects.size - 1; i++)
{
- Effect effect = effects_manager.effects[i];
- Clutter.Texture texture = new Clutter.Texture ();
- texture.width = 160;
- texture.height = 120;
+ Effect effect = effects_manager.effects[i];
+ Clutter.Texture texture = new Clutter.Texture ();
+ Clutter.BinLayout layout = new Clutter.BinLayout (Clutter.BinAlignment.FILL,
+ Clutter.BinAlignment.FILL);
+ Clutter.Box box = new Clutter.Box (layout);
+ Clutter.Text text = new Clutter.Text ();
+
+ box.width = 160;
+ box.height = 120;
Mx.Button button = new Mx.Button ();
- button.add ((Clutter.Actor)texture);
+ button.add ((Clutter.Actor)box);
+
+ box.pack ((Clutter.Actor)texture,
+ "x-align", Clutter.BinAlignment.FILL,
+ "y-align", Clutter.BinAlignment.FILL, null
+ );
button.set_data ("effect", effect);
button.clicked.connect (on_selected_effect_change);
+ text.text = effect.name;
+ text.color = Clutter.Color.from_string ("white");
+ box.pack ((Clutter.Actor)text,
+ "x-align", Clutter.BinAlignment.CENTER,
+ "y-align", Clutter.BinAlignment.END, null
+ );
+
effects_grids[i / EFFECTS_PER_PAGE].add ((Clutter.Actor)button);
camera.connect_effect_texture (effect, texture);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]