diff options
author | rathnor <rathnor> | 2004-01-23 10:38:25 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2004-01-23 10:38:25 (GMT) |
commit | e56c3c5b448a16a90dc1e518b29afd5c0ee544e8 (patch) | |
tree | fb30b241de738787281827cf9d63baa666839900 /src/FbWinFrame.cc | |
parent | 9d035e19c8d574e148ac92cc537de6c49f000f61 (diff) | |
download | fluxbox-e56c3c5b448a16a90dc1e518b29afd5c0ee544e8.zip fluxbox-e56c3c5b448a16a90dc1e518b29afd5c0ee544e8.tar.bz2 |
fix some issues with window frame that happened when changing style
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r-- | src/FbWinFrame.cc | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index d310f24..5dcd64a 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWinFrame.cc,v 1.72 2004/01/21 19:47:30 fluxgen Exp $ | 22 | // $Id: FbWinFrame.cc,v 1.73 2004/01/23 10:37:01 rathnor Exp $ |
23 | 23 | ||
24 | #include "FbWinFrame.hh" | 24 | #include "FbWinFrame.hh" |
25 | 25 | ||
@@ -455,10 +455,12 @@ bool FbWinFrame::showHandle() { | |||
455 | if (m_use_handle || theme().handleWidth() == 0) | 455 | if (m_use_handle || theme().handleWidth() == 0) |
456 | return false; | 456 | return false; |
457 | 457 | ||
458 | m_use_handle = true; | ||
459 | |||
460 | renderHandles(); | ||
458 | m_handle.show(); | 461 | m_handle.show(); |
459 | m_handle.showSubwindows(); // shows grips | 462 | m_handle.showSubwindows(); // shows grips |
460 | 463 | ||
461 | m_use_handle = true; | ||
462 | m_window.resize(m_window.width(), m_window.height() + m_handle.height() + | 464 | m_window.resize(m_window.width(), m_window.height() + m_handle.height() + |
463 | m_handle.borderWidth()); | 465 | m_handle.borderWidth()); |
464 | return true; | 466 | return true; |
@@ -636,6 +638,13 @@ void FbWinFrame::reconfigure() { | |||
636 | return; | 638 | return; |
637 | 639 | ||
638 | m_bevel = theme().bevelWidth(); | 640 | m_bevel = theme().bevelWidth(); |
641 | // reconfigure can't set borderwidth, as it doesn't know | ||
642 | // if it's meant to be borderless or not | ||
643 | |||
644 | unsigned int orig_handle_h = handle().height(); | ||
645 | if (m_use_handle && orig_handle_h != theme().handleWidth()) | ||
646 | m_window.resize(m_window.width(), m_window.height() - | ||
647 | orig_handle_h + theme().handleWidth()); | ||
639 | 648 | ||
640 | handle().resize(handle().width(), | 649 | handle().resize(handle().width(), |
641 | theme().handleWidth()); | 650 | theme().handleWidth()); |
@@ -663,32 +672,37 @@ void FbWinFrame::reconfigure() { | |||
663 | client_height -= titlebar_height; | 672 | client_height -= titlebar_height; |
664 | } | 673 | } |
665 | 674 | ||
666 | if (m_use_handle) { | 675 | // align handle and grips |
667 | // align handle and grips | 676 | const int grip_height = m_handle.height(); |
668 | const int grip_height = m_handle.height(); | 677 | const int grip_width = 20; //TODO |
669 | const int grip_width = 20; //TODO | 678 | const int handle_bw = static_cast<signed>(m_handle.borderWidth()); |
670 | const int handle_bw = static_cast<signed>(m_handle.borderWidth()); | ||
671 | |||
672 | const int ypos = m_window.height() - grip_height - m_handle.borderWidth(); | ||
673 | m_handle.moveResize(-handle_bw, ypos, | ||
674 | m_window.width(), grip_height); | ||
675 | |||
676 | m_grip_left.moveResize(-handle_bw, -handle_bw, | ||
677 | grip_width, grip_height); | ||
678 | 679 | ||
679 | m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw, | 680 | int ypos = m_window.height(); |
680 | grip_width, grip_height); | ||
681 | m_handle.raise(); | ||
682 | 681 | ||
683 | client_height -= m_handle.height() + m_handle.borderWidth(); | 682 | // if the handle isn't on, it's actually below the window |
683 | if (m_use_handle) | ||
684 | ypos -= grip_height + handle_bw; | ||
685 | |||
686 | // we do handle settings whether on or not so that if they get toggled | ||
687 | // then things are ok... | ||
688 | m_handle.moveResize(-handle_bw, ypos, | ||
689 | m_window.width(), grip_height); | ||
690 | |||
691 | m_grip_left.moveResize(-handle_bw, -handle_bw, | ||
692 | grip_width, grip_height); | ||
693 | |||
694 | m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw, | ||
695 | grip_width, grip_height); | ||
684 | 696 | ||
697 | if (m_use_handle) { | ||
698 | m_handle.raise(); | ||
699 | client_height -= m_handle.height() + m_handle.borderWidth(); | ||
685 | } else { | 700 | } else { |
686 | m_handle.lower(); | 701 | m_handle.lower(); |
687 | } | 702 | } |
688 | 703 | ||
689 | m_clientarea.moveResize(0, client_top, | 704 | m_clientarea.moveResize(0, client_top, |
690 | m_window.width(), client_height); | 705 | m_window.width(), client_height); |
691 | |||
692 | } | 706 | } |
693 | 707 | ||
694 | 708 | ||