Use better pointer cursor for link text in GTK
Gdk::Cursor::create(Gdk::HAND1) yields a hand cursor more appropriate for "grabbing" vs. pointing. Use the recommended create by name API to get a "pointing hand" cursor.
This commit is contained in:
parent
2a3f598ce0
commit
bef6bc3b77
@ -963,16 +963,17 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetCursor(Cursor cursor) override {
|
void SetCursor(Cursor cursor) override {
|
||||||
Gdk::CursorType gdkCursorType;
|
std::string cursor_name;
|
||||||
switch(cursor) {
|
switch(cursor) {
|
||||||
case Cursor::POINTER: gdkCursorType = Gdk::ARROW; break;
|
case Cursor::POINTER: cursor_name = "default"; break;
|
||||||
case Cursor::HAND: gdkCursorType = Gdk::HAND1; break;
|
case Cursor::HAND: cursor_name = "pointer"; break;
|
||||||
default: ssassert(false, "Unexpected cursor");
|
default: ssassert(false, "Unexpected cursor");
|
||||||
}
|
}
|
||||||
|
|
||||||
auto gdkWindow = gtkWindow.get_gl_widget().get_window();
|
auto gdkWindow = gtkWindow.get_gl_widget().get_window();
|
||||||
if(gdkWindow) {
|
if(gdkWindow) {
|
||||||
gdkWindow->set_cursor(Gdk::Cursor::create(gdkCursorType));
|
gdkWindow->set_cursor(Gdk::Cursor::create(gdkWindow->get_display(), cursor_name.c_str()));
|
||||||
|
// gdkWindow->get_display()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user