Commit Graph

81 Commits

Author SHA1 Message Date
Matthias Clasen
8a0d4dfa94 searchbar: Capture events in the bubble phase
This is an unfortunate naming clash, but it avoids
an event handling clash between the capture widget
and its children.

Fixes: #3098
2021-01-25 22:16:29 -05:00
Matthias Clasen
b4e645862a searchbar: Fix documentation mishap
The css section was inserted between the example
and the sentence referring to it.
2021-01-25 22:15:56 -05:00
Emmanuele Bassi
d4ddfdc265 a11y: Set the role on GtkSearchBar
The search bar widget has a "SEARCH" landmark role, which is described
as:

    A landmark region that contains a collection of items and
    objects that, as a whole, combine to create a search facility.
2020-11-12 21:46:06 +00:00
Florian Müllner
056a073061 searchbar: Fix clearing search entry on hide
Commit fa3d1940bf added separate grab handling for GtkSearchEntry, but
didn't consider whether the bar was revealed or concealed. The expected
behavior for the latter is that the entry is cleared rather than focused,
fix the condition accordingly.
2020-11-12 19:59:55 +01:00
Timm Bäder
eca3eab96f Remove unneeded gtkstylecontext.h includes 2020-10-14 15:06:12 -04:00
Benjamin Otte
d375dce9f5 Replace "gchar" with "char" 2020-07-25 00:47:36 +02:00
Matthias Clasen
3c5afc06d1 searchbar: Set a focus vfunc
We don't want to take focus ourselves here.
2020-07-13 15:06:08 -04:00
Matthias Clasen
f32239df1f searchbar: Add a key-capture-widget property
This is handy to set up this relationship in ui files,
and also makes it accessible in the inspector.
2020-07-12 16:25:48 -04:00
Matthias Clasen
b93631164f Remove lots of focus vfuncs
In many cases, the default widget vfuncs work just fine,
combined with setting focusable.
2020-05-11 00:11:37 -04:00
Matthias Clasen
8effa10e79 searchbar: Drop the Private struct 2020-05-05 10:45:47 -04:00
Matthias Clasen
3a9883b3ca searchbar: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

We have to implement GtkBuildable, in order to keep
the <child> element in ui files working for search bars.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
e2abe6dd29 searchbar: Add a child property 2020-05-04 22:53:08 -04:00
Matthias Clasen
649ae635a7 Use gtk_revealer_set_child throughout
Replace all uses of gtk_container_add on revealers
with gtk_revealer_set_child.
2020-05-04 22:53:08 -04:00
Timm Bäder
655711fef2 Rename gtk_widget{get,set,has}_style_class to _css_class
We want to use css instead of style everywhere now.
2020-02-07 13:16:45 -05:00
Timm Bäder
b7ee2cbc28 Start using GtkWidget's new style class API 2020-02-07 13:16:32 -05:00
Timm Bäder
64c6229f54 searchbar: Use proper getter in _get_property()
Instead of retuning a seemingly random boolean, just use
gtk_search_bar_get_search_mode().
2020-02-07 13:15:59 -05:00
Timm Bäder
60be37d63a searchbar: Use g_object_notify_by_pspec
We already keep the pspecs around, so use them.
2020-02-07 13:15:59 -05:00
Matthias Clasen
4e7f251b18 search bar: Make final 2019-05-26 23:27:15 -04:00
Matthias Clasen
edbc99104f searchbar: Fix a compiler warning 2019-04-05 05:10:33 +00:00
Carlos Garnacho
b842bf7bf5 gtk: Drop gtk_search_[entry|bar]_handle_event()
This is now unused, and unrecommended.
2019-04-03 13:23:34 +02:00
Benjamin Otte
a44ac75e65 gtk: Don't include gtkstylecontext.h from gtkcsstypesprivate.h
And make sure it's included everywhere it's needed.
2019-03-19 08:53:25 +01:00
Carlos Garnacho
120ee17e09 gtksearchbar: Do not handle captured events for unmapped bars
If the bar is currently unmapped, it should not attempt to capture
and handle events.

Related: https://gitlab.gnome.org/GNOME/gtk/issues/1205
2019-02-20 13:15:16 +01:00
Matthias Clasen
fa3d1940bf search bar: Work with the new GtkSearchEntry
Don't assume a search entry is an entry, and use
the editable api as far as possible.
2019-02-19 00:25:59 -05:00
Emmanuele Bassi
1668496359 docs: Fix GTK links and locations 2019-02-06 10:39:27 +01:00
Timm Bäder
245cebec1d widget: Ignore events on unmapped widgets
There was a special case for GtkSearchBar, so remove that one.
2019-01-29 07:19:54 +01:00
Timm Bäder
135cf16969 entry: Remove _gtk_entry_grab_focus
We have API for both the select and !select behavior these days, so use
that one.

Fixes #1457
2019-01-16 19:18:13 +01:00
Timm Bäder
359d874ddb Use g_clear_pointer to unparent widgets 2018-11-13 20:53:14 +01:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Timm Bäder
a976aa9740 searchbar: Ignore key presses when unmapped
The purpose of a searchbar is to start a search on visible widgets when
a key is pressed. Starting a search on e.g. a stack page that is not
visible at all is not very useful.
2018-07-08 09:41:15 +02:00
Matthias Clasen
8755d884f3 Remove a lot of Since annotations
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Carlos Garnacho
15e00759c7 eventcontrollerkey: Port to new API model 2018-04-26 17:59:42 +02:00
Rico Tzschichholz
ff738269b6 Fix some g-i annotation warnings 2018-04-06 16:26:17 +02:00
Carlos Garnacho
20c1e24b60 gtksearchbar/entry: Add [gs]et_key_capture_widget() API calls
This lets these widgets actively pull events from a widget, instead
of passively being fed events.
2018-04-05 19:26:54 +02:00
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
2018-04-05 14:56:38 +02:00
Benjamin Otte
7437d34eb9 shortcuts: Don't include gtk.h
Clean up all shortcuts includes to only include the necessary files
while we're at it.
2018-02-08 06:16:01 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Timm Bäder
b726f60f90 searchbar: reorganize
Avoid the ugly priv->tool_box==NULL check in ::add (and ::remove) by
just not using template xml for this small class. Also, make sure the
GtkBin child is properly set and implement remove to also properly
remove it. Remove the manual widget margins and add some CSS for it.
Also switch to simply using a GtkCenterBox.
2018-02-04 22:51:16 +01:00
Timm Bäder
fd148d1ef5 searchbar: Properly remove child widgets
Since the GtkSearchBar is not the direct parent, we need to remove them
properly from priv->box_center.
2018-02-04 17:51:18 +01:00
Timm Bäder
3744bbdc27 searchbar: Make a code snippet compile 2018-01-03 17:11:32 +01:00
Matthias Clasen
ffd6baec42 gtk: Intern css names
This avoids a bunch of strdups at startup.
2017-11-17 22:49:57 -05:00
Matthias Clasen
fb8589671d Drop unused includes of gtkrender.h
We don't use the gtk_render apis internally anymore.
Drop these includes so it is clear where the remaining
uses are.
2017-10-25 21:46:46 -04:00
Matthias Clasen
f43849901d search bar: Use GdkEvent API 2017-09-19 18:39:03 +02:00
Timm Bäder
a735dd44cb searchbar: Fix property documentation comments
They are properties of GtkSearchBar, not GtkEntry.
2017-07-19 21:27:12 -04:00
Timm Bäder
4823b9f2d7 searchbar: Remove manual snapshot code 2017-07-19 21:27:12 -04:00
Timm Bäder
f4341ee9f7 widget: Remove show-all property
Doesn't make sense anymore now that gtk_widget_show_all is gone.
2017-01-20 21:37:07 +01:00
Benjamin Otte
6c20ddc119 searchbar: Implement snapshot() 2016-12-20 18:01:12 +01:00
Matthias Clasen
3014aab25c searchbar: Don't expose implementation details
The various boxes and the revealer here should not be exposed
as internal children for subclasses to use in their .ui files.
2016-01-28 22:47:28 -05:00
Matthias Clasen
bec58dc39e searchbar: Stop adding a style class
We have an element name now.
2015-11-05 07:44:04 -05:00
Matthias Clasen
ea5f16fd2d searchbar: Add an element name to the css node
This lets us avoid hardcoding the type in CSS.
2015-10-29 07:43:30 -04:00
Matthias Clasen
4ef0c34b65 Fix the build 2015-03-22 11:55:33 -04:00