GNOME Bugzilla – Bug 738493
Support GtkSearchBar
Last modified: 2014-10-26 14:15:16 UTC
This widget has been around since 3.10, high time that glade starts supporting it.
Created attachment 288429 [details] [review] Support GtkSearchBar
Was about to try this out, seems that the patch does not apply at all here. Applying: Support GtkSearchBar /home/tristan/GNOME/glade/.git/rebase-apply/patch:50: trailing whitespace. * You should have received a copy of the GNU Lesser General Public /home/tristan/GNOME/glade/.git/rebase-apply/patch:96: trailing whitespace. return TRUE; error: patch failed: plugins/gtk+/Makefile.am:101 error: plugins/gtk+/Makefile.am: patch does not apply error: patch failed: plugins/gtk+/gtk+.xml.in:5180 error: plugins/gtk+/gtk+.xml.in: patch does not apply Patch failed at 0001 Support GtkSearchBar Oddly, I get this from master as well as from your headerbar branch :-/
sorry about that; pushed a searchbar branch now
Tried out the searchbar. All around support seems good, except I'm not sure about the bit about showing/hiding it in Glade's UI. In your patch, I find this: + <properties> + <property id="search-mode-enabled" save="False" default="True"/> + </properties> Which means you cannot set the search bar to be 'enabled' (visible) by default, since 'save' is set to false. What we generally do in Glade is make sure everything is always visible (i.e. the GtkWidget 'visible' property can be set in Glade, it will be saved but it will not disappear from the workspace, where one might need to design the components of an initially invisible widget). What I think would be most consistent and useful for using this in Glade would probably be: o Allow the user to set the search-mode-enabled property for the initial intended state of the widget (unless that is somehow not useful at all, or somehow undesirable... in which case we can disable it completely). o In glade_gtk_search_bar_post_create(), make sure that the searchbar is visible initially at any time it's created o Also in glade_gtk_search_bar_post_create(), connect to a searchbar signal which indicates that the searchbar disappeared, or might disappear. Whenever the user (of Glade) clicks on the close button which might be showing if the "show-close-button" property is enabled, make sure that it does not cause the search bar to disappear An alternative to that last point would be to simply disable the close button in the workspace altogether, but still allow the user to set the value, that could be done with the following steps: o In the gtk+.xml.in definition, make the workspace widgets ignore the project data (never apply the setting to the object): <property id="show-close-button" ignore="True"/> o In glade_gtk_search_bar_post_create(), make sure the close button is not showing.
thanks for the review, I'll loook at doing those things over the weekend.
I've pushed a new branch with a few more commits. It does the Ignore-thing for show-close-button and search-mode. Also added a get_children implementation to make saving children work.
Comment on attachment 288429 [details] [review] Support GtkSearchBar Patch itself is obsolete, review was done on the searchbar branch
(In reply to comment #6) > I've pushed a new branch with a few more commits. It does the Ignore-thing for > show-close-button and search-mode. Also added a get_children implementation to > make saving children work. Thanks, I've looked it over and tried a bunch of things, seems to work well as far as I can tell. I added a patch to avoid critical messages when loading a project with searchbar children (the current code assumed that one child already existed). Also I made a small fix the the "Add Parent" widget action as it was making the assumption of the logical widget hierarchy making sense, so now doing Right Click -> Add Parent on the child of a searchbar also works. Merged the branch to master, thanks for your attention and work on this :)