summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--views/controls/button/button_dropdown.cc12
-rw-r--r--views/view.h12
-rw-r--r--views/views.gyp1
3 files changed, 12 insertions, 13 deletions
diff --git a/views/controls/button/button_dropdown.cc b/views/controls/button/button_dropdown.cc
index 92a24ab..f12e276 100644
--- a/views/controls/button/button_dropdown.cc
+++ b/views/controls/button/button_dropdown.cc
@@ -81,15 +81,10 @@ bool ButtonDropDown::OnMouseDragged(const MouseEvent& e) {
bool result = ImageButton::OnMouseDragged(e);
if (!show_menu_factory_.empty()) {
- // SM_CYDRAG is a pixel value for minimum dragging distance before operation
- // counts as a drag, and not just as a click and accidental move of a mouse.
- // See http://msdn2.microsoft.com/en-us/library/ms724385.aspx for details.
- int dragging_threshold = GetSystemMetrics(SM_CYDRAG);
-
// If the mouse is dragged to a y position lower than where it was when
// clicked then we should not wait for the menu to appear but show
// it immediately.
- if (e.y() > y_position_on_lbuttondown_ + dragging_threshold) {
+ if (e.y() > y_position_on_lbuttondown_ + GetHorizontalDragThreshold()) {
show_menu_factory_.RevokeAll();
ShowDropDownMenu(GetWidget()->GetNativeView());
}
@@ -133,7 +128,12 @@ void ButtonDropDown::ShowDropDownMenu(gfx::NativeView window) {
View::ConvertPointToScreen(this, &menu_position);
+#if defined(OS_WIN)
int left_bound = GetSystemMetrics(SM_XVIRTUALSCREEN);
+#else
+ int left_bound = 0;
+ NOTIMPLEMENTED();
+#endif
if (menu_position.x() < left_bound)
menu_position.set_x(left_bound);
diff --git a/views/view.h b/views/view.h
index 8612248..760192f 100644
--- a/views/view.h
+++ b/views/view.h
@@ -1020,6 +1020,12 @@ class View : public AcceleratorTarget {
// by us.
bool InDrag();
+ // Returns how much the mouse needs to move in one direction to start a
+ // drag. These methods cache in a platform-appropriate way. These values are
+ // used by the public static method ExceededDragThreshold().
+ static int GetHorizontalDragThreshold();
+ static int GetVerticalDragThreshold();
+
// Whether this view is enabled.
bool enabled_;
@@ -1051,12 +1057,6 @@ class View : public AcceleratorTarget {
int start_y;
};
- // Returns how much the mouse needs to move in one direction to start a
- // drag. These methods cache in a platform-appropriate way. These values are
- // used by the public static method ExceededDragThreshold().
- static int GetHorizontalDragThreshold();
- static int GetVerticalDragThreshold();
-
// RootView invokes these. These in turn invoke the appropriate OnMouseXXX
// method. If a drag is detected, DoDrag is invoked.
bool ProcessMousePressed(const MouseEvent& e, DragInfo* drop_info);
diff --git a/views/views.gyp b/views/views.gyp
index 69ed7a1..786bbff 100644
--- a/views/views.gyp
+++ b/views/views.gyp
@@ -237,7 +237,6 @@
'accessibility/view_accessibility.cc',
'accessibility/view_accessibility_wrapper.cc',
'controls/scrollbar/bitmap_scroll_bar.cc',
- 'controls/button/button_dropdown.cc',
'controls/button/radio_button.cc',
'controls/combo_box.cc',
'controls/hwnd_view.cc',