diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/animation/drivers.c | 4 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 25 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_region_popover.c | 9 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 11 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_keymap.h | 5 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 8 |
9 files changed, 17 insertions, 58 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 99725c7da99..fe57909be75 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -953,7 +953,7 @@ static int add_driver_button_invoke(bContext *C, wmOperator *op, const wmEvent * /* 2) Show editing panel for setting up this driver */ /* TODO: Use a different one from the editing popever, so we can have the single/all toggle? */ - UI_popover_panel_invoke(C, SPACE_IPO, RGN_TYPE_UI, "GRAPH_PT_drivers_popover", true, op->reports); + UI_popover_panel_invoke(C, "GRAPH_PT_drivers_popover", true, op->reports); } return OPERATOR_INTERFACE; @@ -1041,7 +1041,7 @@ static int edit_driver_button_exec(bContext *C, wmOperator *op) UI_context_active_but_prop_get(C, &ptr, &prop, &index); if (ptr.id.data && ptr.data && prop) { - UI_popover_panel_invoke(C, SPACE_IPO, RGN_TYPE_UI, "GRAPH_PT_drivers_popover", true, op->reports); + UI_popover_panel_invoke(C, "GRAPH_PT_drivers_popover", true, op->reports); } return OPERATOR_INTERFACE; diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index d23748356fa..251f2b92acd 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -444,7 +444,7 @@ void UI_popup_menu_but_set(uiPopupMenu *pup, struct ARegion *butregion, uiBut *b typedef struct uiPopover uiPopover; int UI_popover_panel_invoke( - struct bContext *C, int space_id, int region_id, const char *idname, + struct bContext *C, const char *idname, bool keep_open, struct ReportList *reports); uiPopover *UI_popover_begin(struct bContext *C, int menu_width) ATTR_NONNULL(1); @@ -1170,7 +1170,7 @@ void uiItemPopoverPanel_ptr( const char *name, int icon); void uiItemPopoverPanel( uiLayout *layout, struct bContext *C, - int space_id, int region_id, const char *panelname, + const char *panelname, const char *name, int icon); void uiItemPopoverPanelFromGroup( uiLayout *layout, struct bContext *C, diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 16016a799ef..82ed4c5acba 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -2185,32 +2185,13 @@ void uiItemPopoverPanel_ptr(uiLayout *layout, bContext *C, PanelType *pt, const void uiItemPopoverPanel( uiLayout *layout, bContext *C, - int space_id, int region_id, const char *panel_type, - const char *name, int icon) + const char *panel_type, const char *name, int icon) { - SpaceType *st = BKE_spacetype_from_id(space_id); - if (st == NULL) { - RNA_warning("space type not found %d", space_id); - return; - } - ARegionType *art = BKE_regiontype_from_id(st, region_id); - if (art == NULL) { - RNA_warning("region type not found %d", region_id); - return; - } - - PanelType *pt; - for (pt = art->paneltypes.first; pt; pt = pt->next) { - if (STREQ(pt->idname, panel_type)) { - break; - } - } - + PanelType *pt = WM_paneltype_find(panel_type, true); if (pt == NULL) { - RNA_warning("area type not found %s", panel_type); + RNA_warning("Panel type not found '%s'", panel_type); return; } - uiItemPopoverPanel_ptr(layout, C, pt, name, icon); } diff --git a/source/blender/editors/interface/interface_region_popover.c b/source/blender/editors/interface/interface_region_popover.c index 35856b6c8b2..376e367f4da 100644 --- a/source/blender/editors/interface/interface_region_popover.c +++ b/source/blender/editors/interface/interface_region_popover.c @@ -277,16 +277,13 @@ uiPopupBlockHandle *ui_popover_panel_create( * \{ */ int UI_popover_panel_invoke( - bContext *C, int space_id, int region_id, const char *idname, + bContext *C, const char *idname, bool keep_open, ReportList *reports) { uiLayout *layout; - PanelType *pt = UI_paneltype_find(space_id, region_id, idname); + PanelType *pt = WM_paneltype_find(idname, true); if (pt == NULL) { - BKE_reportf( - reports, RPT_ERROR, - "Panel \"%s\" not found (space %d, region %d)", - idname, space_id, region_id); + BKE_reportf(reports, RPT_ERROR, "Panel \"%s\" not found", idname); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 4de475e05b9..eedf6f50a1f 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -1123,7 +1123,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_snap"); - WM_keymap_add_panel(keymap, SPACE_VIEW3D, RGN_TYPE_HEADER, "VIEW3D_PT_snapping", TABKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0); + WM_keymap_add_panel(keymap, "VIEW3D_PT_snapping", TABKEY, KM_PRESS, KM_SHIFT | KM_CTRL, 0); /* Will fall-through to texture-space transform. */ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_transform_axis_target", TKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 74117b43d91..c9ce9ae7961 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -277,8 +277,7 @@ static void rna_uiItemM( static void rna_uiItemPopoverPanel( uiLayout *layout, bContext *C, - int space_type, int region_type, const char *panel_type, - const char *name, const char *text_ctxt, + const char *panel_type, const char *name, const char *text_ctxt, bool translate, int icon, int icon_value) { /* Get translated name (label). */ @@ -288,7 +287,7 @@ static void rna_uiItemPopoverPanel( icon = icon_value; } - uiItemPopoverPanel(layout, C, space_type, region_type, panel_type, name, icon); + uiItemPopoverPanel(layout, C, panel_type, name, icon); } static void rna_uiItemPopoverPanelFromGroup( @@ -717,11 +716,7 @@ void RNA_api_ui_layout(StructRNA *srna) func = RNA_def_function(srna, "popover", "rna_uiItemPopoverPanel"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - parm = RNA_def_enum(func, "space_type", rna_enum_space_type_items, 0, "Space Type", ""); - RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - parm = RNA_def_enum(func, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); - RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); - parm = RNA_def_string(func, "panel_type", NULL, 0, "", "Identifier of the panel"); + parm = RNA_def_string(func, "panel", NULL, 0, "", "Identifier of the panel"); api_ui_item_common(func); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); parm = RNA_def_property(func, "icon_value", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h index afde7f64b81..547028c88f9 100644 --- a/source/blender/windowmanager/WM_keymap.h +++ b/source/blender/windowmanager/WM_keymap.h @@ -66,10 +66,7 @@ wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, const char *idname, in int val, int modifier, int keymodifier); wmKeyMapItem *WM_keymap_add_menu_pie(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); -wmKeyMapItem *WM_keymap_add_panel( - struct wmKeyMap *keymap, - short space_type, short region_type, const char *idname, - int type, int val, int modifier, int keymodifier); +wmKeyMapItem *WM_keymap_add_panel(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); wmKeyMapItem *WM_keymap_add_tool(struct wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier); diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 82363c4c21b..a95ccf36fdb 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -509,14 +509,9 @@ wmKeyMapItem *WM_keymap_add_menu_pie(wmKeyMap *keymap, const char *idname, int t return kmi; } -wmKeyMapItem *WM_keymap_add_panel( - wmKeyMap *keymap, - short space_type, short region_type, const char *idname, - int type, int val, int modifier, int keymodifier) +wmKeyMapItem *WM_keymap_add_panel(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier) { wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_call_panel", type, val, modifier, keymodifier); - RNA_enum_set(kmi->ptr, "space_type", space_type); - RNA_enum_set(kmi->ptr, "region_type", region_type); RNA_string_set(kmi->ptr, "name", idname); /* TODO: we might want to disable this. */ RNA_boolean_set(kmi->ptr, "keep_open", false); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 5cb95f2b3c5..dd9b8324b11 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1778,11 +1778,9 @@ static int wm_call_panel_exec(bContext *C, wmOperator *op) { char idname[BKE_ST_MAXNAME]; RNA_string_get(op->ptr, "name", idname); - const int space_type = RNA_enum_get(op->ptr, "space_type"); - const int region_type = RNA_enum_get(op->ptr, "region_type"); const bool keep_open = RNA_boolean_get(op->ptr, "keep_open"); - return UI_popover_panel_invoke(C, space_type, region_type, idname, keep_open, op->reports); + return UI_popover_panel_invoke(C, idname, keep_open, op->reports); } static void WM_OT_call_panel(wmOperatorType *ot) @@ -1800,10 +1798,6 @@ static void WM_OT_call_panel(wmOperatorType *ot) prop = RNA_def_string(ot->srna, "name", NULL, BKE_ST_MAXNAME, "Name", "Name of the menu"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); - prop = RNA_def_enum(ot->srna, "space_type", rna_enum_space_type_items, SPACE_EMPTY, "Space Type", ""); - RNA_def_property_flag(prop, PROP_SKIP_SAVE); - prop = RNA_def_enum(ot->srna, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); - RNA_def_property_flag(prop, PROP_SKIP_SAVE); prop = RNA_def_boolean(ot->srna, "keep_open", true, "Keep Open", ""); RNA_def_property_flag(prop, PROP_SKIP_SAVE); } |