mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:18:14 +00:00

This works the same way as the command-line usage, searching against the display name as provided by LibUnicode. I've modified the search loop to cover every possible unicode code-point, since my previous logic was flawed. Code-points are not dense, there are gaps, so simply iterating up to the count of them will skip ones with higher values. Surprisingly, iterating all 1,114,112 of them still runs in a third of a second. Computers are fast!
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2022, Sam Atkins <atkinssj@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGUI/Button.h>
|
|
#include <LibGUI/GlyphMapWidget.h>
|
|
#include <LibGUI/Statusbar.h>
|
|
|
|
class CharacterMapWidget final : public GUI::Widget {
|
|
C_OBJECT(CharacterMapWidget);
|
|
|
|
public:
|
|
virtual ~CharacterMapWidget() override;
|
|
|
|
void initialize_menubar(GUI::Window& window);
|
|
|
|
private:
|
|
CharacterMapWidget();
|
|
|
|
virtual void did_change_font() override;
|
|
void update_statusbar();
|
|
|
|
RefPtr<GUI::Toolbar> m_toolbar;
|
|
RefPtr<GUI::Label> m_font_name_label;
|
|
RefPtr<GUI::GlyphMapWidget> m_glyph_map;
|
|
RefPtr<GUI::TextBox> m_output_box;
|
|
RefPtr<GUI::Button> m_copy_output_button;
|
|
RefPtr<GUI::Statusbar> m_statusbar;
|
|
RefPtr<GUI::Window> m_find_window;
|
|
|
|
RefPtr<GUI::Action> m_choose_font_action;
|
|
RefPtr<GUI::Action> m_copy_selection_action;
|
|
RefPtr<GUI::Action> m_previous_glyph_action;
|
|
RefPtr<GUI::Action> m_next_glyph_action;
|
|
RefPtr<GUI::Action> m_go_to_glyph_action;
|
|
RefPtr<GUI::Action> m_find_glyphs_action;
|
|
};
|