diff options
author | peter1138 <peter1138@openttd.org> | 2008-01-18 10:36:55 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2008-01-18 10:36:55 +0000 |
commit | 68707808c015db1cda0723882ffce99977d4593c (patch) | |
tree | 4a7f2fbd16bbc5ad48c890141c722273c2efea2e /src/network | |
parent | b7f50533c29ea74e9973ac641ec677eb69411d5d (diff) | |
download | openttd-68707808c015db1cda0723882ffce99977d4593c.tar.xz |
(svn r11915) -Codechange: Add a function to draw a sort button's up/down arrow. Arrows are now drawn in a consistent position based on the widget, instead of randomly positioned by pixel.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 022a0dabd..7ee613cd1 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -268,7 +268,7 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e) case WE_PAINT: { const NetworkGameList *sel = nd->server; - const char *arrow = (ld->flags & VL_DESC) ? DOWNARROW : UPARROW; + const SortButtonState arrow = (ld->flags & VL_DESC) ? SBS_DOWN : SBS_UP; if (ld->flags & VL_REBUILD) { BuildNetworkGameList(&WP(w, network_ql_d)); @@ -300,9 +300,9 @@ static void NetworkGameWindowWndProc(Window *w, WindowEvent *e) /* Sort based on widgets: name, clients, compatibility */ switch (ld->sort_type) { - case NGWW_NAME - NGWW_NAME: DoDrawString(arrow, w->widget[NGWW_NAME].right - 10, 42, TC_BLACK); break; - case NGWW_CLIENTS - NGWW_NAME: DoDrawString(arrow, w->widget[NGWW_CLIENTS].right - 10, 42, TC_BLACK); break; - case NGWW_INFO - NGWW_NAME: DoDrawString(arrow, w->widget[NGWW_INFO].right - 10, 42, TC_BLACK); break; + case NGWW_NAME - NGWW_NAME: DrawSortButtonState(w, NGWW_NAME, arrow); break; + case NGWW_CLIENTS - NGWW_NAME: DrawSortButtonState(w, NGWW_CLIENTS, arrow); break; + case NGWW_INFO - NGWW_NAME: DrawSortButtonState(w, NGWW_INFO, arrow); break; } { // draw list of games |