diff options
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r-- | src/FbWinFrame.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 862ec29..1e3cb97 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.61 2003/10/30 20:27:51 rathnor Exp $ | 22 | // $Id: FbWinFrame.cc,v 1.62 2003/10/31 10:37:09 rathnor Exp $ |
23 | 23 | ||
24 | #include "FbWinFrame.hh" | 24 | #include "FbWinFrame.hh" |
25 | 25 | ||
@@ -229,6 +229,8 @@ void FbWinFrame::setFocus(bool newvalue) { | |||
229 | if (m_focused == newvalue) | 229 | if (m_focused == newvalue) |
230 | return; | 230 | return; |
231 | 231 | ||
232 | m_focused = newvalue; | ||
233 | |||
232 | if (currentLabel()) { | 234 | if (currentLabel()) { |
233 | if (newvalue) // focused | 235 | if (newvalue) // focused |
234 | renderButtonFocus(*m_current_label); | 236 | renderButtonFocus(*m_current_label); |
@@ -236,10 +238,8 @@ void FbWinFrame::setFocus(bool newvalue) { | |||
236 | renderButtonUnfocus(*m_current_label); | 238 | renderButtonUnfocus(*m_current_label); |
237 | } | 239 | } |
238 | 240 | ||
239 | m_focused = newvalue; | ||
240 | |||
241 | renderButtons(); | ||
242 | renderTitlebar(); | 241 | renderTitlebar(); |
242 | renderButtons(); // parent relative buttons -> need render after titlebar | ||
243 | renderHandles(); | 243 | renderHandles(); |
244 | } | 244 | } |
245 | 245 | ||
@@ -713,6 +713,7 @@ void FbWinFrame::redrawTitle() { | |||
713 | return; | 713 | return; |
714 | 714 | ||
715 | int button_width = label().width()/m_labelbuttons.size(); | 715 | int button_width = label().width()/m_labelbuttons.size(); |
716 | int rounding_error = label().width() - m_labelbuttons.size()*button_width; | ||
716 | //!! TODO: bevel | 717 | //!! TODO: bevel |
717 | //int border_width = m_labelbuttons.front()->window().borderWidth(); | 718 | //int border_width = m_labelbuttons.front()->window().borderWidth(); |
718 | int border_width = m_labelbuttons.size() != 0 ? | 719 | int border_width = m_labelbuttons.size() != 0 ? |
@@ -720,13 +721,20 @@ void FbWinFrame::redrawTitle() { | |||
720 | 721 | ||
721 | LabelList::iterator btn_it = m_labelbuttons.begin(); | 722 | LabelList::iterator btn_it = m_labelbuttons.begin(); |
722 | LabelList::iterator btn_it_end = m_labelbuttons.end(); | 723 | LabelList::iterator btn_it_end = m_labelbuttons.end(); |
724 | int extra = 0; | ||
723 | for (unsigned int last_x = 0; | 725 | for (unsigned int last_x = 0; |
724 | btn_it != btn_it_end; | 726 | btn_it != btn_it_end; |
725 | ++btn_it, last_x += button_width + border_width) { | 727 | ++btn_it, last_x += button_width + border_width + extra) { |
726 | // since we add border width pixel we should remove | 728 | // since we add border width pixel we should remove |
727 | // the same size for inside width so we can fit all buttons into label | 729 | // the same size for inside width so we can fit all buttons into label |
730 | if (rounding_error != 0) { | ||
731 | extra = 1; | ||
732 | --rounding_error; | ||
733 | } else | ||
734 | extra = 0; | ||
735 | |||
728 | (*btn_it)->moveResize(last_x - border_width, - border_width, | 736 | (*btn_it)->moveResize(last_x - border_width, - border_width, |
729 | button_width, | 737 | button_width + extra, |
730 | label().height() + border_width); | 738 | label().height() + border_width); |
731 | if (isVisible()) | 739 | if (isVisible()) |
732 | (*btn_it)->clear(); | 740 | (*btn_it)->clear(); |