← Back to team overview

elementaryart team mailing list archive

[Merge] lp:~evfool/marlin/nosuggestions into lp:marlin

 

Robert Roth has proposed merging lp:~evfool/marlin/nosuggestions into lp:marlin.

Requested reviews:
  The elementary Project (elementaryproject)
Related bugs:
  Bug #804564 in Marlin: "If no auto-complete results, don't show menu"
  https://bugs.launchpad.net/marlin/+bug/804564

For more details, see:
https://code.launchpad.net/~evfool/marlin/nosuggestions/+merge/66692

Only show autocomplete if there are any suggestions (LP: #804564).
-- 
https://code.launchpad.net/~evfool/marlin/nosuggestions/+merge/66692
Your team The elementary Project is requested to review the proposed merge of lp:~evfool/marlin/nosuggestions into lp:marlin.
=== modified file 'libwidgets/LocationBar.vala'
--- libwidgets/LocationBar.vala	2011-07-02 12:21:43 +0000
+++ libwidgets/LocationBar.vala	2011-07-02 12:27:33 +0000
@@ -996,7 +996,7 @@
         
         private void show_autocomplete()
         {
-            if(!autocomplete_showed)
+            if(!autocomplete_showed && autocomplete.has_suggestions)
             {
                 int x_win, y_win;
                 get_window().get_position(out x_win, out y_win);

=== modified file 'libwidgets/PopupLocationBar.vala'
--- libwidgets/PopupLocationBar.vala	2011-06-13 08:42:57 +0000
+++ libwidgets/PopupLocationBar.vala	2011-07-02 12:27:33 +0000
@@ -23,6 +23,7 @@
     PopupDraw popup;
     public signal void select(string path);
     public int selected { get { return popup.selected; } set { popup.selected = value; queue_draw(); } }
+    public bool has_suggestions { get { return popup.items.size > 0; } }
     public PopupLocationBar(int width)
     {
         ///Object(type: Gtk.WindowType.POPUP, type_hint: Gdk.WindowTypeHint.TOOLTIP);
@@ -136,12 +137,6 @@
                 y += height;
             }
         }
-        else
-        {
-            style.set_state(Gtk.StateFlags.ACTIVE);
-            Pango.Layout layout = menuitem.create_pango_layout(_("(no result found)"));
-            Gtk.render_layout(style, cr, 10, 5, layout);
-        }
         return true;
     }
 }


Follow ups