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

Unified Diff: ash/common/system/chromeos/palette/palette_tray.cc

Issue 2491033006: Adjust positioning of cros tray bubbles. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « ash/common/system/chromeos/palette/palette_tray.h ('k') | ash/common/system/tray/system_tray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/chromeos/palette/palette_tray.cc
diff --git a/ash/common/system/chromeos/palette/palette_tray.cc b/ash/common/system/chromeos/palette/palette_tray.cc
index 9e52bea400008e4c6f3e3c67a3997e40f2926f68..a2eac7188129083d086130a76aea7d9cdc332495 100644
--- a/ash/common/system/chromeos/palette/palette_tray.cc
+++ b/ash/common/system/chromeos/palette/palette_tray.cc
@@ -212,10 +212,8 @@ bool PaletteTray::ShowPalette() {
DCHECK(tray_container());
- views::TrayBubbleView::InitParams init_params(
- views::TrayBubbleView::ANCHOR_TYPE_TRAY, GetAnchorAlignment(),
- kPaletteWidth, kPaletteWidth);
- init_params.first_item_has_no_margin = true;
+ views::TrayBubbleView::InitParams init_params(GetAnchorAlignment(),
+ kPaletteWidth, kPaletteWidth);
init_params.can_activate = true;
init_params.close_on_deactivate = true;
@@ -231,8 +229,8 @@ bool PaletteTray::ShowPalette() {
// Create and customize bubble view.
views::TrayBubbleView* bubble_view =
- views::TrayBubbleView::Create(tray_container(), this, &init_params);
- bubble_view->SetArrowPaintType(views::BubbleBorder::PAINT_NONE);
+ views::TrayBubbleView::Create(GetBubbleAnchor(), this, &init_params);
+ bubble_view->set_anchor_view_insets(GetBubbleAnchorInsets());
bubble_view->set_margins(
gfx::Insets(kPalettePaddingOnTop, 0, kPalettePaddingOnBottom, 0));
@@ -311,31 +309,6 @@ base::string16 PaletteTray::GetAccessibleNameForBubble() {
return GetAccessibleNameForTray();
}
-gfx::Rect PaletteTray::GetAnchorRect(
- views::Widget* anchor_widget,
- views::TrayBubbleView::AnchorType anchor_type,
- views::TrayBubbleView::AnchorAlignment anchor_alignment) const {
- gfx::Rect r =
- GetBubbleAnchorRect(anchor_widget, anchor_type, anchor_alignment);
-
- // Move the palette to the left so the right edge of the palette aligns with
- // the right edge of the tray button.
- if (IsHorizontalAlignment(shelf_alignment())) {
- // TODO(jdufault): Figure out a more robust adjustment method that does not
- // break in md-shelf.
- int icon_size = tray_container()->width();
- if (tray_container()->border())
- icon_size -= tray_container()->border()->GetInsets().width();
-
- r.Offset(-r.width() + icon_size + x(), 0);
- } else {
- // Vertical layout doesn't need the border adjustment that horizontal needs.
- r.Offset(0, -r.height() + tray_container()->height());
- }
-
- return r;
-}
-
void PaletteTray::OnBeforeBubbleWidgetInit(
views::Widget* anchor_widget,
views::Widget* bubble_widget,
« no previous file with comments | « ash/common/system/chromeos/palette/palette_tray.h ('k') | ash/common/system/tray/system_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698