Chromium Code Reviews| Index: ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc |
| diff --git a/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc b/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc |
| index 63eadf15bd9cc6aeeabf12619078ceae386b492d..625e7b7a78586add07e3524af13862dcd1b4538e 100644 |
| --- a/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc |
| +++ b/ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc |
| @@ -4,6 +4,7 @@ |
| #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h" |
| +#include "ash/shelf/shelf.h" |
| #include "ash/shelf/shelf_constants.h" |
| #include "ash/shell.h" |
| #include "ash/system/status_area_widget.h" |
| @@ -44,7 +45,11 @@ VirtualKeyboardButton::~VirtualKeyboardButton() { |
| gfx::Size VirtualKeyboardButton::GetPreferredSize() const { |
| const int virtual_keyboard_button_height = kShelfSize; |
| gfx::Size size = ImageButton::GetPreferredSize(); |
| - int padding = virtual_keyboard_button_height - size.height(); |
| + Shelf *shelf = Shelf::ForPrimaryDisplay(); |
|
sadrul
2014/07/31 21:18:52
Shelf* shelf = ...
kevers
2014/08/01 15:21:40
Done.
|
| + bool isHorizontal = shelf && (shelf->alignment() == SHELF_ALIGNMENT_BOTTOM || |
|
sadrul
2014/07/31 21:18:52
is_horizontal
kevers
2014/08/01 15:21:40
Done.
|
| + shelf->alignment() == SHELF_ALIGNMENT_TOP); |
| + int padding = isHorizontal ? virtual_keyboard_button_height - size.height() : |
| + 0; |
| size.set_height(virtual_keyboard_button_height); |
| size.set_width(size.width() + padding); |
|
sadrul
2014/07/31 21:18:52
Why do we add this padding?
kevers
2014/08/01 15:21:40
The a11y button is detached form the remaining con
|
| return size; |