diff options
Diffstat (limited to 'source/blender/editors')
5 files changed, 11 insertions, 33 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); |