mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r3302) - Fix: split drawing of text buttons and the closebox, so the closebox symbol can be centred.
This commit is contained in:
parent
82542799e2
commit
db78ce622d
10
widget.c
10
widget.c
@ -191,7 +191,7 @@ void DrawWindowWidgets(const Window *w)
|
|||||||
goto draw_default;
|
goto draw_default;
|
||||||
}
|
}
|
||||||
|
|
||||||
case WWT_CLOSEBOX: /* WWT_TEXTBTN */
|
case WWT_TEXTBTN: /* WWT_TEXTBTN */
|
||||||
case WWT_4: {
|
case WWT_4: {
|
||||||
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : 0);
|
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : 0);
|
||||||
}
|
}
|
||||||
@ -410,6 +410,14 @@ void DrawWindowWidgets(const Window *w)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case WWT_CLOSEBOX: {
|
||||||
|
assert(r.right - r.left == 10); // ensure the same sizes are used everywhere
|
||||||
|
|
||||||
|
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, 0);
|
||||||
|
DrawString(r.left + 2, r.top + 2, STR_00C5, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case WWT_CAPTION: {
|
case WWT_CAPTION: {
|
||||||
assert(r.bottom - r.top == 13); // XXX - to ensure the same sizes are used everywhere!
|
assert(r.bottom - r.top == 13); // XXX - to ensure the same sizes are used everywhere!
|
||||||
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_BORDERONLY);
|
DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_BORDERONLY);
|
||||||
|
4
window.h
4
window.h
@ -509,7 +509,6 @@ enum WindowWidgetTypes {
|
|||||||
WWT_PANEL_2 = 2, /* button with diff image when clicked */
|
WWT_PANEL_2 = 2, /* button with diff image when clicked */
|
||||||
|
|
||||||
WWT_TEXTBTN = 3, /* button with text */
|
WWT_TEXTBTN = 3, /* button with text */
|
||||||
WWT_CLOSEBOX = WWT_TEXTBTN,
|
|
||||||
WWT_4 = 4, /* button with diff text when clicked */
|
WWT_4 = 4, /* button with diff text when clicked */
|
||||||
WWT_5 = 5, /* label */
|
WWT_5 = 5, /* label */
|
||||||
WWT_6 = 6, /* combo box text area */
|
WWT_6 = 6, /* combo box text area */
|
||||||
@ -522,7 +521,8 @@ enum WindowWidgetTypes {
|
|||||||
WWT_STICKYBOX = 12,
|
WWT_STICKYBOX = 12,
|
||||||
WWT_SCROLL2BAR = 13, /* 2nd vertical scrollbar*/
|
WWT_SCROLL2BAR = 13, /* 2nd vertical scrollbar*/
|
||||||
WWT_RESIZEBOX = 14,
|
WWT_RESIZEBOX = 14,
|
||||||
WWT_LAST = 15, /* Last Item. use WIDGETS_END to fill up padding!! */
|
WWT_CLOSEBOX = 15,
|
||||||
|
WWT_LAST = 16, /* Last Item. use WIDGETS_END to fill up padding!! */
|
||||||
|
|
||||||
WWT_MASK = 31,
|
WWT_MASK = 31,
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user