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

Side by Side Diff: ui/views/shadow_border.h

Issue 82483003: Add GetMinimumSize() for Borders, and make LabelButton auto-size to at least as (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef UI_VIEWS_SHADOW_BORDER_H_ 5 #ifndef UI_VIEWS_SHADOW_BORDER_H_
6 #define UI_VIEWS_SHADOW_BORDER_H_ 6 #define UI_VIEWS_SHADOW_BORDER_H_
7 7
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/views/border.h" 9 #include "ui/views/border.h"
10 #include "ui/views/views_export.h" 10 #include "ui/views/views_export.h"
11 11
12 namespace views { 12 namespace views {
13 13
14 // Creates a css box-shadow like border which fades into SK_ColorTRANSPARENT. 14 // Creates a css box-shadow like border which fades into SK_ColorTRANSPARENT.
15 class VIEWS_EXPORT ShadowBorder : public views::Border { 15 class VIEWS_EXPORT ShadowBorder : public views::Border {
16 public: 16 public:
17 ShadowBorder(int blur, 17 ShadowBorder(int blur,
18 SkColor color, 18 SkColor color,
19 int vertical_offset, 19 int vertical_offset,
20 int horizontal_offset); 20 int horizontal_offset);
21 virtual ~ShadowBorder(); 21 virtual ~ShadowBorder();
22 22
23 protected: 23 protected:
24 // Overridden from views::Border: 24 // Overridden from views::Border:
25 virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE; 25 virtual void Paint(const views::View& view, gfx::Canvas* canvas) OVERRIDE;
26 virtual gfx::Insets GetInsets() const OVERRIDE; 26 virtual gfx::Insets GetInsets() const OVERRIDE;
27 virtual gfx::Size GetMinimumSize() const OVERRIDE;
27 28
28 private: 29 private:
29 // Blur amount of the shadow in pixels. For details on how blur is defined see 30 // Blur amount of the shadow in pixels. For details on how blur is defined see
30 // comments for blur_ in class ShadowValue. 31 // comments for blur_ in class ShadowValue.
31 const int blur_; 32 const int blur_;
32 33
33 // Shadow color. 34 // Shadow color.
34 const SkColor color_; 35 const SkColor color_;
35 36
36 // Number of pixels to shift shadow to bottom. 37 // Number of pixels to shift shadow to bottom.
37 const int vertical_offset_; 38 const int vertical_offset_;
38 39
39 // Number of pixels to shift shadow to right. 40 // Number of pixels to shift shadow to right.
40 const int horizontal_offset_; 41 const int horizontal_offset_;
41 42
42 DISALLOW_COPY_AND_ASSIGN(ShadowBorder); 43 DISALLOW_COPY_AND_ASSIGN(ShadowBorder);
43 }; 44 };
44 45
45 } // namespace views 46 } // namespace views
46 47
47 #endif // UI_VIEWS_SHADOW_BORDER_H_ 48 #endif // UI_VIEWS_SHADOW_BORDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698