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:
authorCampbell Barton <ideasman42@gmail.com>2018-07-13 20:13:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-13 20:16:35 +0300
commitcca87ccc753a85b447872a259c9d3e3f07ec1c13 (patch)
tree9b2e9d8aa5d45153affaef7ad648a811156fbd8c /source/blender/editors/interface/interface_layout.c
parentaf0fc660499a63b367dcc63222d0baee93aa665c (diff)
UI: remove space/region from popover args
Instead use global panel-type list.
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r--source/blender/editors/interface/interface_layout.c25
1 files changed, 3 insertions, 22 deletions
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);
}