Fix hidden toolbar placement

This commit is contained in:
Peter Ganzhorn 2015-05-03 18:18:40 +02:00 committed by Mathias Gumz
parent 169d640610
commit 69d13337fe

View file

@ -648,24 +648,29 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
break; break;
case TOPCENTER: case TOPCENTER:
frame.x += (head_w - static_cast<int>(frame.width))/2 - bw; frame.x += (head_w - static_cast<int>(frame.width))/2 - bw;
frame.x_hidden = frame.x;
frame.y_hidden += pixel - bw - static_cast<int>(frame.height); frame.y_hidden += pixel - bw - static_cast<int>(frame.height);
break; break;
case TOPRIGHT: case TOPRIGHT:
frame.x += head_w - static_cast<int>(frame.width) - bw*2; frame.x += head_w - static_cast<int>(frame.width) - bw*2;
frame.x_hidden = frame.x;
frame.y_hidden += pixel - bw - static_cast<int>(frame.height); frame.y_hidden += pixel - bw - static_cast<int>(frame.height);
break; break;
case BOTTOMRIGHT: case BOTTOMRIGHT:
frame.x += head_w - static_cast<int>(frame.width) - bw*2; frame.x += head_w - static_cast<int>(frame.width) - bw*2;
frame.y += head_h - static_cast<int>(frame.height) - bw*2; frame.y += head_h - static_cast<int>(frame.height) - bw*2;
frame.x_hidden = frame.x;
frame.y_hidden += head_h - bw - pixel; frame.y_hidden += head_h - bw - pixel;
break; break;
case BOTTOMCENTER: // default is BOTTOMCENTER case BOTTOMCENTER: // default is BOTTOMCENTER
frame.x += (head_w - static_cast<int>(frame.width))/2 - bw; frame.x += (head_w - static_cast<int>(frame.width))/2 - bw;
frame.y += head_h - static_cast<int>(frame.height) - bw*2; frame.y += head_h - static_cast<int>(frame.height) - bw*2;
frame.x_hidden = frame.x;
frame.y_hidden += head_h - bw - pixel; frame.y_hidden += head_h - bw - pixel;
break; break;
case LEFTCENTER: case LEFTCENTER:
frame.y += (head_h - static_cast<int>(frame.height))/2 - bw; frame.y += (head_h - static_cast<int>(frame.height))/2 - bw;
frame.y_hidden = frame.y;
frame.x_hidden += pixel - static_cast<int>(frame.width) - bw; frame.x_hidden += pixel - static_cast<int>(frame.width) - bw;
break; break;
case LEFTTOP: case LEFTTOP:
@ -673,21 +678,24 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
break; break;
case LEFTBOTTOM: case LEFTBOTTOM:
frame.y = head_h - static_cast<int>(frame.height) - bw*2; frame.y = head_h - static_cast<int>(frame.height) - bw*2;
frame.y_hidden = frame.y;
frame.x_hidden += pixel - static_cast<int>(frame.width) - bw; frame.x_hidden += pixel - static_cast<int>(frame.width) - bw;
break; break;
case RIGHTCENTER: case RIGHTCENTER:
frame.x += head_w - static_cast<int>(frame.width) - bw*2; frame.x += head_w - static_cast<int>(frame.width) - bw*2;
frame.y += (head_h - static_cast<int>(frame.height))/2 - bw; frame.y += (head_h - static_cast<int>(frame.height))/2 - bw;
frame.x_hidden += static_cast<int>(frame.width) + bw - pixel; frame.x_hidden += head_w - bw - pixel;
frame.y_hidden = frame.y;
break; break;
case RIGHTTOP: case RIGHTTOP:
frame.x += head_w - static_cast<int>(frame.width) - bw*2; frame.x += head_w - static_cast<int>(frame.width) - bw*2;
frame.x_hidden += static_cast<int>(frame.width) + bw - pixel; frame.x_hidden += head_w - bw - pixel;
break; break;
case RIGHTBOTTOM: case RIGHTBOTTOM:
frame.x += head_w - static_cast<int>(frame.width) - bw*2; frame.x += head_w - static_cast<int>(frame.width) - bw*2;
frame.y += head_h - static_cast<int>(frame.height) - bw*2; frame.y += head_h - static_cast<int>(frame.height) - bw*2;
frame.x_hidden += static_cast<int>(frame.width) + bw - pixel; frame.x_hidden += head_w - bw - pixel;
frame.y_hidden = frame.y;
break; break;
} }