Merge lp:~elementary-apps/noise/Gtk.SearchEntry into lp:~elementary-apps/noise/trunk

Proposed by Sergey "Shnatsel" Davidoff
Status: Merged
Approved by: Sergey "Shnatsel" Davidoff
Approved revision: 1626
Merged at revision: 1627
Proposed branch: lp:~elementary-apps/noise/Gtk.SearchEntry
Merge into: lp:~elementary-apps/noise/trunk
Diff against target: 37 lines (+4/-6)
1 file modified
src/LibraryWindow.vala (+4/-6)
To merge this branch: bzr merge lp:~elementary-apps/noise/Gtk.SearchEntry
Reviewer Review Type Date Requested Status
Robert Roth (community) Approve
Review via email: mp+225408@code.launchpad.net

Commit message

Migrate from deprecated Granite.SearchBar to Gtk.SearchEntry (bug #1337291).

This introduces no change in functionality aside of search timeout bump from 80ms to 150ms.

Description of the change

Migrate from deprecated Granite.SearchBar to Gtk.SearchEntry.

This introduces no change in functionality aside of a welcome bump from 80ms to 150ms search timeout.

To post a comment you must log in.
Revision history for this message
Robert Roth (evfool) wrote :

Can't see the bump from 80ms to 150ms (only the removal of 80ms), is the 150ms a builting value in Gtk.SearchEntry?

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

150ms is built-in and only used when you connect to search_changed signal, according to http://valadoc.org/#!api=gtk+-3.0/Gtk.SearchEntry

Revision history for this message
Robert Roth (evfool) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/LibraryWindow.vala'
2--- src/LibraryWindow.vala 2014-05-11 17:03:37 +0000
3+++ src/LibraryWindow.vala 2014-07-02 22:28:42 +0000
4@@ -56,7 +56,7 @@
5 public ViewContainer view_container { get; private set; }
6 public TopDisplay topDisplay { get; private set; }
7 public Widgets.ViewSelector viewSelector { get; private set; }
8- public Granite.Widgets.SearchBar searchField { get; private set; }
9+ public Gtk.SearchEntry searchField { get; private set; }
10 public Widgets.StatusBar statusbar { get; private set; }
11 private FixedBin topDisplayBin;
12
13@@ -268,14 +268,12 @@
14 topDisplay = new TopDisplay ();
15 topDisplayBin = new FixedBin (200, -1, 600, -1);
16 viewSelector = new Widgets.ViewSelector ();
17- searchField = new Granite.Widgets.SearchBar (_("Search Music"));
18+ searchField = new Gtk.SearchEntry ();
19+ searchField.placeholder_text = _("Search Music");
20
21
22 topDisplayBin.set_widget (topDisplay, true, false);
23
24- // Set search timeout in ms
25- searchField.pause_delay = 80;
26-
27 // Tweak view selector's size
28 viewSelector.margin_left = 12;
29 viewSelector.margin_right = 6;
30@@ -531,7 +529,7 @@
31 nextButton.clicked.connect (() => {play_next_media ();});
32
33 searchField.activate.connect (searchFieldActivate);
34- searchField.text_changed_pause.connect ((text) => {if (text.length != 1) libraries_manager.search_for_string (text);});
35+ searchField.search_changed.connect (() => {if (searchField.text_length != 1) libraries_manager.search_for_string (searchField.get_text ());});
36 searchField.text = main_settings.search_string;
37 libraries_manager.search_for_string (main_settings.search_string);
38

Subscribers

People subscribed via source and target branches