Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc

Issue 433483002: Fix padding of a11y keyboard indicator when shelf is vertically aligned. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698