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

Unified Diff: chrome/browser/notifications/balloon_collection_gtk.cc

Issue 8503037: Fix the problem that notifications and panels overlap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for MacOSX Created 9 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
Index: chrome/browser/notifications/balloon_collection_gtk.cc
diff --git a/chrome/browser/notifications/balloon_collection_gtk.cc b/chrome/browser/notifications/balloon_collection_gtk.cc
index 2420735f72016bcb90b005615545ae8ed5203de6..c6453e98f9137e260a604ddef629e8a5e31f16b7 100644
--- a/chrome/browser/notifications/balloon_collection_gtk.cc
+++ b/chrome/browser/notifications/balloon_collection_gtk.cc
@@ -35,6 +35,39 @@ int BalloonCollectionImpl::Layout::VerticalEdgeMargin() const {
return 5;
}
+gfx::Point BalloonCollectionImpl::Layout::GetLayoutOrigin() const {
+ int x = 0;
+ int y = 0;
+ switch (placement_) {
+ case VERTICALLY_FROM_TOP_LEFT:
+ x = work_area_.x() + HorizontalEdgeMargin();
+ y = work_area_.y() + VerticalEdgeMargin();
+ break;
+ case VERTICALLY_FROM_TOP_RIGHT:
+ x = work_area_.right() - HorizontalEdgeMargin();
+ y = work_area_.y() + VerticalEdgeMargin();
+ break;
+ case VERTICALLY_FROM_BOTTOM_LEFT:
+ x = work_area_.x() + HorizontalEdgeMargin();
+ // For this placement, balloon needs to stay on top of left-most panels
+ // to avoid overlapping.
+ y = work_area_.bottom() - VerticalEdgeMargin() -
+ bottom_left_offset_to_move_above_panels_;
+ break;
+ case VERTICALLY_FROM_BOTTOM_RIGHT:
+ x = work_area_.right() - HorizontalEdgeMargin();
+ // For this placement, balloon needs to stay on top of right-most panels
+ // to avoid overlapping.
+ y = work_area_.bottom() - VerticalEdgeMargin() -
+ bottom_right_offset_to_move_above_panels_;
+ break;
+ default:
+ NOTREACHED();
+ break;
+ }
+ return gfx::Point(x, y);
+}
+
void BalloonCollectionImpl::PositionBalloons(bool reposition) {
PositionBalloonsInternal(reposition);
}

Powered by Google App Engine
This is Rietveld 408576698