diff options
author | Hans Goudey <h.goudey@me.com> | 2020-11-05 00:54:56 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-11-05 00:54:56 +0300 |
commit | f888f3aa1f3c3d2b9ef22fc96de3bda13d234be0 (patch) | |
tree | e51eab2e6197857e74bba72a57fd7a7a264e7770 /source/blender/editors/interface/interface_panel.c | |
parent | 76416f336a1b5d705baf7b28ef9fbc726566c8c1 (diff) |
Cleanup: Make panel function static
These functions were not used elsewhere, and the handling for the panel
tabs should be kept local to this file where possible. Also remove
another unused function and removed an unecessary "_ex" function.
Diffstat (limited to 'source/blender/editors/interface/interface_panel.c')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index d02cfdc8940..d9469981811 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -2305,10 +2305,10 @@ const char *UI_panel_category_active_get(ARegion *region, bool set_fallback) return NULL; } -PanelCategoryDyn *UI_panel_category_find_mouse_over_ex(ARegion *region, const int x, const int y) +static PanelCategoryDyn *panel_categories_find_mouse_over(ARegion *region, const wmEvent *event) { LISTBASE_FOREACH (PanelCategoryDyn *, ptd, ®ion->panels_category) { - if (BLI_rcti_isect_pt(&ptd->rect, x, y)) { + if (BLI_rcti_isect_pt(&ptd->rect, event->mval[0], event->mval[1])) { return ptd; } } @@ -2316,11 +2316,6 @@ PanelCategoryDyn *UI_panel_category_find_mouse_over_ex(ARegion *region, const in return NULL; } -PanelCategoryDyn *UI_panel_category_find_mouse_over(ARegion *region, const wmEvent *event) -{ - return UI_panel_category_find_mouse_over_ex(region, event->mval[0], event->mval[1]); -} - void UI_panel_category_add(ARegion *region, const char *name) { PanelCategoryDyn *pc_dyn = MEM_callocN(sizeof(*pc_dyn), __func__); @@ -2416,7 +2411,7 @@ int ui_handler_panel_region(bContext *C, /* Handle category tabs. */ if (UI_panel_category_is_visible(region)) { if (event->type == LEFTMOUSE) { - PanelCategoryDyn *pc_dyn = UI_panel_category_find_mouse_over(region, event); + PanelCategoryDyn *pc_dyn = panel_categories_find_mouse_over(region, event); if (pc_dyn) { UI_panel_category_active_set(region, pc_dyn->idname); ED_region_tag_redraw(region); @@ -2670,16 +2665,4 @@ static void panel_activate_state(const bContext *C, Panel *panel, uiHandlePanelS ED_region_tag_redraw(region); } -PanelType *UI_paneltype_find(int space_id, int region_id, const char *idname) -{ - SpaceType *st = BKE_spacetype_from_id(space_id); - if (st) { - ARegionType *art = BKE_regiontype_from_id(st, region_id); - if (art) { - return BLI_findstring(&art->paneltypes, idname, offsetof(PanelType, idname)); - } - } - return NULL; -} - /** \} */ |