Commit 3e3220d4 authored by Blake O'Hare's avatar Blake O'Hare Committed by Commit Bot

Add virtual keyboard offset to tray bubble sliders for volume/brightness

If you adjust the volume while the virtual keyboard is loaded, the
slider will be hidden underneath the keyboard.

Bug: 836155
Change-Id: Ia4f4c116906f80058772decc8420c8021f463aa6
Reviewed-on: https://chromium-review.googlesource.com/1096585Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarStefan Kuhne <skuhne@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: default avatarYuichiro Hanada <yhanada@chromium.org>
Commit-Queue: Blake O'Hare <blakeo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567923}
parent 9e20e8d0
......@@ -202,6 +202,8 @@ class ASH_EXPORT ShelfLayoutManager
// panel height. The Docked Magnifier appears above the ChromeVox panel.
void SetDockedMagnifierHeight(int height);
gfx::Rect keyboard_bounds() const { return keyboard_bounds_; }
private:
class UpdateShelfObserver;
friend class PanelLayoutManagerTest;
......
......@@ -14,6 +14,7 @@
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/system/status_area_widget.h"
......@@ -475,8 +476,14 @@ gfx::Insets TrayBackgroundView::GetBubbleAnchorInsets() const {
gfx::Insets anchor_insets = GetBubbleAnchor()->GetInsets();
gfx::Insets tray_bg_insets = GetInsets();
if (GetAnchorAlignment() == TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM) {
return gfx::Insets(-tray_bg_insets.top(), anchor_insets.left(),
-tray_bg_insets.bottom(), anchor_insets.right());
// TODO(blakeo): There are minor variances in padding depending on if the
// keyboard is in anchored accessibility mode or in regular mode.
const gfx::Rect keyboard_occluding_bounds =
shelf_->shelf_layout_manager()->keyboard_bounds();
int keyboard_offset = keyboard_occluding_bounds.height();
return gfx::Insets(-tray_bg_insets.top() - keyboard_offset,
anchor_insets.left(), -tray_bg_insets.bottom(),
anchor_insets.right());
} else {
return gfx::Insets(anchor_insets.top(), -tray_bg_insets.left(),
anchor_insets.bottom(), -tray_bg_insets.right());
......
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