GNOME Bugzilla – Bug 754243
Hide GtkSearchBar when not searching
Last modified: 2016-02-15 14:48:19 UTC
Created attachment 310191 [details] [review] GtkSearchBar: Hide the entire bar, not just the revealer It's the old "GtkSearchBar leaves a 1px high widget behind" problem. I vaguely remember there being an argument about not actually hiding the entire GtkSearchBar, but I don't remember the exact rationale, so here's a patch. Apps still need fixing to not show their search bars at all, I'll attach another patch to do that in GtkAppChooserDialog.
Created attachment 310192 [details] [review] Don't show the GtkSearchBar in GtkAppChooserDialog
the underlying issue is discussed in bug 740640
Review of attachment 310192 [details] [review]: As discussed on irc, I don't think this is right. It is vulerable to show_all. Conceptually, the search bar is visible - it is just in a mode that makes it hide itself. If you want to go this way, there needs to be an intermediate container which is protected from show_all, whose visiblity you can bind to search-mode-enabled.
(In reply to Matthias Clasen from comment #3) > Review of attachment 310192 [details] [review] [review]: > > As discussed on irc, I don't think this is right. It is vulerable to > show_all. Conceptually, the search bar is visible - it is just in a mode > that makes it hide itself. If you want to go this way, there needs to be an > intermediate container which is protected from show_all, whose visiblity you > can bind to search-mode-enabled. Did you review the wrong bug here? For this instance, we could just add a now-show-all=true. I'm aware of course that this is just a workaround for the underlying problem you linked.
it is not a workaround if it doesn't work :-/
What doesn't work? If you make sure to never actually show() the GtkSearchBar yourself, it should work fine?
(In reply to Timm Bäder from comment #6) > What doesn't work? If you make sure to never actually show() the > GtkSearchBar yourself, it should work fine? Thats what I mean by "it doesn't work"... if you need to touch all the applications, nothing is won.
The win is just that it now manages the visibility itself. Applications should already not be showing their search bars themselves (otherwise they would get the 1px strip of course). So if an app is currently showing it initially, they will still get the 1px strip they are used to anyway, it doesn't change that. All apps that get it right already won't benefit either, they should already manage the visiblity themselves. But new users of GtkSearchBar have to jump a hurdle less when using it, and things like GtkAppChooserDialog can be fixed by simply not initally showing the GtkSearchBar.
*** This bug has been marked as a duplicate of bug 724096 ***