diff options
-rw-r--r-- | src/FbWinFrame.cc | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index eaa3b9f..d3f6782 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.19 2003/04/15 14:36:12 fluxgen Exp $ | 22 | // $Id: FbWinFrame.cc,v 1.20 2003/04/16 10:56:37 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWinFrame.hh" | 24 | #include "FbWinFrame.hh" |
25 | #include "ImageControl.hh" | 25 | #include "ImageControl.hh" |
@@ -502,24 +502,25 @@ void FbWinFrame::reconfigure() { | |||
502 | m_window.width(), client_height); | 502 | m_window.width(), client_height); |
503 | 503 | ||
504 | 504 | ||
505 | if (!m_use_handle) // no need to do anything more | 505 | if (m_use_handle) { |
506 | return; | 506 | |
507 | 507 | ||
508 | // align handle and grips | 508 | // align handle and grips |
509 | const int grip_height = m_handle.height(); | 509 | const int grip_height = m_handle.height(); |
510 | const int grip_width = 20; //TODO | 510 | const int grip_width = 20; //TODO |
511 | 511 | ||
512 | const int ypos = m_window.height() - grip_height - m_handle.borderWidth(); | 512 | const int ypos = m_window.height() - grip_height - m_handle.borderWidth(); |
513 | 513 | ||
514 | m_grip_left.moveResize(-m_handle.borderWidth(), ypos, | 514 | m_grip_left.moveResize(-m_handle.borderWidth(), ypos, |
515 | grip_width, grip_height); | 515 | grip_width, grip_height); |
516 | 516 | ||
517 | m_handle.moveResize(grip_width, ypos, | 517 | m_handle.moveResize(grip_width, ypos, |
518 | m_window.width() - grip_width*2 - m_handle.borderWidth()*2, | 518 | m_window.width() - grip_width*2 - m_handle.borderWidth()*2, |
519 | grip_height); | 519 | grip_height); |
520 | 520 | ||
521 | m_grip_right.moveResize(m_window.width() - grip_width - m_handle.borderWidth(), ypos, | 521 | m_grip_right.moveResize(m_window.width() - grip_width - m_handle.borderWidth(), ypos, |
522 | grip_width, grip_height); | 522 | grip_width, grip_height); |
523 | } | ||
523 | } | 524 | } |
524 | 525 | ||
525 | // render the theme | 526 | // render the theme |
@@ -550,14 +551,19 @@ void FbWinFrame::redrawTitle() { | |||
550 | 551 | ||
551 | int button_width = label().width()/m_labelbuttons.size(); | 552 | int button_width = label().width()/m_labelbuttons.size(); |
552 | //!! TODO: bevel | 553 | //!! TODO: bevel |
554 | int border_width = m_labelbuttons.size() != 0 ? | ||
555 | m_labelbuttons.front()->window().borderWidth() : 0; | ||
556 | |||
553 | ButtonList::iterator btn_it = m_labelbuttons.begin(); | 557 | ButtonList::iterator btn_it = m_labelbuttons.begin(); |
554 | ButtonList::iterator btn_it_end = m_labelbuttons.end(); | 558 | ButtonList::iterator btn_it_end = m_labelbuttons.end(); |
555 | for (unsigned int last_x = 0; | 559 | for (unsigned int last_x = 0; |
556 | btn_it != btn_it_end; | 560 | btn_it != btn_it_end; |
557 | ++btn_it, last_x += button_width) { | 561 | ++btn_it, last_x += button_width + border_width) { |
558 | (*btn_it)->moveResize(last_x, 0, | 562 | // since we add border width pixel we should remove |
559 | button_width, label().height()); | 563 | // the same size for inside width so we can fit all buttons into label |
560 | (*btn_it)->setGC(theme().labelTextFocusGC()); | 564 | (*btn_it)->moveResize(last_x - border_width, - border_width, |
565 | button_width, | ||
566 | label().height() + border_width); | ||
561 | (*btn_it)->clear(); | 567 | (*btn_it)->clear(); |
562 | } | 568 | } |
563 | 569 | ||
@@ -680,6 +686,8 @@ void FbWinFrame::renderTitlebar() { | |||
680 | ButtonList::iterator btn_it = m_labelbuttons.begin(); | 686 | ButtonList::iterator btn_it = m_labelbuttons.begin(); |
681 | ButtonList::iterator btn_it_end = m_labelbuttons.end(); | 687 | ButtonList::iterator btn_it_end = m_labelbuttons.end(); |
682 | for (; btn_it != btn_it_end; ++btn_it) { | 688 | for (; btn_it != btn_it_end; ++btn_it) { |
689 | (*btn_it)->setGC(theme().labelTextFocusGC()); | ||
690 | (*btn_it)->window().setBorderWidth(1); | ||
683 | if (labelpm) | 691 | if (labelpm) |
684 | (*btn_it)->setBackgroundPixmap(labelpm); | 692 | (*btn_it)->setBackgroundPixmap(labelpm); |
685 | else | 693 | else |