forked from bartvdbraak/blender
Fix for collapse ignoring pinned panels
This commit is contained in:
parent
f01d19431d
commit
e60fb0fd29
@ -170,20 +170,21 @@ static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa)
|
|||||||
|
|
||||||
/****************************** panels ******************************/
|
/****************************** panels ******************************/
|
||||||
|
|
||||||
static void panels_collapse_all(ScrArea *sa, ARegion *ar, Panel *from_pa)
|
static void panels_collapse_all(ScrArea *sa, ARegion *ar, const Panel *from_pa)
|
||||||
{
|
{
|
||||||
|
const bool has_category_tabs = UI_panel_category_is_visible(ar);
|
||||||
|
const char *category = has_category_tabs ? UI_panel_category_active_get(ar, false) : NULL;
|
||||||
|
const int flag = ((panel_aligned(sa, ar) == BUT_HORIZONTAL) ? PNL_CLOSEDX : PNL_CLOSEDY);
|
||||||
|
const PanelType *from_pt = from_pa->type;
|
||||||
Panel *pa;
|
Panel *pa;
|
||||||
PanelType *pt, *from_pt;
|
|
||||||
int flag = ((panel_aligned(sa, ar) == BUT_HORIZONTAL) ? PNL_CLOSEDX : PNL_CLOSEDY);
|
|
||||||
|
|
||||||
for (pa = ar->panels.first; pa; pa = pa->next) {
|
for (pa = ar->panels.first; pa; pa = pa->next) {
|
||||||
pt = pa->type;
|
PanelType *pt = pa->type;
|
||||||
from_pt = from_pa->type;
|
|
||||||
|
|
||||||
/* close panels with headers in the same context */
|
/* close panels with headers in the same context */
|
||||||
if (pt && from_pt && !(pt->flag & PNL_NO_HEADER)) {
|
if (pt && from_pt && !(pt->flag & PNL_NO_HEADER)) {
|
||||||
if (!pt->context[0] || strcmp(pt->context, from_pt->context) == 0) {
|
if (!pt->context[0] || !from_pt->context[0] || STREQ(pt->context, from_pt->context)) {
|
||||||
if (!pt->category[0] || strcmp(pt->category, from_pt->category) == 0) {
|
if ((pa->flag & PNL_PIN) || !category || !pt->category[0] || STREQ(pt->category, category)) {
|
||||||
pa->flag &= ~PNL_CLOSED;
|
pa->flag &= ~PNL_CLOSED;
|
||||||
pa->flag |= flag;
|
pa->flag |= flag;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user