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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-03-02 05:15:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-03-02 05:49:30 +0400
commite60fb0fd294577948f8ce0f07817b98d1b3024fe (patch)
tree568e4932d5003758a55fbb034babac0c193dbb44 /source
parentf01d19431d0e2a14a007d5480e805b99dc933169 (diff)
Fix for collapse ignoring pinned panels
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_panel.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index cb1f59cfd68..f5e2bfb6c29 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -170,20 +170,21 @@ static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa)
/****************************** 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;
- 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) {
- pt = pa->type;
- from_pt = from_pa->type;
+ PanelType *pt = pa->type;
/* close panels with headers in the same context */
if (pt && from_pt && !(pt->flag & PNL_NO_HEADER)) {
- if (!pt->context[0] || strcmp(pt->context, from_pt->context) == 0) {
- if (!pt->category[0] || strcmp(pt->category, from_pt->category) == 0) {
+ if (!pt->context[0] || !from_pt->context[0] || STREQ(pt->context, from_pt->context)) {
+ if ((pa->flag & PNL_PIN) || !category || !pt->category[0] || STREQ(pt->category, category)) {
pa->flag &= ~PNL_CLOSED;
pa->flag |= flag;
}