diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/aura_desktop/aura_desktop_main.cc | 2 | ||||
-rw-r--r-- | views/controls/link.cc | 11 | ||||
-rw-r--r-- | views/controls/resize_area.cc | 11 | ||||
-rw-r--r-- | views/controls/single_split_view.cc | 12 | ||||
-rw-r--r-- | views/controls/textfield/native_textfield_views.cc | 12 | ||||
-rw-r--r-- | views/view.cc | 2 |
6 files changed, 31 insertions, 19 deletions
diff --git a/views/aura_desktop/aura_desktop_main.cc b/views/aura_desktop/aura_desktop_main.cc index 033c21a..664d0db 100644 --- a/views/aura_desktop/aura_desktop_main.cc +++ b/views/aura_desktop/aura_desktop_main.cc @@ -41,7 +41,7 @@ class DemoWindowDelegate : public aura::WindowDelegate { return false; } virtual gfx::NativeCursor GetCursor(const gfx::Point& point) OVERRIDE { - return NULL; + return gfx::kNullCursor; } virtual int GetNonClientComponent(const gfx::Point& point) const OVERRIDE { return HTCLIENT; diff --git a/views/controls/link.cc b/views/controls/link.cc index 08f2447..4f71741 100644 --- a/views/controls/link.cc +++ b/views/controls/link.cc @@ -23,6 +23,10 @@ #include "ui/gfx/gtk_util.h" #endif +#if defined(USE_AURA) +#include "ui/aura/cursor.h" +#endif + namespace views { const char Link::kViewClassName[] = "views/Link"; @@ -50,14 +54,13 @@ std::string Link::GetClassName() const { gfx::NativeCursor Link::GetCursor(const MouseEvent& event) { if (!IsEnabled()) return gfx::kNullCursor; -#if defined(OS_WIN) +#if defined(USE_AURA) + return aura::kCursorHand; +#elif defined(OS_WIN) static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); return g_hand_cursor; #elif defined(TOOLKIT_USES_GTK) return gfx::GetCursor(GDK_HAND2); -#else - // TODO(saintlou): - return gfx::kNullCursor; #endif } diff --git a/views/controls/resize_area.cc b/views/controls/resize_area.cc index 242498c..88ac5b5 100644 --- a/views/controls/resize_area.cc +++ b/views/controls/resize_area.cc @@ -13,6 +13,10 @@ #include "ui/gfx/gtk_util.h" #endif +#if defined(USE_AURA) +#include "ui/aura/cursor.h" +#endif + namespace views { const char ResizeArea::kViewClassName[] = "views/ResizeArea"; @@ -35,12 +39,11 @@ std::string ResizeArea::GetClassName() const { gfx::NativeCursor ResizeArea::GetCursor(const MouseEvent& event) { if (!IsEnabled()) return gfx::kNullCursor; -#if defined(OS_WIN) +#if defined(USE_AURA) + return aura::kCursorEastWestResize; +#elif defined(OS_WIN) static HCURSOR g_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); return g_resize_cursor; -#elif defined(USE_AURA) - // TODO(saintlou): - return gfx::kNullCursor; #elif defined(OS_LINUX) return gfx::GetCursor(GDK_SB_H_DOUBLE_ARROW); #endif diff --git a/views/controls/single_split_view.cc b/views/controls/single_split_view.cc index 4e46cfe..d67e113 100644 --- a/views/controls/single_split_view.cc +++ b/views/controls/single_split_view.cc @@ -17,6 +17,10 @@ #include "ui/gfx/gtk_util.h" #endif +#if defined(USE_AURA) +#include "ui/aura/cursor.h" +#endif + namespace views { // static @@ -96,16 +100,16 @@ gfx::Size SingleSplitView::GetPreferredSize() { gfx::NativeCursor SingleSplitView::GetCursor(const MouseEvent& event) { if (!IsPointInDivider(event.location())) return gfx::kNullCursor; -#if defined(OS_WIN) +#if defined(USE_AURA) + return is_horizontal_ ? + aura::kCursorEastWestResize : aura::kCursorNorthSouthResize; +#elif defined(OS_WIN) static HCURSOR we_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); static HCURSOR ns_resize_cursor = LoadCursor(NULL, IDC_SIZENS); return is_horizontal_ ? we_resize_cursor : ns_resize_cursor; #elif defined(TOOLKIT_USES_GTK) return gfx::GetCursor(is_horizontal_ ? GDK_SB_H_DOUBLE_ARROW : GDK_SB_V_DOUBLE_ARROW); -#else - // TODO(saintlou): - return gfx::kNullCursor; #endif } diff --git a/views/controls/textfield/native_textfield_views.cc b/views/controls/textfield/native_textfield_views.cc index 20ebbc7..d2fbb14 100644 --- a/views/controls/textfield/native_textfield_views.cc +++ b/views/controls/textfield/native_textfield_views.cc @@ -37,6 +37,10 @@ #include "ui/gfx/gtk_util.h" #endif +#if defined(USE_AURA) +#include "ui/aura/cursor.h" +#endif + namespace { // Text color for read only. @@ -291,14 +295,12 @@ gfx::NativeCursor NativeTextfieldViews::GetCursor(const MouseEvent& event) { bool in_selection = GetRenderText()->IsPointInSelection(event.location()); bool drag_event = event.type() == ui::ET_MOUSE_DRAGGED; bool text_cursor = !initiating_drag_ && (drag_event || !in_selection); -#if defined(OS_WIN) +#if defined(USE_AURA) + return text_cursor ? aura::kCursorIBeam : aura::kCursorNull; +#elif defined(OS_WIN) static HCURSOR ibeam = LoadCursor(NULL, IDC_IBEAM); static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW); return text_cursor ? ibeam : arrow; -#elif defined(USE_AURA) - // TODO(saintlou): - (void)text_cursor; - return gfx::kNullCursor; #else return text_cursor ? gfx::GetCursor(GDK_XTERM) : NULL; #endif diff --git a/views/view.cc b/views/view.cc index fc1f938..925a40f 100644 --- a/views/view.cc +++ b/views/view.cc @@ -727,7 +727,7 @@ View* View::GetEventHandlerForPoint(const gfx::Point& point) { } gfx::NativeCursor View::GetCursor(const MouseEvent& event) { -#if defined(OS_WIN) +#if defined(OS_WIN) && !defined(USE_AURA) static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW); return arrow; #else |