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

Unified Diff: ui/views/controls/menu/menu_separator_views.cc

Issue 10837317: Setting the touch wrench menu as default menu for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And another merge! Created 8 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 | « ui/views/controls/menu/menu_separator.h ('k') | ui/views/controls/textfield/native_textfield_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_separator_views.cc
diff --git a/ui/views/controls/menu/menu_separator_views.cc b/ui/views/controls/menu/menu_separator_views.cc
index 61ec07d4bd12a2f3318c175e64823ddaf7ce17cc..4d267df6700787c93e337543b2f27a43e62f7223 100644
--- a/ui/views/controls/menu/menu_separator_views.cc
+++ b/ui/views/controls/menu/menu_separator_views.cc
@@ -18,14 +18,36 @@ const int kSeparatorHeight = 1;
namespace views {
void MenuSeparator::OnPaint(gfx::Canvas* canvas) {
- canvas->FillRect(gfx::Rect(0, height() / 2, width(), kSeparatorHeight),
+ int pos = 0;
+ if (type_ == ui::LOWER_SEPARATOR)
+ pos = height() - kSeparatorHeight;
+ else if (type_ != ui::SPACING_SEPARATOR)
+ pos = height() / 2;
+ else if (type_ != ui::UPPER_SEPARATOR)
+ return;
+ canvas->FillRect(gfx::Rect(0, pos, width(), kSeparatorHeight),
ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_MenuSeparatorColor));
+ ui::NativeTheme::kColorId_MenuSeparatorColor));
}
gfx::Size MenuSeparator::GetPreferredSize() {
+ int height = MenuConfig::instance().separator_height;
+ switch(type_) {
+ case ui::SPACING_SEPARATOR:
+ height = MenuConfig::instance().separator_spacing_height;
+ break;
+ case ui::LOWER_SEPARATOR:
+ height = MenuConfig::instance().separator_lower_height;
+ break;
+ case ui::UPPER_SEPARATOR:
+ height = MenuConfig::instance().separator_upper_height;
+ break;
+ default:
+ height = MenuConfig::instance().separator_height;
+ break;
+ }
return gfx::Size(10, // Just in case we're the only item in a menu.
- MenuConfig::instance().separator_height);
+ height);
}
} // namespace views
« no previous file with comments | « ui/views/controls/menu/menu_separator.h ('k') | ui/views/controls/textfield/native_textfield_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698