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

Unified Diff: views/controls/menu/submenu_view.h

Issue 7491083: Implemented nicer battery status (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 9 years, 4 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/menu/menu_item_view_win.cc ('k') | views/controls/menu/submenu_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/submenu_view.h
diff --git a/views/controls/menu/submenu_view.h b/views/controls/menu/submenu_view.h
index 037efbc104edc3382b170df6dccffdefe0f6c14e..e176ac97f2dfba5cc27e3626c4c8925539111acb 100644
--- a/views/controls/menu/submenu_view.h
+++ b/views/controls/menu/submenu_view.h
@@ -136,6 +136,12 @@ class VIEWS_EXPORT SubmenuView : public View {
minimum_preferred_width_ = minimum_preferred_width;
}
+ // Automatically resize menu if a subview's preferred size changes.
+ bool resize_open_menu() const { return resize_open_menu_; }
+ void set_resize_open_menu(bool resize_open_menu) {
+ resize_open_menu_ = resize_open_menu;
+ }
+
// Padding around the edges of the submenu.
static const int kSubmenuBorderSize;
@@ -147,6 +153,7 @@ class VIEWS_EXPORT SubmenuView : public View {
// scrolling occurs, everything is repainted correctly.
virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE;
+ virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
private:
// Paints the drop indicator. This is only invoked if item is non-NULL and
@@ -185,6 +192,9 @@ class VIEWS_EXPORT SubmenuView : public View {
// Minimum width returned in GetPreferredSize().
int minimum_preferred_width_;
+ // Reposition open menu when contained views change size.
+ bool resize_open_menu_;
+
DISALLOW_COPY_AND_ASSIGN(SubmenuView);
};
« no previous file with comments | « views/controls/menu/menu_item_view_win.cc ('k') | views/controls/menu/submenu_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698