Patch [#25409] Changes to panels header "open/close" and "drag" zones

Submitted by: Peter Tarasenko (pit)

This patch switches the screen real-estate given to the "open/close"
and "drag" zones for panels.
- Now, the entire header is used for resizing (open/close) panels
instead of just the triangle widget being used for this. This makes it
a larger target for clicking on, making it easier to do so (Fitt's Law
in action!)
- Dragging panels now is relegated to the "grabber" zone on the top-
right corner only now. This reflects the lesser importance of panel
reordering in the panel designs now over being able to open/close
them.
This commit is contained in:
Joshua Leung
2011-01-12 02:15:38 +00:00
parent bbdf47aa0b
commit 21fc4cabaf

View File

@@ -955,10 +955,11 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
if(my >= block->maxy) button= 1;
}
else if(block->panel->control & UI_PNL_CLOSE) {
if(mx <= block->minx+10+PNL_ICON-2) button= 2;
else if(mx <= block->minx+10+2*PNL_ICON+2) button= 1;
/* whole of header can be used to collapse panel (except top-right corner) */
if(mx <= block->maxx-8-PNL_ICON) button= 2;
//else if(mx <= block->minx+10+2*PNL_ICON+2) button= 1;
}
else if(mx <= block->minx+10+PNL_ICON+2) {
else if(mx <= block->maxx-PNL_ICON-12) {
button= 1;
}
@@ -996,10 +997,7 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
else
ED_region_tag_redraw(ar);
}
else if(block->panel->flag & PNL_CLOSED) {
panel_activate_state(C, block->panel, PANEL_STATE_DRAG);
}
else {
else if(mx <= (block->maxx-PNL_ICON-12)+PNL_ICON+2) {
panel_activate_state(C, block->panel, PANEL_STATE_DRAG);
}
}