Use text cursor for py-console
authorCampbell Barton <ideasman42@gmail.com>
Mon, 30 Jun 2014 08:12:29 +0000 (18:12 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 30 Jun 2014 08:12:29 +0000 (18:12 +1000)
source/blender/editors/space_console/space_console.c

index 43313c7dd0691e013d135c61e71ada6a0d8ec3b7..e4a61a8f06e2857dcd8f64d328f05026d842e679 100644 (file)
@@ -158,6 +158,18 @@ static void console_main_area_init(wmWindowManager *wm, ARegion *ar)
        WM_event_add_dropbox_handler(&ar->handlers, lb);
 }
 
+/* same as 'text_cursor' */
+static void console_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
+{
+       SpaceText *st = sa->spacedata.first;
+       int wmcursor = BC_TEXTEDITCURSOR;
+
+       if (st->text && BLI_rcti_isect_pt(&st->txtbar, win->eventstate->x - ar->winrct.xmin, st->txtbar.ymin)) {
+               wmcursor = CURSOR_STD;
+       }
+
+       WM_cursor_set(win, wmcursor);
+}
 
 /* ************* dropboxes ************* */
 
@@ -396,6 +408,7 @@ void ED_spacetype_console(void)
 
        art->init = console_main_area_init;
        art->draw = console_main_area_draw;
+       art->cursor = console_cursor;
        art->listener = console_main_area_listener;