diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-13 09:53:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-13 09:53:40 +0300 |
commit | e61531cb0eae60203c10a21426b85ba1ad438d95 (patch) | |
tree | 36299c957ea26847b1f5eaaef178c41a7b2a777c /source/blender/editors | |
parent | deb5884744defc2b69b55a3833ac57e4ebd19ea7 (diff) |
Fix T64461: Sub-panels allow pinning
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_context_menu.c | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 14 |
2 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index d22cfeca664..6a5caa6770b 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -1176,6 +1176,9 @@ void ui_popup_context_menu_for_panel(bContext *C, ARegion *ar, Panel *pa) if (!any_item_visible) { return; } + if (pa->type->parent != NULL) { + return; + } RNA_pointer_create(&sc->id, &RNA_Panel, pa, &ptr); diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index be43df76813..c0b8818edc1 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1625,11 +1625,11 @@ static void ui_handle_panel_header( { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); - Panel *pa; #ifdef USE_PIN_HIDDEN - const bool show_pin = UI_panel_category_is_visible(ar) && (block->panel->flag & PNL_PIN); + const bool show_pin = UI_panel_category_is_visible(ar) && (block->panel->type->parent == NULL) && + (block->panel->flag & PNL_PIN); #else - const bool show_pin = UI_panel_category_is_visible(ar); + const bool show_pin = UI_panel_category_is_visible(ar) && (block->panel->type->parent == NULL); #endif const bool is_subpanel = (block->panel->type && block->panel->type->parent); const bool show_drag = !is_subpanel; @@ -1660,8 +1660,10 @@ static void ui_handle_panel_header( button = 1; } else if (ELEM(event, 0, RETKEY, LEFTMOUSE) && shift) { - block->panel->flag ^= PNL_PIN; - button = 2; + if (block->panel->type->parent == NULL) { + block->panel->flag ^= PNL_PIN; + button = 2; + } } else if (block->panel->flag & PNL_CLOSEDX) { if (my >= block->rect.ymax) { @@ -1723,7 +1725,7 @@ static void ui_handle_panel_header( } } - for (pa = ar->panels.first; pa; pa = pa->next) { + for (Panel *pa = ar->panels.first; pa; pa = pa->next) { if (pa->paneltab == block->panel) { if (block->panel->flag & PNL_CLOSED) { pa->flag |= PNL_CLOSED; |