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

Side by Side Diff: views/controls/label.cc

Issue 7298009: Labels don't need to respond to mouse clicks and doing so can interfere with button clicks, for e... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/label.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/controls/label.h" 5 #include "views/controls/label.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 void Label::OnEnabledChanged() { 209 void Label::OnEnabledChanged() {
210 View::OnEnabledChanged(); 210 View::OnEnabledChanged();
211 SetColor(IsEnabled() ? kEnabledColor : kDisabledColor); 211 SetColor(IsEnabled() ? kEnabledColor : kDisabledColor);
212 } 212 }
213 213
214 std::string Label::GetClassName() const { 214 std::string Label::GetClassName() const {
215 return kViewClassName; 215 return kViewClassName;
216 } 216 }
217 217
218 bool Label::HitTest(const gfx::Point& l) const {
219 return false;
220 }
221
218 void Label::OnMouseMoved(const MouseEvent& event) { 222 void Label::OnMouseMoved(const MouseEvent& event) {
219 UpdateContainsMouse(event); 223 UpdateContainsMouse(event);
220 } 224 }
221 225
222 void Label::OnMouseEntered(const MouseEvent& event) { 226 void Label::OnMouseEntered(const MouseEvent& event) {
223 UpdateContainsMouse(event); 227 UpdateContainsMouse(event);
224 } 228 }
225 229
226 void Label::OnMouseExited(const MouseEvent& event) { 230 void Label::OnMouseExited(const MouseEvent& event) {
227 SetContainsMouse(false); 231 SetContainsMouse(false);
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 font_, GetAvailableRect().width(), true)); 456 font_, GetAvailableRect().width(), true));
453 } else { 457 } else {
454 *paint_text = UTF16ToWideHack(text_); 458 *paint_text = UTF16ToWideHack(text_);
455 } 459 }
456 460
457 *text_bounds = GetTextBounds(); 461 *text_bounds = GetTextBounds();
458 *flags = ComputeMultiLineFlags(); 462 *flags = ComputeMultiLineFlags();
459 } 463 }
460 464
461 } // namespace views 465 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/label.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698