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

Unified Diff: ui/message_center/cocoa/notification_controller.mm

Issue 13560002: Added padding below text in notifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implemented review suggestions. Created 7 years, 8 months 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 | « no previous file | ui/message_center/message_center_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/cocoa/notification_controller.mm
diff --git a/ui/message_center/cocoa/notification_controller.mm b/ui/message_center/cocoa/notification_controller.mm
index d3e8c77799b5afe47dfe8ce64174e925d4dccf5e..fe31eeb33cbd4bec9764849a6e62b75cd6519a77 100644
--- a/ui/message_center/cocoa/notification_controller.mm
+++ b/ui/message_center/cocoa/notification_controller.mm
@@ -14,6 +14,12 @@
#include "ui/message_center/notification.h"
#include "ui/message_center/notification_change_observer.h"
+namespace {
+
+// Compensates for padding already provided by UI elements involved.
+const int kTextTopPaddingAdjustment = -6;
+
+} // namespace
@interface MCNotificationController (Private)
// Configures a NSBox to be borderless, titleless, and otherwise appearance-
// free.
@@ -79,9 +85,11 @@
// In this basic notification UI, the message body is the bottom-most
// vertical element. If it is out of the rootView's bounds, resize the view.
- if (NSMinY([message_ frame]) < message_center::kTextTopPadding) {
- rootFrame.size.height += message_center::kTextTopPadding -
- NSMinY([message_ frame]);
+ if (NSMinY([message_ frame]) <
+ message_center::kTextTopPadding + kTextTopPaddingAdjustment) {
+ rootFrame.size.height += message_center::kTextTopPadding +
+ kTextTopPaddingAdjustment -
+ NSMinY([message_ frame]);
}
[rootView setFrame:rootFrame];
@@ -159,7 +167,8 @@
CGFloat delta =
[GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:title_];
frame.size.height = delta;
- frame.origin.y = NSMaxY(rootFrame) - message_center::kTextTopPadding - delta;
+ frame.origin.y = NSMaxY(rootFrame) - message_center::kTextTopPadding +
+ kTextTopPaddingAdjustment - delta;
[title_ setFrame:frame];
}
@@ -175,7 +184,8 @@
CGFloat delta =
[GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:message_];
frame.size.height = delta;
- frame.origin.y = maxY - message_center::kTextTopPadding - delta;
+ frame.origin.y = maxY - message_center::kTextTopPadding +
+ kTextTopPaddingAdjustment - delta;
[message_ setFrame:frame];
}
« no previous file with comments | « no previous file | ui/message_center/message_center_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698