summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/EmojiInputDialog.cpp
AgeCommit message (Collapse)Author
2023-03-05LibGUI: Paint emoji using text in the EmojiInputDialogTimothy Flynn
This widget originally used text, but at the time we did not support painting multi-code point emoji as text at all. So it was changed to paint emoji with their bitmaps in commit 8190120f9531693176ca499c12. Now that we can paint text with multi-code point emoji, revert this widget to use text again. This has the added benefit that the dialog has a what-you-see-is-what-you-get effect; any emoji with text presentation in the font (e.g. U+00A9 Copyright) will be displayed as such in the dialog, which is how the text would be painted when selected anyways. Note that to accommodate some emoji sizes, this also had to bump the button sizes a bit, otherwise they would be displayed with an ellipsis.
2023-03-05LibGUI: Fix typo in the name of the EmojiCategory structTimothy Flynn
2023-02-21LibGUI: Fix const-correctness issuesAndreas Kling
2023-02-18Userland: Specify margins and spacing in the GUI::Layout constructorSam Atkins
2023-01-07LibGUI+Userland: Rename `try_load_from_gml()` -> `load_from_gml()` :^)Sam Atkins
It's the only one, so the `try` prefix is unnecessary now.
2023-01-07Userland: Replace all uses of `load_from_gml` with `try_load_from_gml`Sam Atkins
MOAR FIXMES! ;^)
2023-01-06LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)Sam Atkins
Rip that bandaid off! This does the following, in one big, awkward jump: - Replace all uses of `set_main_widget<Foo>()` with the `try` version. - Remove `set_main_widget<Foo>()`. - Rename the `try` version to just be `set_main_widget` because it's now the only one. The majority of places that call `set_main_widget<Foo>()` are inside constructors, so this unfortunately gives us a big batch of new `release_value_but_fixme_should_propagate_errors()` calls.
2023-01-02Everywhere: Remove unused includes of LibC/stdlib.hBen Wiederhake
These instances were detected by searching for files that include stdlib.h, but don't match the regex: \\b(_abort|abort|abs|aligned_alloc|arc4random|arc4random_buf|arc4random_ uniform|atexit|atof|atoi|atol|atoll|bsearch|calloc|clearenv|div|div_t|ex it|_Exit|EXIT_FAILURE|EXIT_SUCCESS|free|getenv|getprogname|grantpt|labs| ldiv|ldiv_t|llabs|lldiv|lldiv_t|malloc|malloc_good_size|malloc_size|mble n|mbstowcs|mbtowc|mkdtemp|mkstemp|mkstemps|mktemp|posix_memalign|posix_o penpt|ptsname|ptsname_r|putenv|qsort|qsort_r|rand|RAND_MAX|random|reallo c|realpath|secure_getenv|serenity_dump_malloc_stats|serenity_setenv|sete nv|setprogname|srand|srandom|strtod|strtof|strtol|strtold|strtoll|strtou l|strtoull|system|unlockpt|unsetenv|wcstombs|wctomb)\\b (Without the linebreaks.) This regex is pessimistic, so there might be more files that don't actually use anything from the stdlib. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-11-19LibGUI: Remove redundant event handling in EmojiInputDialogthankyouverycool
The Dialog class already handles closing on escape.
2022-11-19LibGUI+Taskbar+Applets+Applications: Set various windows as Popupsthankyouverycool
Makes the Audio applet, Taskbar clock, CommandPalette, EmojiPicker, and Assistant work as Popup windows. Popups are frameless, unmovable, and unresizable by default, in addition to their preemptive function. Also sets Assistant not to obey widget min size so its search result area resizes correctly
2022-11-19LibGUI+WindowServer+Applets+Taskbar: Remove active input conceptsthankyouverycool
and the CaptureInput mode. They are a source of unneeded complexity in WindowServer and have proven prone to regressions, so this patch replaces them with a simple input preemption scheme using Popups. Popup windows now have ergonomics similar to menus: When open, a popup preempts all mouse and key events for the entire window stack; however, they are fragile and will close after WindowServer swallows the first event outside them. This is similar to how combo box windows and popups work in the classic Windows DE and has the added benefit of letting the user click anywhere to dismiss a popup without having to worry about unwanted interactions with other widgets.
2022-11-19LibGUI+WindowServer: Remove InputPreemptor conceptthankyouverycool
This functionality will be superceded by WindowType:Popups
2022-10-25LibGUI: Remove Window::set_blocks_command_palette()demostanis
Since the logic to open the command palette is now in the form of an action, its keybinding is only bound when the window active. Thus, when a combo box or the emoji input dialog is active, the window isn't, and the command palette doesn't show up, without requiring special checks.
2022-10-24AK+Everywhere: Turn bool keep_empty to an enum in split* functionsdemostanis
2022-10-19LibGUI: Insert first displayed emoji on returnEtienne Rodriguez
This enables users to insert emojis without using the mouse by searching for it in the EmojiInputDialog and then hitting return.
2022-09-20LibGUI: Use fuzzy matching when searching for emoji by nameTimothy Flynn
This allows the user to have slight typos in their search query.
2022-09-16LibGUI: Load emoji icons for EmojiInputDialog through Gfx::EmojiTimothy Flynn
No difference when cold-loading the emoji icons, but for a warm load, this provides a per-process cache of the loaded icons.
2022-09-16LibGUI: Defer loading emoji icons until their first paint eventTimothy Flynn
The EmojiInputDialog re-uses emoji buttons to help with performance as filters are applied / removed. The downside of pre-creating the buttons is that it currently takes upwards of 600ms (on my machine) to load all emoji icons from disk at once. This will only become worse over time as more emoji are added. To alleviate this, defer loading the icons until they are needed for painting (i.e. come into view).
2022-09-11LibGUI: Support emoji with multiple code points in EmojiInputDialogTimothy Flynn
2022-09-11LibGUI: Use discovered emoji files as the EmojiInputDialog button iconsTimothy Flynn
Rather than rendering the emoji as text, use the emoji icons themselves.
2022-09-11LibGUI: Add an emoji category filter for SerenityOS custom emojisTimothy Flynn
Most of the emoji are 7x10px (or close to that). But some are larger, on the order of 128x128px. The icon used for the SerenityOS category is one such large emoji, and must be scaled down to an appropriate size for rendering.
2022-09-11LibGUI: Ensure unknown emoji have a set display orderTimothy Flynn
Currently, we use code point values as a tie break when sorting emoji by display order. When multiple code point emoji are supported, this will become a bit awkward. Rather than dealing with varying code point length while sorting, just set a maximum display order to ensure these are placed at the end.
2022-09-09Spreadsheet+LibGUI: Set EmojiInputDialog as a CaptureInput modalthankyouverycool
This has two advantages: First the picker no longer changes the active window state of its parent. Visually this is an additional hint that the dialog is "fragile" and will close on loss of focus. Second, because it contains a search box, its own input won't be preempted by global application shortcuts when typing (pending #15129). This is a problem in apps like PixelPaint which use shortcuts without modifiers.
2022-09-09LibGUI: Allow blocking CommandPalette/EmojiInput on a per Window basisthankyouverycool
Instead of having to negate every focusable widget or textbox, let windows override all their widgets. These two Dialogs now block themselves and each other.
2022-09-08LibGUI: Add Unicode emoji group filters to the EmojiInputDialogTimothy Flynn
This allows users to filter the list of displayed emoji by the group to which the emoji belong.
2022-09-08LibGUI: Display emoji in the EmojiInputDialog in Unicode display orderTimothy Flynn
2022-09-07LibGUI: Set a tooltip on the emojis' buttons to their code point namesTimothy Flynn
2022-09-07LibGUI: Add a search box to filter EmojiInputDialog by code point namesTimothy Flynn
2022-09-07LibGUI: Disable EmojiInputDialog updates while re-displaying emojiTimothy Flynn
To prevent lag when the displayed code points are redrawn in support of a search box, disable updates while re-adding the emoji buttons.
2022-09-07LibGUI: Create the emoji buttons only once for EmojiInputDialogTimothy Flynn
To prevent lag when the displayed code points are redrawn in support of a search box, only create the GUI::Button objects for the emoji a single time. Re-use those buttons when adding them to the dialog.
2022-09-07LibGUI: Move code to display emoji buttons to a helper functionTimothy Flynn
For a search box to be added, this code will need to be re-invoked as the search query updates.
2022-09-07LibGUI: Wrap the EmojiInputDialog in a scrollable containerTimothy Flynn
This will prevent the dialog from growing endlessly as emoji are added.
2022-09-07LibGUI: Convert EmojiInputDialog to GMLTimothy Flynn
This will allow easily adding components such as a search box. Also, increase the number of emoji per row. This does not fix the issue where too many emoji will cause the dialog to grow limitlessly, but it looks a bit more reasonable now with the number of emoji that we have.
2022-08-25Apps+Demos+Dialogs: Remove unnecessary minimum window sizesthankyouverycool
The new layout system conveniently calculates these for us now. In the case of Mandelbrot where it needs to be overriden, make sure to disable obey min widget size first. In EmojiInputDialog's case, the window needs to be resized instead to center correctly.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-06-29LibGUI: Close EmojiDialog on active window changeOlivier De Cannière
This patch makes EmojiDialog be closed whenever the focus moves away from it just like the CommandPalette.
2022-05-13LibGUI+Userland: Make Dialog::ExecResult an enum classSam Atkins
2022-02-23LibGUI/EmojiInputDialog: Skip multi code point emojis for nowLinus Groh
These will require some tweaking here and elsewhere in LibGUI, to handle both rendering of the emojis as single glyphs consistently, and faking key events with multiple code points after selecting one.
2022-02-23LibGUI/EmojiInputDialog: Automatically calculate the dialog sizeLinus Groh
This was getting way too crowded again. Let's just fix the FIXME. :^)
2022-01-18EmojiInputDialog: Increase size of buttons and dialogLady Gegga
Display some emojis earlier hidden behind "..." and add spacing.
2022-01-07EmojiInputDialog: Ensure that all buttons are equal widthFiliph Sandström
Previously we only set the min size which meant that some emoji buttons was larger than others :^)
2021-11-11Everywhere: Pass AK::StringView by valueAndreas Kling
2021-08-18Userland+LibGUI: Add shorthand versions of the Margins constructorsin-ack
This allows for typing [8] instead of [8, 8, 8, 8] to specify the same margin on all edges, for example. The constructors follow CSS' style of specifying margins. The added constructors are: - Margins(int all): Sets the same margin on all edges. - Margins(int vertical, int horizontal): Sets the first argument to top and bottom margins, and the second argument to left and right margins. - Margins(int top, int vertical, int bottom): Sets the first argument to the top margin, the second argument to the left and right margins, and the third argument to the bottom margin.
2021-06-30AK+Everywhere: Use mostly StringView in LexicalPathMax Wipfli
This changes the m_parts, m_dirname, m_basename, m_title and m_extension member variables to StringViews onto the m_string String. It also removes the m_is_absolute member in favour of computing if a path is absolute in the is_absolute() getter. Due to this, the canonicalize() method has been completely rewritten. The parts() getter still returns a Vector<String>, although it is no longer a const reference as m_parts is no longer a Vector<String>. Rather, it is constructed from the StringViews in m_parts upon request. The parts_view() getter has been added, which returns Vector<StringView> const&. Most previous users of parts() have been changed to use parts_view(), except where Strings are required. Due to this change, it's is now no longer allow to create temporary LexicalPath objects to call the dirname, basename, title, or extension getters on them because the returned StringViews will point to possible freed memory.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-13Everywhere: It's now "Foobar", not "FooBar", and not "foo bar"Andreas Kling
I hereby declare these to be full nouns that we don't split, neither by space, nor by underscore: - Breadcrumbbar - Coolbar - Menubar - Progressbar - Scrollbar - Statusbar - Taskbar - Toolbar This patch makes everything consistent by replacing every other variant of these with the proper one. :^)
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling