summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_action.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 03:21:40 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 03:21:40 +0000
commit50c73bd0cd9ee2dcb7e31cd08992c19a7043fe29 (patch)
tree809ab4106578beb7501a66017935356694eea115 /chrome/common/extensions/extension_action.cc
parent114b1e2877f41fa84b22c7c586eac890d392e939 (diff)
downloadchromium_src-50c73bd0cd9ee2dcb7e31cd08992c19a7043fe29.zip
chromium_src-50c73bd0cd9ee2dcb7e31cd08992c19a7043fe29.tar.gz
chromium_src-50c73bd0cd9ee2dcb7e31cd08992c19a7043fe29.tar.bz2
GTK: touch up appearance of browser actions badge.
Also don't show empty browser action tooltips. BUG=26023 Review URL: http://codereview.chromium.org/341016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_action.cc')
-rwxr-xr-xchrome/common/extensions/extension_action.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/common/extensions/extension_action.cc b/chrome/common/extensions/extension_action.cc
index 4a649a7..7549152 100755
--- a/chrome/common/extensions/extension_action.cc
+++ b/chrome/common/extensions/extension_action.cc
@@ -26,8 +26,8 @@ void ExtensionAction::ClearAllValuesForTab(int tab_id) {
}
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 @@ void ExtensionAction::PaintBadge(gfx::Canvas* canvas,
// 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;
+ const int kBadgeHeight = 11;
const int kMaxTextWidth = 23;
// The minimum width for center-aligning the badge.
const int kCenterAlignThreshold = 20;
@@ -54,6 +55,8 @@ void ExtensionAction::PaintBadge(gfx::Canvas* canvas,
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 @@ void ExtensionAction::PaintBadge(gfx::Canvas* canvas,
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();
}