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

Unified Diff: chrome/common/extensions/extension_action.cc

Issue 341016: GTK: touch up appearance of browser actions badge.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome/browser/gtk/browser_actions_toolbar_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_action.cc
===================================================================
--- chrome/common/extensions/extension_action.cc (revision 30311)
+++ chrome/common/extensions/extension_action.cc (working copy)
@@ -26,8 +26,8 @@
}
void ExtensionAction::PaintBadge(gfx::Canvas* canvas,
- const gfx::Rect& bounds,
- int tab_id) {
+ const gfx::Rect& bounds,
+ int tab_id) {
std::string text = GetBadgeText(tab_id);
if (text.empty())
return;
@@ -44,9 +44,10 @@
// Different platforms need slightly different constants to look good.
#if defined(OS_LINUX)
const int kTextSize = 9;
- const int kBottomMargin = 4;
+ const int kBottomMargin = 0;
const int kPadding = 2;
- const int kBadgeHeight = 12;
+ const int kTopTextPadding = 0;
Aaron Boodman 2009/10/28 03:18:12 Weird. I wonder why these are different.
+ const int kBadgeHeight = 11;
const int kMaxTextWidth = 23;
// The minimum width for center-aligning the badge.
const int kCenterAlignThreshold = 20;
@@ -54,6 +55,8 @@
const int kTextSize = 8;
const int kBottomMargin = 5;
const int kPadding = 2;
+ // The padding between the top of the badge and the top of the text.
+ const int kTopTextPadding = 1;
const int kBadgeHeight = 11;
const int kMaxTextWidth = 23;
// The minimum width for center-aligning the badge.
@@ -131,7 +134,7 @@
canvas->clipRect(rect);
canvas->drawText(text.c_str(), text.size(),
rect.fLeft + (rect.width() - text_width) / 2,
- rect.fTop + kTextSize + 1,
+ rect.fTop + kTextSize + kTopTextPadding,
text_paint);
canvas->restore();
}
« no previous file with comments | « chrome/browser/gtk/browser_actions_toolbar_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698