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

Unified Diff: ui/views/bubble/bubble_border.h

Issue 12310022: More flexibility in BubbleBorder arrow rendering. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address msw style nits. Created 7 years, 10 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
Index: ui/views/bubble/bubble_border.h
diff --git a/ui/views/bubble/bubble_border.h b/ui/views/bubble/bubble_border.h
index 78ba6cdcdb17e0dee8709acc44d027601737766a..ce07881bb4d2064a5d799528b55bbcb1fa410115 100644
--- a/ui/views/bubble/bubble_border.h
+++ b/ui/views/bubble/bubble_border.h
@@ -65,6 +65,16 @@ class VIEWS_EXPORT BubbleBorder : public Border {
ALIGN_EDGE_TO_ANCHOR_EDGE
};
+ // The way the arrow should be painted.
+ enum ArrowPaintType {
+ // Fully render the arrow.
+ PAINT_NORMAL,
+ // Leave space for the arrow, but do not paint it.
+ PAINT_TRANSPARENT,
+ // Neither paint nor leave space for the arrow.
+ PAINT_NONE,
+ };
+
BubbleBorder(ArrowLocation arrow, Shadow shadow, SkColor color);
// Returns the radius of the corner of the border.
@@ -130,9 +140,8 @@ class VIEWS_EXPORT BubbleBorder : public Border {
// location to make that happen.
void set_arrow_offset(int offset) { override_arrow_offset_ = offset; }
- // Sets whether the arrow is actually painted. If false, an arrow may still be
- // used for the geometry computations, but it is not shown. Default is true.
- void set_paint_arrow(bool value) { paint_arrow_ = value; }
+ // Sets the way the arrow is actually painted. Default is PAINT_NORMAL.
+ void set_paint_arrow(ArrowPaintType value) { arrow_paint_type_ = value; }
// For borders with an arrow, gives the desired bounds (in screen coordinates)
// given the rect to point to and the size of the contained contents. This
@@ -167,6 +176,8 @@ class VIEWS_EXPORT BubbleBorder : public Border {
// Loads images if necessary.
static BorderImages* GetBorderImages(Shadow shadow);
+ int GetArrowSize() const;
+
// Overridden from Border:
virtual void Paint(const View& view, gfx::Canvas* canvas) OVERRIDE;
@@ -195,8 +206,7 @@ class VIEWS_EXPORT BubbleBorder : public Border {
int override_arrow_offset_;
ArrowLocation arrow_location_;
- // See description above setter.
- bool paint_arrow_;
+ ArrowPaintType arrow_paint_type_;
BubbleAlignment alignment_;
SkColor background_color_;
« no previous file with comments | « chrome/browser/ui/views/message_center/notification_bubble_wrapper_win.cc ('k') | ui/views/bubble/bubble_border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698