Index: ash/shelf/overflow_button.cc |
diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc |
index 3abaa424eb082e4fa8d4f2a2de01c79ac830eaef..3c899efd81a0aa4f8e6df45e2c89bc581c3b7506 100644 |
--- a/ash/shelf/overflow_button.cc |
+++ b/ash/shelf/overflow_button.cc |
@@ -90,35 +90,56 @@ |
ShelfAlignment alignment = layout_manager->GetAlignment(); |
gfx::Rect bounds(GetContentsBounds()); |
- ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
- int background_image_id = 0; |
- if (layout_manager->shelf_widget()->shelf()->IsShowingOverflowBubble()) |
- background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; |
- else if(layout_manager->shelf_widget()->GetDimsShelf()) |
- background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK; |
- else |
- background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL; |
+ if (ash::switches::UseAlternateShelfLayout()) { |
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
+ int background_image_id = 0; |
+ if (layout_manager->shelf_widget()->shelf()->IsShowingOverflowBubble()) |
+ background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED; |
+ else if(layout_manager->shelf_widget()->GetDimsShelf()) |
+ background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK; |
+ else |
+ background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_NORMAL; |
- const gfx::ImageSkia* background = |
- rb.GetImageNamed(background_image_id).ToImageSkia(); |
- if (alignment == SHELF_ALIGNMENT_LEFT) { |
- bounds = gfx::Rect( |
- bounds.right() - background->width() - |
- ShelfLayoutManager::kShelfItemInset, |
- bounds.y() + (bounds.height() - background->height()) / 2, |
- background->width(), background->height()); |
- } else if (alignment == SHELF_ALIGNMENT_RIGHT) { |
- bounds = gfx::Rect( |
- bounds.x() + ShelfLayoutManager::kShelfItemInset, |
- bounds.y() + (bounds.height() - background->height()) / 2, |
- background->width(), background->height()); |
+ const gfx::ImageSkia* background = |
+ rb.GetImageNamed(background_image_id).ToImageSkia(); |
+ if (alignment == SHELF_ALIGNMENT_LEFT) { |
+ bounds = gfx::Rect( |
+ bounds.right() - background->width() - |
+ ShelfLayoutManager::kShelfItemInset, |
+ bounds.y() + (bounds.height() - background->height()) / 2, |
+ background->width(), background->height()); |
+ } else if (alignment == SHELF_ALIGNMENT_RIGHT) { |
+ bounds = gfx::Rect( |
+ bounds.x() + ShelfLayoutManager::kShelfItemInset, |
+ bounds.y() + (bounds.height() - background->height()) / 2, |
+ background->width(), background->height()); |
+ } else { |
+ bounds = gfx::Rect( |
+ bounds.x() + (bounds.width() - background->width()) / 2, |
+ bounds.y() + ShelfLayoutManager::kShelfItemInset, |
+ background->width(), background->height()); |
+ } |
+ canvas->DrawImageInt(*background, bounds.x(), bounds.y()); |
} else { |
- bounds = gfx::Rect( |
- bounds.x() + (bounds.width() - background->width()) / 2, |
- bounds.y() + ShelfLayoutManager::kShelfItemInset, |
- background->width(), background->height()); |
+ if (alignment == SHELF_ALIGNMENT_BOTTOM) { |
+ bounds = gfx::Rect( |
+ bounds.x() + ((bounds.width() - kButtonHoverSize) / 2) - 1, |
+ bounds.y() + kBackgroundOffset - 1, |
+ kButtonHoverSize, kButtonHoverSize); |
+ } else { |
+ bounds = gfx::Rect( |
+ bounds.x() + kBackgroundOffset -1, |
+ bounds.y() + ((bounds.height() - kButtonHoverSize) / 2) -1, |
+ kButtonHoverSize, kButtonHoverSize); |
+ } |
+ if (hover_animation_->is_animating()) { |
+ PaintBackground( |
+ canvas, |
+ kButtonHoverAlpha * hover_animation_->GetCurrentValue()); |
+ } else if (state() == STATE_HOVERED || state() == STATE_PRESSED) { |
+ PaintBackground(canvas, kButtonHoverAlpha); |
+ } |
} |
- canvas->DrawImageInt(*background, bounds.x(), bounds.y()); |
if (height() < kButtonHoverSize) |
return; |