mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
Unicode: s/codepoint/code_point/g
Unicode calls them "code points" so let's follow their style.
This commit is contained in:
parent
b139fb9f38
commit
ea9ac3155d
45 changed files with 449 additions and 449 deletions
|
@ -37,9 +37,9 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
static Vector<u32> supported_emoji_codepoints()
|
||||
static Vector<u32> supported_emoji_code_pointss()
|
||||
{
|
||||
Vector<u32> codepoints;
|
||||
Vector<u32> code_pointss;
|
||||
Core::DirIterator dt("/res/emoji", Core::DirIterator::SkipDots);
|
||||
while (dt.has_next()) {
|
||||
auto filename = dt.next_path();
|
||||
|
@ -49,10 +49,10 @@ static Vector<u32> supported_emoji_codepoints()
|
|||
auto basename = lexical_path.basename();
|
||||
if (!basename.starts_with("U+"))
|
||||
continue;
|
||||
u32 codepoint = strtoul(basename.characters() + 2, nullptr, 16);
|
||||
codepoints.append(codepoint);
|
||||
u32 code_points = strtoul(basename.characters() + 2, nullptr, 16);
|
||||
code_pointss.append(code_points);
|
||||
}
|
||||
return codepoints;
|
||||
return code_pointss;
|
||||
}
|
||||
|
||||
EmojiInputDialog::EmojiInputDialog(Window* parent_window)
|
||||
|
@ -67,20 +67,20 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window)
|
|||
auto& main_layout = main_widget.set_layout<VerticalBoxLayout>();
|
||||
main_layout.set_spacing(0);
|
||||
|
||||
auto codepoints = supported_emoji_codepoints();
|
||||
auto code_pointss = supported_emoji_code_pointss();
|
||||
|
||||
size_t index = 0;
|
||||
size_t columns = 6;
|
||||
size_t rows = ceil_div(codepoints.size(), columns);
|
||||
size_t rows = ceil_div(code_pointss.size(), columns);
|
||||
|
||||
for (size_t row = 0; row < rows && index < codepoints.size(); ++row) {
|
||||
for (size_t row = 0; row < rows && index < code_pointss.size(); ++row) {
|
||||
auto& horizontal_container = main_widget.add<Widget>();
|
||||
auto& horizontal_layout = horizontal_container.set_layout<HorizontalBoxLayout>();
|
||||
horizontal_layout.set_spacing(0);
|
||||
for (size_t column = 0; column < columns; ++column) {
|
||||
if (index < codepoints.size()) {
|
||||
if (index < code_pointss.size()) {
|
||||
StringBuilder builder;
|
||||
builder.append(Utf32View(&codepoints[index++], 1));
|
||||
builder.append(Utf32View(&code_pointss[index++], 1));
|
||||
auto emoji_text = builder.to_string();
|
||||
auto& button = horizontal_container.add<Button>(emoji_text);
|
||||
button.set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue