Commit Graph

48 Commits

Author SHA1 Message Date
Timm Bäder
cc4b3798e5 searchentry: Always measure and allocate icon
Just measuring it (so the warning goes away) but then not using the
values will later underallocate the text widget.
Instead, always reserve space for the icon (which will inevitable be
visible as soon as the searchentry is actually being used).

Fixes #1831
2019-04-27 08:40:33 +02: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
Carlos Garnacho
9cb9843367 searchentry: Add ::search-started signal
Users of search entries usually handled visibility (when initially hidden)
by checking the return value of gtk_search_entry_handle_event(). This does
not pan out with gtk_search_entry_set_key_capture_widget() since the return
value is not directly seen by the caller.

Add a ::search-started signal to cater for it, which gets emitted when the
search entry went from empty to non-empty.
2019-04-03 13:08:53 +02:00
Matthias Clasen
544fe83864 search entry: Fix sizing
Use the same sizing approach we use for GtkEntry:
ignore icons when measuring. This ensures that
search entries don't change size as icons come
and go.
2019-03-27 01:42:00 -04:00
Matthias Clasen
a1cc809c60 search entry: Fix property notification
Both placeholder-text and activates-default were not
up to our usual standards for property notification,
and the tests complained.
2019-03-16 21:23:28 -04:00
Matthias Clasen
b79545e83c search entry: Fix a copy-paste error 2019-03-03 22:56:02 -05:00
Matthias Clasen
02318dbda7 entries: Fix mnemonic activation
Since entries are no longer can-focus, the default
mnemonic_activate handler refuses to act on them.
2019-03-03 22:25:52 -05:00
Matthias Clasen
c53e9ed6aa search/password entry: Prevent expand leaks
We don't want the entry to expand, we just want
the text to expand inside the box, so explicitly
unset expand flags on the box.
2019-02-22 15:55:05 -05:00
Matthias Clasen
2b9436b279 search entry: Use a GtkEntryAccessible
This preserves the status quo of a11y support
for entry variations.
2019-02-22 15:50:45 -05:00
Matthias Clasen
0e603a6646 search entry: Don't force-create the accessible
We can just set the accessible name when the
accessible is actually needed.
2019-02-22 14:12:52 -05:00
Matthias Clasen
f95ed63b88 Merge branch 'nbpage' into 'master'
Notebook child metas

See merge request GNOME/gtk!594
2019-02-21 05:50:05 +00:00
Matthias Clasen
2e9c7d0744 search entry: Quiet a compiler warning 2019-02-20 13:10:09 -05:00
Matthias Clasen
b9a41a903b Merge branch 'wip/carlosg/fix-search-entry' into 'master'
Fix search bars

See merge request GNOME/gtk!593
2019-02-20 17:02:15 +00:00
Matthias Clasen
b303c20570 search entry: Add private api to get the text widget
We need this to do some custom setup in the Emoji chooser.
2019-02-20 10:29:26 -05:00
Carlos Garnacho
c739071d31 gtksearchentry: Forward captured events to the child GtkText
Catch up with the GtkEditable shuffling.
2019-02-20 13:15:16 +01:00
Matthias Clasen
0ef6c3afed search entry: Add a tooltip to th clear icon
Similar to what we do for the caps-lock warning in the
password entry.

Closes #1483
2019-02-19 00:32:35 -05:00
Matthias Clasen
667ea2dd42 search entry: Use a GtkText 2019-02-19 00:25:59 -05:00
Matthias Clasen
8bb6d00ce2 search entry: temporarily disable some functions
The search entry needs to be rewritten to use a
text child until then, keep it limping along.
2019-02-19 00:25:59 -05:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01: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
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
Matthias Clasen
a8531605db Some more interning
This avoids more strdups at startup.
2017-11-18 08:18:11 -05:00
Carlos Garnacho
c48a196d77 filechooser: Update to using GdkEvent API 2017-09-19 18:39:02 +02:00
Daniel Boles
2f2ec4fec8 searchentry: Fix typo in documentation 2017-01-31 09:39:39 +00:00
Emmanuele Bassi
9bb816f8ee gtk: Include the appropriate headers 2016-10-17 11:10:14 +01:00
Benjamin Otte
e1a03ead7a Use NULL for generic marshallers in g_signal_new()
glib will use the correct marshaller automatically. And as a side
effect, we also get all glib optimizations, like a va marshaller.
2016-08-29 16:20:54 +02:00
Benjamin Otte
63f2fc752a searchentry: Fix includes 2015-10-29 15:55:28 +01:00
Matthias Clasen
56d3e42a00 search entry: Add a style class
There should be little need to have separate styling for search
entries, so a separate name would be a bit overkill.
2015-10-28 23:58:39 -04:00
Kai Willadsen
22960ef364 docs: Fix incorrect cross-reference to GtkSearchBar
https://bugzilla.gnome.org/show_bug.cgi?id=748500
2015-04-27 06:17:11 -04:00
Matthias Clasen
3bf12c44e2 Use the new API in GtkSearchBar if we can
Sadly, GtkSearchBar allows connecting plain entries, so we have
to keep the old code around.
2015-01-24 08:44:30 -05:00
Matthias Clasen
500c8d82fc GtkSearchEntry: Add more API
Add ::next-match, ::previous-match and ::stop-search keybinding
signals that are bound to Ctrl-g, Ctrl-Shift-g and Escape. Also
add a gtk_search_entry_handle_event() function to handle key events.
2015-01-24 08:44:30 -05:00
Yosef Or Boczko
c543a14c5b Use the new support for RTL icons in GtkIconTheme
https://bugzilla.gnome.org/show_bug.cgi?id=730526
2014-05-21 17:45:38 +03:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Joanmarie Diggs
e67d0119fe gtksearchentry: Provide an accessible name
https://bugzilla.gnome.org/show_bug.cgi?id=706014
2013-08-15 16:37:29 +02:00
Matthias Clasen
398f9e8b5b Change the way GtkSearchEntry does delayed change notification
We add a GtkSearchEntry::search-changed signal which gets emitted
with a 150 millisecond delay. The ::change signal goes back to its
expected semantics.

https://bugzilla.gnome.org/show_bug.cgi?id=700229
2013-07-28 21:49:37 -04:00
Matthias Clasen
1b135b28c0 GtkSearchEntry: improve clear icon implementation
Instead of connecting to our own signal, which is generally
considered somewhat unclean, override the class handler
for the icon-release signal.
2013-07-28 20:21:28 -04:00
Sébastien Wilmet
68f44c4e90 GtkSearchEntry: fix search_entry_clear_cb()
When the icon-release signal is emitted on a GtkSearchEntry, the
contents is now cleared only if it's for the secondary icon. The primary
icon can be used for another purpose.

https://bugzilla.gnome.org/show_bug.cgi?id=704164
2013-07-15 12:27:21 +02:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Bastien Nocera
536fc22de4 GtkSearchEntry: Don't wait for timeout when emptying
When the text entry gets cleared, emit the "changed" signal
straight away. This avoids a lag when dismissing a search.

https://bugzilla.gnome.org/show_bug.cgi?id=700787
2013-05-23 20:53:30 +02:00
Bastien Nocera
51e238653d GtkSearchEntry: Delay the changed signal by default
Emit the "changed" signal after 150 msecs, so that searching
through big lists, or doing online searches feels more responsive.

This is something already done in various applications to make
search-as-you type more responsive (gnome-shell, gnome-documents,
gnome-control-center, etc.). The 150 msecs is the value currently
used by gnome-shell, so keep it (invisibly) consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=700229
2013-05-17 19:45:46 +02:00
William Jon McCann
cb27c4b08c Place the search icon in the primary slot of the entry
Instead of using the secondary slot for both clear and search. This
Makes it possible to use the search icon for actions regardless of
whether text has been entered, makes it possible to use the primary
icon to indicate search status, allows us to indicate the purpose
of the entry even if text has been already entered.

https://bugzilla.gnome.org/show_bug.cgi?id=694990
2013-03-03 11:16:09 -05:00
Matthias Clasen
72d8deb606 GtkSearchEntry: add rtl support
Flip the clear icon in rtl locales.
https://bugzilla.gnome.org/show_bug.cgi?id=684607
2012-09-21 23:41:28 -04:00
Bastien Nocera
d704f2bd2e gtk: Add GtkSearchEntry
Add a search entry widget with the recommended behaviour implemented.
As used in gnome-control-center, Totem, gnome-documents and many others.

https://bugzilla.gnome.org/show_bug.cgi?id=652809
2012-06-11 19:02:55 +01:00