[ease/themes] [editor] Propertly recognize edited text.
- From: Nate Stedman <natesm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ease/themes] [editor] Propertly recognize edited text.
- Date: Wed, 21 Jul 2010 23:13:44 +0000 (UTC)
commit 95d3929b33fb1c4703a04d3b6a35f710e2945eca
Author: Nate Stedman <natesm gmail com>
Date: Wed Jul 21 19:12:37 2010 -0400
[editor] Propertly recognize edited text.
- Text that has not been edited restores the default message
- Text that has been edited sets has_been_edited to "true"
src/ease-text-actor.vala | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/ease-text-actor.vala b/src/ease-text-actor.vala
index be4e18f..ebc740f 100644
--- a/src/ease-text-actor.vala
+++ b/src/ease-text-actor.vala
@@ -114,6 +114,16 @@ public class Ease.TextActor : Actor
text.activatable = false;
text.text_changed.disconnect(text_changed);
text.activate.disconnect(text_activate);
+
+ // if the text has not been edited, restore default text
+ if (text.text == "" && !element.has_been_edited)
+ {
+ text.text = DEFAULT_TEXT;
+ }
+ else // otherwise, the element has been edited
+ {
+ element.has_been_edited = true;
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]