mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:07:34 +00:00
LibGUI: Tweak EmojiInputDialog layout :^)
This commit is contained in:
parent
5aba8cc750
commit
014cb1a55b
1 changed files with 13 additions and 13 deletions
|
@ -70,7 +70,7 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window)
|
||||||
auto codepoints = supported_emoji_codepoints();
|
auto codepoints = supported_emoji_codepoints();
|
||||||
|
|
||||||
size_t index = 0;
|
size_t index = 0;
|
||||||
size_t columns = 5;
|
size_t columns = 6;
|
||||||
size_t rows = ceil_div(codepoints.size(), columns);
|
size_t rows = ceil_div(codepoints.size(), columns);
|
||||||
|
|
||||||
for (size_t row = 0; row < rows && index < codepoints.size(); ++row) {
|
for (size_t row = 0; row < rows && index < codepoints.size(); ++row) {
|
||||||
|
@ -78,18 +78,18 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window)
|
||||||
auto& horizontal_layout = horizontal_container.set_layout<HorizontalBoxLayout>();
|
auto& horizontal_layout = horizontal_container.set_layout<HorizontalBoxLayout>();
|
||||||
horizontal_layout.set_spacing(0);
|
horizontal_layout.set_spacing(0);
|
||||||
for (size_t column = 0; column < columns; ++column) {
|
for (size_t column = 0; column < columns; ++column) {
|
||||||
StringBuilder builder;
|
if (index < codepoints.size()) {
|
||||||
builder.append(Utf32View(&codepoints[index++], 1));
|
StringBuilder builder;
|
||||||
auto emoji_text = builder.to_string();
|
builder.append(Utf32View(&codepoints[index++], 1));
|
||||||
auto& button = horizontal_container.add<Button>(emoji_text);
|
auto emoji_text = builder.to_string();
|
||||||
button.set_button_style(Gfx::ButtonStyle::CoolBar);
|
auto& button = horizontal_container.add<Button>(emoji_text);
|
||||||
button.on_click = [this, button = &button](auto) {
|
button.set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||||
m_selected_emoji_text = button->text();
|
button.on_click = [this, button = &button](auto) {
|
||||||
done(ExecOK);
|
m_selected_emoji_text = button->text();
|
||||||
};
|
done(ExecOK);
|
||||||
if (index >= codepoints.size()) {
|
};
|
||||||
horizontal_layout.add_spacer();
|
} else {
|
||||||
break;
|
horizontal_container.add<Widget>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue