Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-05-22 18:13:33 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-05-22 18:13:33 +0400
commit53b01d90023a850b17ded5deb9cace354c8e298a (patch)
treeab8ce43ddf8046dc54e2cacc5ff46cbc5806910b /source/blender/editors/screen
parent85923aff288da072750447b44e492ebe5c59bcce (diff)
A number of new features for the node editor in general and the Frame node in particular.
For an detailed user-level description of new features see the following blogpost: http://code.blender.org/index.php/2012/05/node-editing-tweaks/ TL;DR: * Frame node gets more usable bounding-box behavior * Node resizing has helpful mouse cursor indicators and works on all borders * Node selection/active colors are themeable independently * Customizable background colors for nodes (useful for frames visual distinction).
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/screen_edit.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 3a2498d3fa2..f973d3cc070 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -944,7 +944,7 @@ bScreen *ED_screen_duplicate(wmWindow *win, bScreen *sc)
}
/* screen sets cursor based on swinid */
-static void region_cursor_set(wmWindow *win, int swinid)
+static void region_cursor_set(wmWindow *win, int swinid, int swin_changed)
{
ScrArea *sa = win->screen->areabase.first;
@@ -952,10 +952,12 @@ static void region_cursor_set(wmWindow *win, int swinid)
ARegion *ar = sa->regionbase.first;
for (; ar; ar = ar->next) {
if (ar->swinid == swinid) {
- if (ar->type && ar->type->cursor)
- ar->type->cursor(win, sa, ar);
- else
- WM_cursor_set(win, CURSOR_STD);
+ if (swin_changed || (ar->type && ar->type->event_cursor)) {
+ if (ar->type && ar->type->cursor)
+ ar->type->cursor(win, sa, ar);
+ else
+ WM_cursor_set(win, CURSOR_STD);
+ }
return;
}
}
@@ -983,7 +985,7 @@ void ED_screen_do_listen(bContext *C, wmNotifier *note)
break;
case NC_SCENE:
if (note->data == ND_MODE)
- region_cursor_set(win, note->swinid);
+ region_cursor_set(win, note->swinid, TRUE);
break;
}
}
@@ -1239,9 +1241,7 @@ static void screen_cursor_set(wmWindow *win, wmEvent *event)
else
WM_cursor_set(win, CURSOR_X_MOVE);
}
- else
- WM_cursor_set(win, CURSOR_STD);
- }
+ }
}
@@ -1294,9 +1294,13 @@ void ED_screen_set_subwinactive(bContext *C, wmEvent *event)
if (scr->subwinactive == scr->mainwin) {
screen_cursor_set(win, event);
}
- else if (oldswin != scr->subwinactive) {
- region_cursor_set(win, scr->subwinactive);
- WM_event_add_notifier(C, NC_SCREEN | ND_SUBWINACTIVE, scr);
+ else {
+ if (oldswin != scr->subwinactive) {
+ region_cursor_set(win, scr->subwinactive, TRUE);
+ WM_event_add_notifier(C, NC_SCREEN | ND_SUBWINACTIVE, scr);
+ }
+ else
+ region_cursor_set(win, scr->subwinactive, FALSE);
}
}
}