summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/button/image_button.cc4
-rw-r--r--views/controls/link.cc16
-rw-r--r--views/controls/link.h5
-rw-r--r--views/controls/single_split_view.cc13
-rw-r--r--views/controls/single_split_view.h2
5 files changed, 26 insertions, 14 deletions
diff --git a/views/controls/button/image_button.cc b/views/controls/button/image_button.cc
index a4f9123..85f5f4e 100644
--- a/views/controls/button/image_button.cc
+++ b/views/controls/button/image_button.cc
@@ -18,9 +18,9 @@ static const int kDefaultHeight = 14; // Default button height if no theme.
ImageButton::ImageButton(ButtonListener* listener)
: CustomButton(listener),
+ background_image_(NULL),
h_alignment_(ALIGN_LEFT),
- v_alignment_(ALIGN_TOP),
- background_image_(NULL) {
+ v_alignment_(ALIGN_TOP) {
// By default, we request that the gfx::Canvas passed to our View::Paint()
// implementation is flipped horizontally so that the button's bitmaps are
// mirrored when the UI directionality is right-to-left.
diff --git a/views/controls/link.cc b/views/controls/link.cc
index 14bc112..34a9e46 100644
--- a/views/controls/link.cc
+++ b/views/controls/link.cc
@@ -4,6 +4,10 @@
#include "views/controls/link.h"
+#if defined(OS_LINUX)
+#include <gdk/gdk.h>
+#endif
+
#include "app/gfx/font.h"
#include "base/logging.h"
#include "views/event.h"
@@ -184,17 +188,19 @@ void Link::SetEnabled(bool f) {
}
}
-#if defined(OS_WIN)
-HCURSOR Link::GetCursorForPoint(Event::EventType event_type, int x, int y) {
+gfx::NativeCursor Link::GetCursorForPoint(Event::EventType event_type, int x,
+ int y) {
if (enabled_) {
- if (!g_hand_cursor) {
+#if defined(OS_WIN)
+ if (!g_hand_cursor)
g_hand_cursor = LoadCursor(NULL, IDC_HAND);
- }
return g_hand_cursor;
+#elif defined(OS_LINUX)
+ return gdk_cursor_new(GDK_HAND2);
+#endif
} else {
return NULL;
}
}
-#endif
} // namespace views
diff --git a/views/controls/link.h b/views/controls/link.h
index 91e77ad..c574b6e 100644
--- a/views/controls/link.h
+++ b/views/controls/link.h
@@ -54,9 +54,8 @@ class Link : public Label {
// Set whether the link is enabled.
virtual void SetEnabled(bool f);
-#if defined(OS_WIN)
- virtual HCURSOR GetCursorForPoint(Event::EventType event_type, int x, int y);
-#endif
+ virtual gfx::NativeCursor GetCursorForPoint(Event::EventType event_type,
+ int x, int y);
virtual std::string GetClassName() const;
diff --git a/views/controls/single_split_view.cc b/views/controls/single_split_view.cc
index b40fca2..c741233 100644
--- a/views/controls/single_split_view.cc
+++ b/views/controls/single_split_view.cc
@@ -4,6 +4,10 @@
#include "views/controls/single_split_view.h"
+#if defined(OS_LINUX)
+#include <gdk/gdk.h>
+#endif
+
#include "app/gfx/canvas.h"
#include "skia/ext/skia_utils_win.h"
#include "views/background.h"
@@ -55,12 +59,15 @@ gfx::Size SingleSplitView::GetPreferredSize() {
return gfx::Size(width, height);
}
-HCURSOR SingleSplitView::GetCursorForPoint(Event::EventType event_type,
- int x,
- int y) {
+gfx::NativeCursor SingleSplitView::GetCursorForPoint(Event::EventType event_type,
+ int x, int y) {
if (IsPointInDivider(x)) {
+#if defined(OS_WIN)
static HCURSOR resize_cursor = LoadCursor(NULL, IDC_SIZEWE);
return resize_cursor;
+#elif defined(OS_LINUX)
+ return gdk_cursor_new(GDK_SB_H_DOUBLE_ARROW);
+#endif
}
return NULL;
}
diff --git a/views/controls/single_split_view.h b/views/controls/single_split_view.h
index a531800..9d25918 100644
--- a/views/controls/single_split_view.h
+++ b/views/controls/single_split_view.h
@@ -22,7 +22,7 @@ class SingleSplitView : public views::View {
virtual gfx::Size GetPreferredSize();
// Overriden to return a resize cursor when over the divider.
- virtual HCURSOR GetCursorForPoint(Event::EventType event_type, int x, int y);
+ virtual gfx::NativeCursor GetCursorForPoint(Event::EventType event_type, int x, int y);
void set_divider_x(int divider_x) { divider_x_ = divider_x; }
int divider_x() { return divider_x_; }