20 |
20 |
21 namespace gui { |
21 namespace gui { |
22 |
22 |
23 /*virtual*/ void CaptionBar::DrawBackground(EvtPaint &ev) |
23 /*virtual*/ void CaptionBar::DrawBackground(EvtPaint &ev) |
24 { |
24 { |
25 // DrawFrameRect(m_color, FR_NONE); |
|
26 |
|
27 BaseWindow *w = GetWindow(); |
25 BaseWindow *w = GetWindow(); |
28 assert(w != NULL); |
26 assert(w != NULL); |
29 |
27 |
30 byte caption_color = w->caption_color; |
28 byte caption_color = w->caption_color; |
31 assert(Height() == 14); // XXX - to ensure the same sizes are used everywhere! |
29 assert(Height() == 14); // XXX - to ensure the same sizes are used everywhere! |
32 DrawFrameRect(Left(), Top(), Right(), Bottom(), m_color, FR_BORDERONLY); |
30 DrawFrameRect(Left(), Top(), Right(), Bottom(), m_color, FR_BORDERONLY); |
33 DrawFrameRect(Left() + 1, Top() + 1, Right() - 1, Bottom() - 1, m_color, (caption_color == 0xFF) ? FR_LOWERED | FR_DARKENED : FR_LOWERED | FR_DARKENED | FR_BORDERONLY); |
31 DrawFrameRect(Left() + 1, Top() + 1, Right() - 1, Bottom() - 1, m_color, (caption_color == 0xFF) ? FR_LOWERED | FR_DARKENED : FR_LOWERED | FR_DARKENED | FR_BORDERONLY); |
34 if (caption_color != 0xFF) { |
32 if (caption_color != 0xFF) { |
35 GfxFillRect(Left() + 2, Top() + 2, Right() - 2, Bottom() - 2, _colour_gradient[_player_colors[caption_color]][4]); |
33 GfxFillRect(Left() + 2, Top() + 2, Right() - 2, Bottom() - 2, _colour_gradient[_player_colors[caption_color]][4]); |
36 } |
34 } |
37 |
|
38 //assert(r.bottom - r.top == 13); // XXX - to ensure the same sizes are used everywhere! |
|
39 //DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_BORDERONLY); |
|
40 //DrawFrameRect(r.left+1, r.top+1, r.right-1, r.bottom-1, wi->color, (caption_color == 0xFF) ? FR_LOWERED | FR_DARKENED : FR_LOWERED | FR_DARKENED | FR_BORDERONLY); |
|
41 |
|
42 //if (caption_color != 0xFF) { |
|
43 // GfxFillRect(r.left+2, r.top+2, r.right-2, r.bottom-2, _colour_gradient[_player_colors[caption_color]][4]); |
|
44 //} |
|
45 } |
35 } |
46 |
36 |
47 /*virtual*/ void CaptionBar::OnPaint(EvtPaint &ev) |
37 /*virtual*/ void CaptionBar::OnPaint(EvtPaint &ev) |
48 { |
38 { |
49 DrawBackground(ev); |
39 DrawBackground(ev); |