diff options
author | dewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-25 21:48:11 +0000 |
---|---|---|
committer | dewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-25 21:48:11 +0000 |
commit | cde5087b2087938bba3e9f0752d7524fe82489d2 (patch) | |
tree | 9100c8b8f6e3b2e0a669f1375e54dfd579afc508 /ash/system | |
parent | f1b1fe087711f52ace6be3204e6bfd63172717c0 (diff) | |
download | chromium_src-cde5087b2087938bba3e9f0752d7524fe82489d2.zip chromium_src-cde5087b2087938bba3e9f0752d7524fe82489d2.tar.gz chromium_src-cde5087b2087938bba3e9f0752d7524fe82489d2.tar.bz2 |
More flexibility in BubbleBorder arrow rendering.
Currently causing the arrow not to be painted leaves a
margin of several pixels on the side the arrow would be
painted, causing issues when laying out bubbles next to an
anchor rectangle such as the edge of the screen.
This patch changes the API so that you can choose whether
the arrow is painted normally, there is space left for the
arrow but it is not painted, or there is no space left for
the arrow and it is not painted.
r=msw@chromium.org,sadrul@chromium.org,ben@chromium.org
BUG=NONE
Review URL: https://chromiumcodereview.appspot.com/12310022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184487 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system')
-rw-r--r-- | ash/system/tray/system_tray.cc | 4 | ||||
-rw-r--r-- | ash/system/tray/tray_background_view.cc | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index dba58c9..6c5da06 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc @@ -375,7 +375,9 @@ void SystemTray::ShowItems(const std::vector<SystemTrayItem*>& items, init_params.arrow_offset = arrow_offset; // For Volume and Brightness we don't want to show an arrow when // they are shown in a bubble by themselves. - init_params.hide_arrow = items.size() == 1 && items[0]->ShouldHideArrow(); + init_params.arrow_paint_type = views::BubbleBorder::PAINT_NORMAL; + if (items.size() == 1 && items[0]->ShouldHideArrow()) + init_params.arrow_paint_type = views::BubbleBorder::PAINT_TRANSPARENT; SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); system_bubble_.reset(new internal::SystemBubbleWrapper(bubble)); system_bubble_->InitView(this, tray_container(), &init_params); diff --git a/ash/system/tray/tray_background_view.cc b/ash/system/tray/tray_background_view.cc index f4c2907..ebe77cd 100644 --- a/ash/system/tray/tray_background_view.cc +++ b/ash/system/tray/tray_background_view.cc @@ -388,7 +388,9 @@ void TrayBackgroundView::UpdateBubbleViewArrow( bubble_view->GetWidget()->GetNativeView()->GetRootWindow(); ash::internal::ShelfLayoutManager* shelf = ash::GetRootWindowController(root_window)->shelf(); - bubble_view->SetPaintArrow(shelf->IsVisible()); + bubble_view->SetArrowPaintType( + shelf->IsVisible() ? views::BubbleBorder::PAINT_NORMAL : + views::BubbleBorder::PAINT_TRANSPARENT); } } // namespace internal |