diff options
author | Lajos Koszti <ajnasz@ajnasz.hu> | 2012-04-06 12:10:24 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2012-04-06 12:11:16 (GMT) |
commit | 7b6dc2ad72a4c4ecd20eddbfb6f1b4c3bd2a7024 (patch) | |
tree | c2a8f4aa658783c6454b7643ce2717acaa744101 /src/Window.cc | |
parent | 5d56046b68635cea2c187e59a9d8c514e2d6bdb2 (diff) | |
download | fluxbox_pavel-7b6dc2ad72a4c4ecd20eddbfb6f1b4c3bd2a7024.zip fluxbox_pavel-7b6dc2ad72a4c4ecd20eddbfb6f1b4c3bd2a7024.tar.bz2 |
Allow percentage values for some Window commands
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Window.cc b/src/Window.cc index a4eef44..f5a2fe2 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -3714,10 +3714,9 @@ FluxboxWindow::ReferenceCorner FluxboxWindow::getCorner(string str) { | |||
3714 | return ERROR; | 3714 | return ERROR; |
3715 | } | 3715 | } |
3716 | 3716 | ||
3717 | void FluxboxWindow::translateCoords(int &x, int &y, ReferenceCorner dir) const { | 3717 | void FluxboxWindow::translateXCoords(int &x, ReferenceCorner dir) const { |
3718 | int head = getOnHead(), bw = 2 * frame().window().borderWidth(), | 3718 | int head = getOnHead(), bw = 2 * frame().window().borderWidth(), |
3719 | left = screen().maxLeft(head), right = screen().maxRight(head), | 3719 | left = screen().maxLeft(head), right = screen().maxRight(head); |
3720 | top = screen().maxTop(head), bottom = screen().maxBottom(head); | ||
3721 | 3720 | ||
3722 | if (dir == LEFTTOP || dir == LEFT || dir == LEFTBOTTOM) | 3721 | if (dir == LEFTTOP || dir == LEFT || dir == LEFTBOTTOM) |
3723 | x += left; | 3722 | x += left; |
@@ -3725,6 +3724,12 @@ void FluxboxWindow::translateCoords(int &x, int &y, ReferenceCorner dir) const { | |||
3725 | x = right - width() - bw - x; | 3724 | x = right - width() - bw - x; |
3726 | if (dir == TOP || dir == CENTER || dir == BOTTOM) | 3725 | if (dir == TOP || dir == CENTER || dir == BOTTOM) |
3727 | x += (left + right - width() - bw)/2; | 3726 | x += (left + right - width() - bw)/2; |
3727 | } | ||
3728 | |||
3729 | void FluxboxWindow::translateYCoords(int &y, ReferenceCorner dir) const { | ||
3730 | int head = getOnHead(), bw = 2 * frame().window().borderWidth(), | ||
3731 | top = screen().maxTop(head), bottom = screen().maxBottom(head); | ||
3732 | |||
3728 | if (dir == LEFTTOP || dir == TOP || dir == RIGHTTOP) | 3733 | if (dir == LEFTTOP || dir == TOP || dir == RIGHTTOP) |
3729 | y += top; | 3734 | y += top; |
3730 | if (dir == LEFTBOTTOM || dir == BOTTOM || dir == RIGHTBOTTOM) | 3735 | if (dir == LEFTBOTTOM || dir == BOTTOM || dir == RIGHTBOTTOM) |
@@ -3733,6 +3738,11 @@ void FluxboxWindow::translateCoords(int &x, int &y, ReferenceCorner dir) const { | |||
3733 | y += (top + bottom - height() - bw)/2; | 3738 | y += (top + bottom - height() - bw)/2; |
3734 | } | 3739 | } |
3735 | 3740 | ||
3741 | void FluxboxWindow::translateCoords(int &x, int &y, ReferenceCorner dir) const { | ||
3742 | translateXCoords(x, dir); | ||
3743 | translateYCoords(y, dir); | ||
3744 | } | ||
3745 | |||
3736 | int FluxboxWindow::getOnHead() const { | 3746 | int FluxboxWindow::getOnHead() const { |
3737 | return screen().getHead(fbWindow()); | 3747 | return screen().getHead(fbWindow()); |
3738 | } | 3748 | } |