Adds a tooltip to the icon
authorMathias Buhr <napcode@apparatus.de>
Tue, 8 Mar 2016 08:14:50 +0000 (09:14 +0100)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 8 Mar 2016 13:44:58 +0000 (08:44 -0500)
gtk2_ardour/keyeditor.cc
libs/gtkmm2ext/gtkmm2ext/searchbar.h
libs/gtkmm2ext/searchbar.cc

index d7a92bd6300b77a99269a9f8e40a53ee38a7a879..f300b4751c45fe76d3d62f293493e23c51dd3449 100644 (file)
@@ -68,7 +68,7 @@ KeyEditor::KeyEditor ()
        : ArdourWindow (_("Key Bindings"))
        , unbind_button (_("Remove shortcut"))
        , unbind_box (BUTTONBOX_END)
-       , filter_entry (_("Search..."))
+       , filter_entry (_("Search..."), true)
        , filter_string("")
        , sort_column(0)
        , sort_type(Gtk::SORT_ASCENDING)
@@ -80,6 +80,7 @@ KeyEditor::KeyEditor ()
 
        Glib::RefPtr<Gdk::Pixbuf> icon = ARDOUR_UI_UTILS::get_icon ("search");
        filter_entry.set_icon_from_pixbuf (icon);
+       filter_entry.set_icon_tooltip_text (_("Click to reset search string"));
        filter_entry.signal_search_string_updated ().connect (sigc::mem_fun (*this, &KeyEditor::search_string_updated));
        vpacker.pack_start (filter_entry, false, false);
 
index 5096ed53f9d27caccbd4437c5631b2104e8e777b..d14d3bed3fb513af648ba6a4e9fa5311c3a6dc0e 100644 (file)
@@ -8,8 +8,11 @@ namespace Gtkmm2ext {
 class SearchBar : public Gtk::Entry
 {
 public:
-       SearchBar(const std::string& placeholder_text = "Search...", bool icon_click_resets = true);
+       SearchBar(
+               const std::string& placeholder_text = "Search...",
+               bool icon_click_resets = true);
 
+       // resets the searchbar to the initial state
        void reset ();
        // emitted when the filter has been updated
        sigc::signal<void, const std::string&> signal_search_string_updated () { return sig_search_string_updated; }
index 75915c1f2e6accd5779d185de75e011130207db4..6bfb7e0629e12709159f20d33ae1237f9fcab667 100644 (file)
@@ -64,12 +64,12 @@ SearchBar::key_press_event (GdkEventKey* ev)
 void
 SearchBar::icon_clicked_event (Gtk::EntryIconPosition, const GdkEventButton*)
 {
-               if (icon_click_resets) {
-                       reset ();
-               }
-               else {
-                       search_string_changed ();
-               }
+       if (icon_click_resets) {
+               reset ();
+       }
+       else {
+               search_string_changed ();
+       }
 }
 
 void