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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-08-19 14:36:55 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-08-23 14:17:49 +0300
commite74ba9e09e74a1a6d340877469eed05c810f46b3 (patch)
treecc83e15009dbce5a531931f4b8f240319e68c398 /source/blender/editors/space_sequencer/sequencer_edit.c
parent833bc7039997435f676adc5b0c5150a264c543b8 (diff)
Fix T79872: VSE - splitting strip shows the channel number when unused
This operator is dependent on mouse position (if the Use Cursor Position option is used). The Channel property is irrelevant/unused in this case. So it is not optimal displaying this property when calling this from the menu (or even using the shortcut with default settings). Now use a custom UI in the Adjust Last Operation panel in this case. The properties are now drawn in relation to another then (Channel underneath Use Cursor Position) next to some other minor layout improvements. Thx @HooglyBoogly for feedback (also providing UI code) Maniphest Tasks: T79872 Differential Revision: https://developer.blender.org/D8625
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_edit.c')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index dcbac9bc817..3802dee248a 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -58,6 +58,7 @@
#include "ED_sequencer.h"
#include "UI_interface.h"
+#include "UI_resources.h"
#include "UI_view2d.h"
#include "DEG_depsgraph.h"
@@ -2383,6 +2384,28 @@ static int sequencer_split_invoke(bContext *C, wmOperator *op, const wmEvent *ev
return sequencer_split_exec(C, op);
}
+static void sequencer_split_ui(bContext *UNUSED(C), wmOperator *op)
+{
+ uiLayout *layout = op->layout;
+ uiLayoutSetPropSep(layout, true);
+ uiLayoutSetPropDecorate(layout, false);
+
+ PointerRNA ptr;
+ RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
+
+ uiLayout *row = uiLayoutRow(layout, false);
+ uiItemR(row, &ptr, "type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+ uiItemR(layout, &ptr, "frame", 0, NULL, ICON_NONE);
+ uiItemR(layout, &ptr, "side", 0, NULL, ICON_NONE);
+
+ uiItemS(layout);
+
+ uiItemR(layout, &ptr, "use_cursor_position", 0, NULL, ICON_NONE);
+ if (RNA_boolean_get(&ptr, "use_cursor_position")) {
+ uiItemR(layout, &ptr, "channel", 0, NULL, ICON_NONE);
+ }
+}
+
void SEQUENCER_OT_split(struct wmOperatorType *ot)
{
/* Identifiers. */
@@ -2394,6 +2417,7 @@ void SEQUENCER_OT_split(struct wmOperatorType *ot)
ot->invoke = sequencer_split_invoke;
ot->exec = sequencer_split_exec;
ot->poll = sequencer_edit_poll;
+ ot->ui = sequencer_split_ui;
/* Flags. */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;