OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "views/controls/single_split_view.h" | 5 #include "views/controls/single_split_view.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <gdk/gdk.h> | 8 #include <gdk/gdk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 width += kDividerSize; | 87 width += kDividerSize; |
88 else | 88 else |
89 height += kDividerSize; | 89 height += kDividerSize; |
90 return gfx::Size(width, height); | 90 return gfx::Size(width, height); |
91 } | 91 } |
92 | 92 |
93 gfx::NativeCursor SingleSplitView::GetCursorForPoint(Event::EventType event_type
, | 93 gfx::NativeCursor SingleSplitView::GetCursorForPoint(Event::EventType event_type
, |
94 int x, int y) { | 94 int x, int y) { |
95 if (IsPointInDivider(x, y)) { | 95 if (IsPointInDivider(x, y)) { |
96 #if defined(OS_WIN) | 96 #if defined(OS_WIN) |
97 static HCURSOR resize_cursor = LoadCursor(NULL, | 97 static HCURSOR we_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); |
98 is_horizontal_ ? IDC_SIZEWE : IDC_SIZENS); | 98 static HCURSOR ns_resize_cursor = LoadCursor(NULL, IDC_SIZENS); |
99 return resize_cursor; | 99 return is_horizontal_ ? we_resize_cursor : ns_resize_cursor; |
100 #elif defined(OS_LINUX) | 100 #elif defined(OS_LINUX) |
101 return gdk_cursor_new(is_horizontal_ ? | 101 return gdk_cursor_new(is_horizontal_ ? |
102 GDK_SB_H_DOUBLE_ARROW : | 102 GDK_SB_H_DOUBLE_ARROW : |
103 GDK_SB_V_DOUBLE_ARROW); | 103 GDK_SB_V_DOUBLE_ARROW); |
104 #endif | 104 #endif |
105 } | 105 } |
106 return NULL; | 106 return NULL; |
107 } | 107 } |
108 | 108 |
109 bool SingleSplitView::OnMousePressed(const MouseEvent& event) { | 109 bool SingleSplitView::OnMousePressed(const MouseEvent& event) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 divider_relative_offset = | 159 divider_relative_offset = |
160 x - GetChildViewAt(UILayoutIsRightToLeft() ? 1 : 0)->width(); | 160 x - GetChildViewAt(UILayoutIsRightToLeft() ? 1 : 0)->width(); |
161 } else { | 161 } else { |
162 divider_relative_offset = y - GetChildViewAt(0)->height(); | 162 divider_relative_offset = y - GetChildViewAt(0)->height(); |
163 } | 163 } |
164 return (divider_relative_offset >= 0 && | 164 return (divider_relative_offset >= 0 && |
165 divider_relative_offset < kDividerSize); | 165 divider_relative_offset < kDividerSize); |
166 } | 166 } |
167 | 167 |
168 } // namespace views | 168 } // namespace views |
OLD | NEW |