Commit 5e8d1bc0 authored by Kenton Lam's avatar Kenton Lam Committed by Chromium LUCI CQ

Improve emoji picker dialog UI according to mocks.

Brief changes:
 - Set dialog window size.
 - Fix emoji spacing.
 - Hide (currently non-functional) search field.
 - Use Roboto font.
 - Sticky tab row to top while scrolling emoji.
 - Replace "frequently used" with "recently used" to match its behaviour (which is not implemented yet).

Screenshot:
https://screenshot.googleplex.com/4Y8zvfGgpmMHq9y.png

Bug: 1152237
Change-Id: I25c3a1787e80f6693edd483f502692fafe586e29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2639615Reviewed-by: default avatarJohn Palmer <jopalmer@chromium.org>
Reviewed-by: default avatarKeith Lee <keithlee@chromium.org>
Commit-Queue: Kenton Lam <kentonlam@google.com>
Cr-Commit-Position: refs/heads/master@{#845528}
parent eeebd591
<style> <style>
:root {
--emoji-per-row: 7;
--emoji-height: 32px;
}
.emoji-group-emoji { .emoji-group-emoji {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.emoji-button { .emoji-button {
font-size: 17px; font-size: 17px;
height: 20px; height: var(--emoji-height);
margin: 8px; line-height: var(--emoji-height);
text-align: center; text-align: center;
width: 20px; width: calc(100% / var(--emoji-per-row));
} }
.emoji-button.variants { .emoji-button.variants {
background-color: red; background-color: red;
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
button { button {
background-color: transparent; background-color: transparent;
border: 5px solid transparent; border: 5px solid transparent;
font-size: 24px;
height: 36px;
padding: 0; padding: 0;
width: 36px; width: 36px;
} }
......
<style> <style>
.w-100 { .emoji-picker {
width: 100%; display: flex;
flex-direction: column;
height: calc(100vh - 20px);
margin: 10px;
margin-top: 0;
width: calc(100vw - 20px);
} }
.emoji-picker { #search {
max-height: 343px; display: none;
min-height: 343px;
width: calc(36px * 7);
} }
.emoji-tabs { .emoji-tabs {
display: flex; display: flex;
flex-shrink: 0;
overflow-x: scroll; overflow-x: scroll;
width: 100%; width: 100%;
} }
.emoji-groups { .emoji-groups {
max-height: 400px; flex-grow: 1;
overflow-y: scroll; overflow-y: scroll;
} }
</style> </style>
......
...@@ -59,7 +59,7 @@ export class EmojiPicker extends PolymerElement { ...@@ -59,7 +59,7 @@ export class EmojiPicker extends PolymerElement {
// TODO(https://crbug.com/1164828): replace placeholder frequently used // TODO(https://crbug.com/1164828): replace placeholder frequently used
// data. // data.
this.history = { this.history = {
'group': 'Frequently used', 'group': 'Recently Used',
'emoji': [ 'emoji': [
{ {
'base': [128512], 'base': [128512],
......
...@@ -6,7 +6,15 @@ ...@@ -6,7 +6,15 @@
<script type="module" src="emoji_picker.js"></script> <script type="module" src="emoji_picker.js"></script>
<style> <style>
* { * {
font-family: sans-serif; font-family: 'Roboto', sans-serif;
}
body {
margin: 0;
/* these sizes for testing on chrome://emoji-picker.
* dialog window size is set in code.
*/
max-height: 343px;
max-width: 280px;
} }
</style> </style>
</head> </head>
......
...@@ -25,7 +25,7 @@ ui::ModalType EmojiPickerDialog::GetDialogModalType() const { ...@@ -25,7 +25,7 @@ ui::ModalType EmojiPickerDialog::GetDialogModalType() const {
} }
base::string16 EmojiPickerDialog::GetDialogTitle() const { base::string16 EmojiPickerDialog::GetDialogTitle() const {
return base::UTF8ToUTF16("Emoji picker"); return base::UTF8ToUTF16("Emoji Picker");
} }
GURL EmojiPickerDialog::GetDialogContentURL() const { GURL EmojiPickerDialog::GetDialogContentURL() const {
...@@ -36,8 +36,8 @@ void EmojiPickerDialog::GetWebUIMessageHandlers( ...@@ -36,8 +36,8 @@ void EmojiPickerDialog::GetWebUIMessageHandlers(
std::vector<content::WebUIMessageHandler*>* handlers) const {} std::vector<content::WebUIMessageHandler*>* handlers) const {}
void EmojiPickerDialog::GetDialogSize(gfx::Size* size) const { void EmojiPickerDialog::GetDialogSize(gfx::Size* size) const {
const int kDefaultWidth = 544; const int kDefaultWidth = 280;
const int kDefaultHeight = 628; const int kDefaultHeight = 343;
size->SetSize(kDefaultWidth, kDefaultHeight); size->SetSize(kDefaultWidth, kDefaultHeight);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment