Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/rpms/sugar-toolkit/sugar-toolkit-Cursor-moves-to-beginning-while-trying-to-edit-activity-instance-name-2608.patch
blob: 045939537a9300265bd6ebec7809abddba69a9e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From patchwork Mon Feb 14 22:23:25 2011
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [sugar-toolkit] Cursor moves to beginning while trying to edit
	activity instance name #2608
Date: Tue, 15 Feb 2011 03:23:25 -0000
From: Aleksey Lim <alsroot@activitycentral.org>
X-Patchwork-Id: 665
Message-Id: <1297722205-19735-1-git-send-email-alsroot@activitycentral.org>
To: sugar-devel@lists.sugarlabs.org
Cc: dextrose@lists.sugarlabs.org

This issue is not the same as #1948 but #1948 triggers this one.
In some cases set_text doesn't change cursor position but not in all cases.

---
src/sugar/activity/widgets.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/sugar/activity/widgets.py b/src/sugar/activity/widgets.py
index a8664d9..8d34855 100644
--- a/src/sugar/activity/widgets.py
+++ b/src/sugar/activity/widgets.py
@@ -201,7 +201,9 @@ class TitleEntry(gtk.ToolItem):
         self.entry.modify_bg(state, color)
 
     def __jobject_updated_cb(self, jobject):
+        prev_pos = self.entry.props.cursor_position
         self.entry.set_text(jobject['title'])
+        self.entry.set_position(prev_pos)
 
     def __title_changed_cb(self, entry, activity):
         if self._update_title_sid is not None: