Commit Graph

59 Commits

Author SHA1 Message Date
Matthias Clasen
c94ec4a204 emojichooser: Stop using ::popup-menu
This signal is going away. Use an action instead.
2020-03-25 23:14:44 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Matthias Clasen
48ace13635 emojichooser: Stop using ::popup-menu
This signal is going away. Use an action instead.
2020-03-18 23:00:51 -04:00
Matthias Clasen
3408ff1dd7 emojichooser: Fix keynav
Make arrow and tab keys work in the
variations popover again.
2020-03-17 21:49:29 -04:00
Matthias Clasen
4d7f0f330b emojichooser: Make the variation picker work again
We can't attach popovers to unsuspecting widget anymore.
2020-03-17 00:07:37 -04:00
Timm Bäder
ceabe70a42 emojichooser: Avoid using gtk_widget_destroy() 2020-02-25 10:43:15 +01:00
Matthias Clasen
a43d13aa74 popover: Drop ::relative-to
It is enough to just set the parent (and make the parent
call gtk_native_check_resize in size_allocate).

This commit removes the relative_to argument to the
constructors of GtkPopover and GtkPopoverMenu, and
updates all callers.
2020-02-24 20:46:41 -05:00
Timm Bäder
faddbb18d3 emojichooser: Add style class to emoji toolbar
Closes #1013
2020-02-20 10:23:09 +01:00
Matthias Clasen
11ab39617e Fix the Emoji chooser finalize
If the Emoji chooser is finalized before the idle
has run, it would spew criticals, breaking some tests.
Avoid that.
2020-02-12 14:23:01 -05:00
Alexander Larsson
2890cd849f profiler: Add _end_mark() version of _add_mark()
These don't take a duration, instead they call g_get_monotonic_time() to
and subtract the start time for it.

Almost all our calls are like this, and this makes the callsites clearer
and avoids inlining the clock call into the call site.
2020-02-12 11:25:34 +01:00
Alexander Larsson
01d5ad2056 profiler: Make profiler-is-running a macro
When we use if (GDK_PROFILER_IS_RUNNING) this means we get an
inlined if (FALSE) when the compiler support is not compiled in, which
gets rid of all the related code completely.

We also expand to  G_UNLIKELY(gdk_profiler_is_running ()) in the supported
case which might cause somewhat better code generation.
2020-02-12 11:05:01 +01:00
Alexander Larsson
cc643df88b Convert all profiler times from nsec to usec
usec is the scale of the monotonic timer which is where we get almost
all the times from. The only actual source of nsec is the opengl
GPU time (but who knows what the actual resulution of that is).

Changing this to usec allows us to get rid of " * 1000" in a *lot* of
places all over the codebase, which are ugly and confusing.
2020-02-12 10:44:17 +01:00
Matthias Clasen
f240bcbbc4 emojichooser: Fix the docs
Make the emojichooser show up in the docs.
2020-02-08 19:21:57 -05: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
Matthias Clasen
9746b728ca Merge branch 'public-emojichooser' into 'master'
emojichooser: Make public

See merge request GNOME/gtk!1382
2020-02-05 18:04:42 +00:00
Matthias Clasen
54f6515005 emojichooser: Add profiler marks for loading
This is a long-running operation, and worth showing
in traces.
2020-02-05 06:28:39 -05:00
Matthias Clasen
ef7172dc1e emojichooser: Make public
This is a useful widget to have, and it has minimal api.

Not having it public forces apps to recreate a lot of
complicated machinery for not good reason, if they need
an Emoji chooser in a different context.
2020-02-03 12:49:36 +01:00
Matthias Clasen
cbed409f52 Replace .emoji with emoji for css 2020-01-23 14:07:09 -05:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
725e7c7470 emoji chooser: Name the idle
We recently added an idle that does quite a bit of work.
It should have a name.
2019-05-07 18:41:22 +00:00
Matthias Clasen
6fe203d0e2 emoji chooser: Make Escape work again
Escape is expected to close the Emoji chooser.
2019-05-04 18:18:20 +00:00
Matthias Clasen
7b6f652630 emoji chooser: Fix handling of no recent Emoji
If the recent section is empty, we want to hide
it, make its button insensitive, and select the
next section, initially. This was not working
properly, since nothing was ever setting the
section box to invisible.
2019-05-04 18:18:09 +00:00
Matthias Clasen
67e6d1087e emoji chooser: populate incrementally
It takes half a second on my system to initially
populate the Emoji chooser. That is too long. Do
the work in 8 millisecond chunks to give GTK a
chance to get some frames done.
2019-05-04 02:12:02 +00:00
Matthias Clasen
5c31c721af Rename all settings schemas to avoid conflict
Rename all our settings schemas to the org.gtk.gtk4
prefix to avoid conflicting with the gtk3 schemas.
2019-04-02 19:27:34 +00: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
Matthias Clasen
eb8b1095c8 emoji chooser: Don't use entry api on search entries
Use editable api, and cut through to the text widget
where necessary.
2019-02-20 10:32:12 -05:00
Matthias Clasen
1e129c1dd2 emoji chooser: Actually force Emoji presentation
The previous commit was using the text presentation selector
instead of the Emoji one. Oops.
2018-12-03 21:47:53 -05:00
Matthias Clasen
7a4e9fa4d3 Force emoji presentation
Append a variation selector to the Emoji sequences,
to force Emoji presentation. Without this, some
Emoji come out with text presentation by default.

Closes: Pango #334
2018-11-30 16:20:44 -05:00
Timm Bäder
ae3e6d1949 emojichooser: Pass chooser to add_emoji 2018-10-11 12:27:56 +02:00
Matthias Clasen
827219e214 Emoji chooser: Also check for hex boxes
We don't want to see those either.
2018-07-19 17:57:19 -04:00
Matthias Clasen
5c9b25c66e moji chooser: Try harder to avoid fallback
We don't want to see any fallback rendering.
The current check was still letting some fallback
combinations through.

Based on work by Julian Sparber.
2018-07-19 17:50:54 -04:00
Matthias Clasen
849ffebc21 Emoji chooser: Use icons for sections
This is more reliable than using text-style Emoji
which may not be present.

Based on work by Julian Sparber.
2018-07-19 17:47:50 -04:00
Matthias Clasen
7928532bc5 emoji: Hide recent section when empty
This is part of https://gitlab.gnome.org/GNOME/gtk/merge_requests/143
by Julian Sperber.
2018-05-19 22:53:24 -04:00
Matthias Clasen
84364a7ef4 emoji: Improve section scrolling
Leave some space above the section heading when scrolling.

This is a part of https://gitlab.gnome.org/GNOME/gtk/merge_requests/143
by Julian Sperber.
2018-05-17 16:42:00 +01:00
Matthias Clasen
be2853e5de emoji chooser: Match search terms better
Use g_str_match_string for better results.
2018-05-03 20:36:19 -04:00
Benjamin Otte
0d7cf79b00 emojichooser: Put event controllers into ui file 2018-04-26 17:59:41 +02:00
Timm Bäder
813ccb6378 emojichooser: Only measure reference emoji once
Doing that once for every emoji is pretty slow and unnecessary as the
width does not change.
2018-02-27 11:45:34 +01:00
Matthias Clasen
17bad98084 emoji: Accept unpaired releases for variations
This enables a single long-press-move-release gesture
for picking a variation. This is not perfect yet: We
don't get hover in this case.
2017-12-30 23:24:22 -05:00
Matthias Clasen
675a4111e9 emoji: Skip overly wide fallback rendering
Some emoji fonts (such as Emoji One), render Emoji sequences
such as some of the family variations using multiple individual
glyphs. This rendering is too wide and breaks our grid layout.
Therefore, we will just skip any sequence whose rendering is
more than twice as wide as a simple smiley.
2017-12-17 22:11:24 -05:00
Matthias Clasen
49d02eff93 emoji chooser: break out a helper function
This is just a small cleanup.
2017-11-19 22:43:36 -05:00
Matthias Clasen
1cd5df9404 emoji chooser: Make menu key work as expected
Whenever we have a right-click action, we should make
the menu key work as a keyboard-accessible alternative.
2017-11-19 18:04:38 -05:00
Matthias Clasen
5e748ce940 emoji chooser: handle right-click
Whereever we handle long-press for touch, it makes sense to handle
right-click as a faster alternative for mouse-based interaction.

This commit makes right-click work to bring up the variation
selector for Emojis.
2017-11-19 18:04:26 -05:00
Matthias Clasen
1f8debbac9 emoji chooser: Don't leak gestures
We were not freeing these gestures as we should.
2017-11-19 09:27:53 -05:00
Benjamin Otte
1cee71049a emojichooser: animate the adjustment
... instead of doing a dance with the scrolled window to get it to scroll
the adjustment.
2017-11-05 16:12:35 +01:00
Timm Bäder
e0623fb5ad emojichooser: Plug memory leak 2017-10-17 08:54:08 +02:00
Timm Bäder
da701ede91 emojichooser: Plug a memory leak 2017-09-24 18:15:41 +02:00
Daniel Boles
b97f1900b7 EmojiChooser: Ensure always have a selected button
We were only selecting a section’s button if the adjustment y coord was
within its heading, so scrolling slightly into it unchecked all buttons.
This also fixes how we could end up with the first 2 selected, somehow.

https://bugzilla.gnome.org/show_bug.cgi?id=787172
2017-09-04 22:58:24 +01:00
Daniel Boles
002a1d9c1c EmojiChooser: Check the 1st button before 1st show
We scroll to the top in show() but only ever selected a button when the
adjustment changed, which doesn’t happen in init(). Check it manually.

https://bugzilla.gnome.org/show_bug.cgi?id=787172
2017-09-04 22:58:24 +01:00
Mohammed Sadiq
18adee6e1b emoji-chooser: fix subsequent scroll
Event handlers on scroll window should only be run once the widget
is shown.

https://bugzilla.gnome.org/show_bug.cgi?id=786964
2017-09-01 19:36:59 -04:00