← Back to team overview

elementaryart team mailing list archive

[Merge] lp:~markellmtthw/granite/fix-916950 into lp:granite

 

Matthew Markell has proposed merging lp:~markellmtthw/granite/fix-916950 into lp:granite.

Requested reviews:
  elementary Pantheon team (elementary-pantheon)
Related bugs:
  Bug #916950 in Granite: "Clear placeholder-text when Widgets.SearchBar is insensitive"
  https://bugs.launchpad.net/granite/+bug/916950

For more details, see:
https://code.launchpad.net/~markellmtthw/granite/fix-916950/+merge/88633
-- 
https://code.launchpad.net/~markellmtthw/granite/fix-916950/+merge/88633
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	2012-01-16 01:38:23 +0000
@@ -25,10 +25,13 @@
         public string hint_string;
         Gdk.RGBA normal_color;
         Gdk.RGBA insensitive_color;
+ 
+        private string text_restore;
 
         public HintedEntry (string hint_string) {
         
             this.hint_string = hint_string;
+            text_restore = hint_string;
             normal_color = get_style_context().get_color(Gtk.StateFlags.NORMAL);
             insensitive_color = get_style_context().get_color(Gtk.StateFlags.INSENSITIVE);
             
@@ -71,11 +74,14 @@
         private void grey_out () {
             override_font (Pango.FontDescription.from_string ("italic"));
             override_color(Gtk.StateFlags.NORMAL, insensitive_color);
+            text_restore = this.text;
+            this.text = "";
         }
         
         private void reset_font () {
             override_font (Pango.FontDescription.from_string ("normal"));
             override_color(Gtk.StateFlags.NORMAL, normal_color);
+            this.text = text_restore;
         }
         
         public new string get_text () {


Follow ups