diff options
author | julianeisel <julian_eisel@web.de> | 2015-01-13 05:29:25 +0300 |
---|---|---|
committer | julianeisel <julian_eisel@web.de> | 2015-01-13 05:29:25 +0300 |
commit | f453df5b0382a895edb23753a73b6d9b9cbea6ed (patch) | |
tree | c3e3f4b2ae0d217eca96ea894b6e07d92f259719 | |
parent | aca329ba64e9ead88057021b282efc7663576719 (diff) |
Fix T43128: Headerless panels are reorderable on Windows
Seems like a weird issue, but to sort panels "qsort" is used, which works slightly different on Windows. So all I had
to do was cleaning up the logic in find_highest_panel so that headerless panels are sorted, but that it absolutly not
allows headerless panels to be above normal panels.
I made sure it works fine on Linux as well.
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 5ccfa4193e9..e68c86353a3 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -753,9 +753,13 @@ static int find_highest_panel(const void *a1, const void *a2) const PanelSort *ps1 = a1, *ps2 = a2; /* stick uppermost header-less panels to the top of the region - - * prevent them from being sorted */ - if (ps1->pa->sortorder < ps2->pa->sortorder && ps1->pa->type->flag & PNL_NO_HEADER) return -1; - + * prevent them from being sorted (multiple header-less panels have to be sorted though) */ + if (ps1->pa->type->flag & PNL_NO_HEADER && ps2->pa->type->flag & PNL_NO_HEADER) { + /* skip and check for ofs and sortorder below */ + } + else if (ps1->pa->type->flag & PNL_NO_HEADER) return -1; + else if (ps2->pa->type->flag & PNL_NO_HEADER) return 1; + if (ps1->pa->ofsy + ps1->pa->sizey < ps2->pa->ofsy + ps2->pa->sizey) return 1; else if (ps1->pa->ofsy + ps1->pa->sizey > ps2->pa->ofsy + ps2->pa->sizey) return -1; else if (ps1->pa->sortorder > ps2->pa->sortorder) return 1; |