elementaryart team mailing list archive
-
elementaryart team
-
Mailing list archive
-
Message #01860
[Merge] lp:~mefrio-g/granite/searchbar-icon-press-blueprint into lp:granite
Mario Guerriero has proposed merging lp:~mefrio-g/granite/searchbar-icon-press-blueprint into lp:granite.
Requested reviews:
elementary Pantheon team (elementary-pantheon)
For more details, see:
https://code.launchpad.net/~mefrio-g/granite/searchbar-icon-press-blueprint/+merge/86604
--
https://code.launchpad.net/~mefrio-g/granite/searchbar-icon-press-blueprint/+merge/86604
Your team elementaryart (old) is subscribed to branch lp:granite.
=== modified file 'lib/Widgets/Entries.vala'
--- lib/Widgets/Entries.vala 2011-11-08 21:45:07 +0000
+++ lib/Widgets/Entries.vala 2011-12-21 19:17:23 +0000
@@ -117,7 +117,15 @@
* use changed () method.
**/
public signal void text_changed_pause (string text);
-
+
+ /**
+ * icon_pressed () signal is emitted after a short delay,
+ * which depends on the SearchBar's icon.
+ * It can be useful to show something on the icon press,
+ * we can show a PopOver, for example.
+ **/
+ public signal void icon_pressed (Gtk.Widget icon);
+
public SearchBar (string hint_string) {
base (hint_string);
@@ -175,6 +183,9 @@
set_icon_from_stock (position, null);
is_searching = true;
} else {
+ var pix = get_icon_pixbuf (EntryIconPosition.PRIMARY);
+ Gtk.Image icon = new Gtk.Image.from_pixbuf (pix);
+ icon_pressed (icon);
if (!is_focus) {
is_searching = false;
hint ();
@@ -202,5 +213,4 @@
}
-}
-
+}
\ No newline at end of file
Follow ups