Commit Graph

91 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño)
0769dfbd32 emoji: Try to load emoji data using both language and territory
When loading the emoji data we just try to get the data for a language
while there may be territory specializations and emojibase provides
them.

So, split the loading function and try to load the data for the fully
defined language string (i.e. `it-ch`) before loading the generic one
for the language (i.e. `it`) and eventually falling back to the generic
english.
2021-05-07 16:10:29 +02:00
Marco Trevisan (Treviño)
4a4525a65d emoji: remove duplicated include 2021-05-06 16:00:06 +02:00
Marco Trevisan (Treviño)
c98dd1afb9 emoji: Use a portable and configuration-dependent path to load the data
Load the emojis data in all the platforms, respecting the configured
GTK_DATA_PREFIX
2021-05-06 16:00:06 +02:00
Matthias Clasen
2f51f5affe emojichooser: Static analysis fixes 2021-05-03 07:44:38 -04:00
Matthias Clasen
40574f9ca3 emojichooser: Use markdown for css tree 2021-03-11 16:37:35 +00:00
Matthias Clasen
0ca97cd218 emojichooser: Convert docs 2021-03-11 16:37:34 +00:00
Matthias Clasen
102b74f9eb emojichooser: Make keynav work with != 7 columns
The number of 7 columns was hardcoded in a few places
related to keynav across sections. The flowbox does
not have an api for it, but we can find out anyway
how many columns there are.
2021-01-25 23:32:08 -05:00
nana-4
90355c0b27 emojichooser: Add .emoji-searchbar style class
Similar to .emoji-toolbar, it would be nice to have this for styling.
2020-12-14 05:26:13 +09:00
Jonas Ådahl
2cddec7798 gtk/popover: Use gtk_popover_present() instead of going via GtkNative
This makes it more explicit that managers of popovers make it "present".
2020-12-07 20:37:29 +01:00
Matthias Clasen
f0f64f42ee emoji chooser: Fix incremental loading
This broke when we started using GDK_PROFILER_CURRENT_TIME for
timekeeping - that gets defined to 0 when we're building without
sysprof, so we can use it to make such determinations. Go back
to using g_get_monotonic_time().

Fixes: #3438
2020-12-04 11:09:43 -05:00
Timm Bäder
eca3eab96f Remove unneeded gtkstylecontext.h includes 2020-10-14 15:06:12 -04:00
Matthias Clasen
452c909b64 Redo the handling of Emoji data
Use the data files from https://github.com/milesj/emojibase.git
as source for our Emoji data. Slightly change our data format by
adding a group to each item, in both the Emoji data and in the
setting for recent-emoji.

Install translated versions of the data as separate resource
bundles in $prefix/gtk-4.0/emoji, and load them when appropriate.

Currently, we have data for de, en, es, fr, zh, with data taken
from Unicode 13 and CLDR 13.

Fixes: #950 #1511
2020-10-04 01:14:42 -04:00
Matthias Clasen
7ef5921022 Emoji: Drop the shortname field from emoji.data
Match the name for Emoji completion, and display
it too. 'man worker' looks a lot more natural in
the UI than ':man_worker:'.
2020-10-03 20:06:31 -04:00
Matthias Clasen
1d9d5fcf39 Do case-folding and tokenization when creating emoji.data
We can avoid doing the extra work of case-folding and
tokenization whenever we filter in the Emoji chooser.
2020-10-03 19:46:46 -04:00
Matthias Clasen
ed724ebc35 emoji: Add keywords to the data
And use them for matching in the Emoji chooser.
2020-10-03 19:46:46 -04:00
Matthias Clasen
da8ee53e2d emojichooser: Allow inserting multiple Emoji
Don't close the Emoji chooser when the Control
key is held while clicking. So you can insert
multiple Emoji without having to reopen the
chooser every time.

Fixes: #1002
2020-10-01 23:45:05 -04:00
Timm Bäder
87f589f738 emojichooser: Fix typo in css class 2020-09-15 05:21:54 +02:00
Matthias Clasen
66e0f8505e emojichooser: Grab focus on map
This is the right thing to do, since we have a visible
entry and want text input to go there.
2020-08-24 18:31:08 -04:00
Matthias Clasen
d4e069a629 Port tracing to the sysprof collector api
Use the new sysprof collector api to do tracing.
2020-08-21 10:55:01 -04:00
Yuri Chornoivan
c0cf839729 Fix minor typos 2020-06-18 10:47:16 +03:00
Carlos Garcia Campos
2bf9b37e59 emojichooser: Unparent the variations popup on dispose and before adding a new one
This was causing warnings when destroying the emoji chooser because it
had children left.
2020-06-02 16:47:56 +02:00
Matthias Clasen
75d9310986 Change coordinate translation apis to take doubles
Change gtk_widget_translate_coordinates and
gtk_native_get_surface_transform to operate
on doubles. Update all callers.
2020-05-17 17:17:31 -04:00
Matthias Clasen
2a24b8c653 Replace most remaining uses of container api
These are all on GtkBox or enumerating children.
2020-05-11 22:38:21 -04:00
Corentin Noël
076b2f11d2 docs: Fix several missing references in the documentation
This fixes several typos and missing references
2020-05-11 19:26:20 +02:00
Matthias Clasen
b8d1a9eb0d flowboxchild: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore.

See #2681
2020-05-04 22:53:08 -04:00
Matthias Clasen
8e261056b9 Use gtk_popover_set_child throughout
Replace all uses of gtk_container_add on popovers
by gtk_popover_set_child.
2020-05-04 22:53:07 -04:00
Matthias Clasen
b4c79bad34 Assorted documentation fixes 2020-04-20 00:38:58 -04:00
Matthias Clasen
323394e8b5 emojichooser: Drop focus adjustment setting
It is not needed here, we are now scrolling
differently.
2020-04-18 03:29:13 -04:00
Matthias Clasen
4e6b62e564 emojichooser: link sections for keynav
Make Up/Down jump between sections in the Emoji grid.
2020-04-14 15:07:58 -04:00
Matthias Clasen
8f75df1cb3 flowbox: Add a private api to disable move-cursor
Without this, it seems impossible to make cross-section
keynav in the Emoji chooser work. I've tried, but got
lost between the focus, grab_focus, move_cursor and
keynav-failed vfuncs and signals, and their competing
implementations GtkFlowBox and GtkEmojiChooser.
2020-04-14 15:07:47 -04:00
Matthias Clasen
7179e8d5f3 emojichooser: Improve keynav, again
When the focus is moved to one of the Emoji children,
scroll it into view.
2020-04-14 13:25:20 -04:00
Matthias Clasen
325a485315 emojichooser: Improve keynav
Add an action to scroll to the next or previous section,
and bind it to Ctrl-n/Ctrl-p.
2020-04-14 13:25:20 -04:00
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