[Bf-blender-cvs] [19e74f1] master: Fix T37867: scroll bar in text editor shows the wrong mouse cursor.

Brecht Van Lommel noreply at git.blender.org
Thu Mar 6 18:25:00 CET 2014


Commit: 19e74f1d4f9bc955c6c7616cadcde65e6f6d2d3d
Author: Brecht Van Lommel
Date:   Thu Mar 6 18:20:59 2014 +0100
https://developer.blender.org/rB19e74f1d4f9bc955c6c7616cadcde65e6f6d2d3d

Fix T37867: scroll bar in text editor shows the wrong mouse cursor.

Patch by chipgw.

===================================================================

M	source/blender/editors/space_text/space_text.c

===================================================================

diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 37f7cf1..8b08000 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -449,9 +449,16 @@ static void text_main_area_draw(const bContext *C, ARegion *ar)
 	/* scrollers? */
 }
 
-static void text_cursor(wmWindow *win, ScrArea *UNUSED(sa), ARegion *UNUSED(ar))
+static void text_cursor(wmWindow *win, ScrArea *sa, ARegion *ar)
 {
-	WM_cursor_set(win, BC_TEXTEDITCURSOR);
+	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);
 }
 
 
@@ -570,6 +577,7 @@ void ED_spacetype_text(void)
 	art->init = text_main_area_init;
 	art->draw = text_main_area_draw;
 	art->cursor = text_cursor;
+	art->event_cursor = TRUE;
 
 	BLI_addhead(&st->regiontypes, art);




More information about the Bf-blender-cvs mailing list