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

Unified Diff: views/controls/button/text_button.cc

Issue 6904160: Implement new gray mock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review nits Created 9 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 | « views/controls/button/text_button.h ('k') | views/window/non_client_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/text_button.cc
diff --git a/views/controls/button/text_button.cc b/views/controls/button/text_button.cc
index c5fbdcb703acb02d0de97382c19dd2ac9ccd6ea4..984a4e9bded42b9ddea6ae4e0c9859270a8af4f1 100644
--- a/views/controls/button/text_button.cc
+++ b/views/controls/button/text_button.cc
@@ -265,6 +265,7 @@ TextButtonBase::TextButtonBase(ButtonListener* listener,
active_text_shadow_color_(0),
inactive_text_shadow_color_(0),
has_shadow_(false),
+ shadow_offset_(gfx::Point(1, 1)),
max_width_(0),
normal_has_border_(false),
show_multiple_icon_states_(true),
@@ -329,6 +330,10 @@ void TextButtonBase::SetTextShadowColors(SkColor active_color,
has_shadow_ = true;
}
+void TextButtonBase::SetTextShadowOffset(int x, int y) {
+ shadow_offset_.SetPoint(x, y);
+}
+
void TextButtonBase::ClearMaxTextSize() {
max_text_size_ = text_size_;
}
@@ -341,6 +346,11 @@ void TextButtonBase::SetShowMultipleIconStates(bool show_multiple_icon_states) {
show_multiple_icon_states_ = show_multiple_icon_states;
}
+void TextButtonBase::ClearEmbellishing() {
+ has_shadow_ = false;
+ has_text_halo_ = false;
+}
+
gfx::Size TextButtonBase::GetPreferredSize() {
gfx::Insets insets = GetInsets();
@@ -476,8 +486,8 @@ void TextButtonBase::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
canvas->DrawStringInt(text_,
font_,
shadow_color,
- text_bounds.x() + 1,
- text_bounds.y() + 1,
+ text_bounds.x() + shadow_offset_.x(),
+ text_bounds.y() + shadow_offset_.y(),
text_bounds.width(),
text_bounds.height(),
draw_string_flags);
« no previous file with comments | « views/controls/button/text_button.h ('k') | views/window/non_client_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698