mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 13:17:43 +00:00
LibGUI: Disable EmojiInputDialog updates while re-displaying emoji
To prevent lag when the displayed code points are redrawn in support of a search box, disable updates while re-adding the emoji buttons.
This commit is contained in:
parent
1c32823dd8
commit
a885406511
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <AK/LexicalPath.h>
|
#include <AK/LexicalPath.h>
|
||||||
|
#include <AK/ScopeGuard.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <AK/Utf32View.h>
|
#include <AK/Utf32View.h>
|
||||||
#include <LibCore/DirIterator.h>
|
#include <LibCore/DirIterator.h>
|
||||||
|
@ -89,6 +90,9 @@ auto EmojiInputDialog::supported_emoji() -> Vector<Emoji>
|
||||||
|
|
||||||
void EmojiInputDialog::update_displayed_emoji()
|
void EmojiInputDialog::update_displayed_emoji()
|
||||||
{
|
{
|
||||||
|
ScopeGuard guard { [&] { m_emojis_widget->set_updates_enabled(true); } };
|
||||||
|
m_emojis_widget->set_updates_enabled(false);
|
||||||
|
|
||||||
constexpr size_t columns = 18;
|
constexpr size_t columns = 18;
|
||||||
size_t rows = ceil_div(m_emojis.size(), columns);
|
size_t rows = ceil_div(m_emojis.size(), columns);
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue