[Bf-blender-cvs] [27fac6b4178] topbar: Forbid flipping regions in top-bar
Julian Eisel
noreply at git.blender.org
Thu Oct 26 23:33:55 CEST 2017
Commit: 27fac6b4178510630a2d4015c0c8f3697acb89c4
Author: Julian Eisel
Date: Thu Oct 26 23:30:02 2017 +0200
Branches: topbar
https://developer.blender.org/rB27fac6b4178510630a2d4015c0c8f3697acb89c4
Forbid flipping regions in top-bar
===================================================================
M source/blender/editors/screen/screen_ops.c
===================================================================
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 992fab214cc..33f049903a3 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3178,6 +3178,18 @@ static int region_flip_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
+static int region_flip_poll(bContext *C)
+{
+ ScrArea *area = CTX_wm_area(C);
+
+ /* don't flip anything around in topbar */
+ if (area->spacetype == SPACE_TOPBAR) {
+ CTX_wm_operator_poll_msg_set(C, "Flipping regions in the Top-bar is not allowed");
+ return 0;
+ }
+
+ return ED_operator_areaactive(C);
+}
static void SCREEN_OT_region_flip(wmOperatorType *ot)
{
@@ -3188,7 +3200,7 @@ static void SCREEN_OT_region_flip(wmOperatorType *ot)
/* api callbacks */
ot->exec = region_flip_exec;
- ot->poll = ED_operator_areaactive;
+ ot->poll = region_flip_poll;
ot->flag = 0;
}
More information about the Bf-blender-cvs
mailing list