Merge lp:~julien-spautz/slingshot/insert-text-in-middle into lp:~elementary-pantheon/slingshot/trunk

Proposed by Julien Spautz
Status: Merged
Merged at revision: 333
Proposed branch: lp:~julien-spautz/slingshot/insert-text-in-middle
Merge into: lp:~elementary-pantheon/slingshot/trunk
Diff against target: 27 lines (+5/-3)
2 files modified
src/Backend/DBusService.vala (+1/-1)
src/SlingshotView.vala (+4/-2)
To merge this branch: bzr merge lp:~julien-spautz/slingshot/insert-text-in-middle
Reviewer Review Type Date Requested Status
Andrea Basso (community) Approve
Review via email: mp+147798@code.launchpad.net

Description of the change

Slingshot inserts text at the end of the SearchBar, even if the cursor is in the middle. This fixes it by checking if the SearchBar has focus or not. It also seems to fix bug #1114557 where the bell rings on first keystroke, but I'm not sure why. Maybe because 'searchbar.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);' fails on an empty Gtk.Entry.

To post a comment you must log in.
Revision history for this message
Andrea Basso (voluntatefaber) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Backend/DBusService.vala'
2--- src/Backend/DBusService.vala 2012-07-18 02:43:57 +0000
3+++ src/Backend/DBusService.vala 2013-02-11 23:01:25 +0000
4@@ -69,4 +69,4 @@
5 service.on_view_visibility_change ();
6 }
7 }
8-}
9\ No newline at end of file
10+}
11
12=== modified file 'src/SlingshotView.vala'
13--- src/SlingshotView.vala 2013-02-06 20:36:45 +0000
14+++ src/SlingshotView.vala 2013-02-11 23:01:25 +0000
15@@ -452,8 +452,10 @@
16 }
17 break;
18 default:
19- searchbar.grab_focus ();
20- searchbar.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);
21+ if (!searchbar.has_focus) {
22+ searchbar.grab_focus ();
23+ searchbar.move_cursor (Gtk.MovementStep.BUFFER_ENDS, 0, false);
24+ }
25 return base.key_press_event (event);
26
27 }

Subscribers

People subscribed via source and target branches