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

Unified Diff: ui/views/controls/label.cc

Issue 231643002: Added labels under the windows in OverviewMode displaying their current name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits, added transparency Created 6 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
« ui/views/controls/label.h ('K') | « ui/views/controls/label.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index cadd40bdbed69ddacebe9587d1bd9aa5ca4cf5dd..73ed7af94ff609efe7aca245301ae65bd19c77f5 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -115,6 +115,14 @@ void Label::SetShadowOffset(int x, int y) {
shadow_offset_.SetPoint(x, y);
}
+void Label::SetMirrorShadow(bool mirror_shadow) {
+ mirror_shadow_ = mirror_shadow;
+}
+
+void Label::SetShadowBlur(double shadow_blur) {
+ shadow_blur_ = shadow_blur;
+}
+
void Label::ClearEmbellishing() {
has_shadow_ = false;
}
@@ -322,9 +330,22 @@ void Label::PaintText(gfx::Canvas* canvas,
const gfx::Rect& text_bounds,
int flags) {
gfx::ShadowValues shadows;
- if (has_shadow_)
- shadows.push_back(gfx::ShadowValue(shadow_offset_, 0,
+ if (has_shadow_) {
+ shadows.push_back(gfx::ShadowValue(shadow_offset_, shadow_blur_,
enabled() ? enabled_shadow_color_ : disabled_shadow_color_));
+ if (mirror_shadow_) {
+ gfx::Point shadow_point = shadow_offset_;
+ shadow_point.set_x(-shadow_point.x());
+ shadows.push_back(gfx::ShadowValue(shadow_point, shadow_blur_,
+ enabled() ? enabled_shadow_color_ : disabled_shadow_color_));
+ shadow_point.set_y(-shadow_point.y());
+ shadows.push_back(gfx::ShadowValue(shadow_point, shadow_blur_,
+ enabled() ? enabled_shadow_color_ : disabled_shadow_color_));
+ shadow_point.set_x(-shadow_point.x());
+ shadows.push_back(gfx::ShadowValue(shadow_point, shadow_blur_,
+ enabled() ? enabled_shadow_color_ : disabled_shadow_color_));
flackr 2014/04/14 20:31:18 I'm concerned that this effect may not be necessar
Nina 2014/04/15 15:15:03 Good point! Yes, it works that way, so I removed t
+ }
+ }
canvas->DrawStringRectWithShadows(text, font_list_,
enabled() ? actual_enabled_color_ : actual_disabled_color_,
text_bounds, line_height_, flags, shadows);
@@ -398,6 +419,8 @@ void Label::Init(const base::string16& text, const gfx::FontList& font_list) {
disabled_shadow_color_ = 0;
shadow_offset_.SetPoint(1, 1);
has_shadow_ = false;
+ shadow_blur_ = 0;
+ mirror_shadow_ = false;
cached_heights_.resize(kCachedSizeLimit);
ResetCachedSize();
« ui/views/controls/label.h ('K') | « ui/views/controls/label.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698