[ease/encapsulate] [editor] Fix text editing.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/encapsulate] [editor] Fix text editing.
- Date: Tue, 27 Jul 2010 08:42:54 +0000 (UTC)
commit 83c9e4844dde8999addd1b94cc92d547cd7f98d8
Author: Nate Stedman <natesm gmail com>
Date: Tue Jul 27 04:42:33 2010 -0400
[editor] Fix text editing.
ease-core/ease-actor.vala | 6 +++---
ease-core/ease-text-actor.vala | 7 ++++---
src/ease-editor-embed.vala | 6 +++---
src/ease-scrollable-embed.vala | 4 ++--
4 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/ease-core/ease-actor.vala b/ease-core/ease-actor.vala
index 1df5187..7a318ee 100644
--- a/ease-core/ease-actor.vala
+++ b/ease-core/ease-actor.vala
@@ -169,7 +169,7 @@ public abstract class Ease.Actor : Clutter.Group
{
editor_rect.width = width;
editor_rect.height = height;
- }
+ }
}
/**
@@ -177,7 +177,7 @@ public abstract class Ease.Actor : Clutter.Group
*
* @param sender The { link EditorEmbed} this Actor is on.
*/
- public virtual void edit() {}
+ public virtual void edit(Gtk.Widget sender) {}
/**
* Called when the actor end editing. Subclasses with editing that is not
@@ -185,6 +185,6 @@ public abstract class Ease.Actor : Clutter.Group
*
* @param sender The { link EditorEmbed} this Actor is on.
*/
- public virtual void end_edit() {}
+ public virtual void end_edit(Gtk.Widget sender) {}
}
diff --git a/ease-core/ease-text-actor.vala b/ease-core/ease-text-actor.vala
index 8b97efa..4ef96fd 100644
--- a/ease-core/ease-text-actor.vala
+++ b/ease-core/ease-text-actor.vala
@@ -100,7 +100,7 @@ public class Ease.TextActor : Actor
/**
* { inheritDoc}
*/
- public override void edit()
+ public override void edit(Gtk.Widget sender)
{
// set text to editable
var text = contents as Clutter.Text;
@@ -112,6 +112,7 @@ public class Ease.TextActor : Actor
// grab key focus
((Clutter.Stage)get_stage()).set_key_focus(text);
+ sender.grab_focus();
// set the selection color
text.selection_color = { 255 - text.color.red,
@@ -134,14 +135,14 @@ public class Ease.TextActor : Actor
// if the text is being edited when the action is applied, stop editing
undo_action.pre_apply.connect((action) => {
- if (text.editable) end_edit();
+ if (text.editable) end_edit(sender);
});
}
/**
* { inheritDoc}
*/
- public override void end_edit()
+ public override void end_edit(Gtk.Widget sender)
{
// release key focus
((Clutter.Stage)get_stage()).set_key_focus(null);
diff --git a/src/ease-editor-embed.vala b/src/ease-editor-embed.vala
index 86ab5d0..40405f1 100644
--- a/src/ease-editor-embed.vala
+++ b/src/ease-editor-embed.vala
@@ -255,7 +255,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
if (is_editing)
{
- selected.end_edit();
+ selected.end_edit(this);
is_editing = false;
}
@@ -418,7 +418,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
if (event.click_count == 2)
{
disconnect_keys();
- (sender as Actor).edit();
+ (sender as Actor).edit(this);
is_editing = true;
return true;
}
@@ -497,7 +497,7 @@ public class Ease.EditorEmbed : ScrollableEmbed, UndoSource
// if editing another Actor, finish that edit
if (selected != null && is_editing)
{
- selected.end_edit();
+ selected.end_edit(this);
is_editing = false;
element_deselected(selected.element);
}
diff --git a/src/ease-scrollable-embed.vala b/src/ease-scrollable-embed.vala
index a9d81f4..e1e4ff1 100644
--- a/src/ease-scrollable-embed.vala
+++ b/src/ease-scrollable-embed.vala
@@ -191,9 +191,9 @@ public class Ease.ScrollableEmbed : Gtk.HBox
}
/**
- * Sets keyboard focus to this ScrollableEmbed's GtkClutter.Embed
+ * When grabbing focus, grab it on the embed.
*/
- public void key_focus()
+ public override void grab_focus()
{
embed.grab_focus();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]