Commit 99d123d6 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

shelf: Hide navigation widget background when buttons are hidden

If no buttons are shown in the shelf navigation widget, we should hide
the widget background, too.

BUG=1012814

Change-Id: I6763c6719d256b2b07b74c06948af96074ae4851
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2025636Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736007}
parent 4e6d6b32
......@@ -1639,6 +1639,7 @@ void ShelfLayoutManager::CalculateTargetBounds(
// Enlarge the widget to take up available space, this ensures events which
// are outside of the HomeButton bounds can be received.
if (!nav_size.IsEmpty())
nav_size.Enlarge(home_button_edge_spacing, home_button_edge_spacing);
if (shelf_->IsHorizontalAlignment() && base::i18n::IsRTL())
......
......@@ -173,11 +173,18 @@ void ShelfNavigationWidget::Delegate::Init(ui::Layer* parent_layer) {
void ShelfNavigationWidget::Delegate::UpdateOpaqueBackground() {
opaque_background_.SetColor(ShelfConfig::Get()->GetShelfControlButtonColor());
// Hide background if no buttons should be shown.
if (!IsHomeButtonShown() && !IsBackButtonShown()) {
opaque_background_.SetVisible(false);
return;
}
if (chromeos::switches::ShouldShowShelfHotseat() && IsTabletMode() &&
ShelfConfig::Get()->is_in_app()) {
opaque_background_.SetVisible(false);
return;
}
opaque_background_.SetVisible(true);
int radius = ShelfConfig::Get()->control_border_radius();
......
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