summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-10-15 03:40:53 +0000
committerbelugas <belugas@openttd.org>2006-10-15 03:40:53 +0000
commitc22b610c52708587e3e4efc3dfca175a0c2bc8fa (patch)
tree9410dbf36efcdb70b05872f222932a9c63d1f86f
parent6b6d908308c9aaf32f7b99500715319aaab1a51c (diff)
downloadopenttd-c22b610c52708587e3e4efc3dfca175a0c2bc8fa.tar.xz
(svn r6777) -GuiChange: When painting a lowered button on CargoPaymentsRates, displace the content of one pixel to the right and to the bottom. This will make it look like a normal button
-rw-r--r--graph_gui.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/graph_gui.c b/graph_gui.c
index 621674edf..5dc325ffe 100644
--- a/graph_gui.c
+++ b/graph_gui.c
@@ -739,10 +739,16 @@ static void CargoPaymentRatesWndProc(Window *w, WindowEvent *e)
gd.unk61C = 10;
for (i = 0; i != NUM_CARGO; i++) {
- GfxFillRect(x, y, x+8, y+5, 0);
- GfxFillRect(x+1, y+1, x+7, y+4, _cargo_legend_colors[i]);
+ /* Since the buttons have no text, no images,
+ * both the text and the colored box have to be manually painted.
+ * clk_dif will move one pixel down and one pixel to the right
+ * when the button is clicked */
+ byte clk_dif = IsWindowWidgetLowered(w, i + 3) ? 1 : 0;
+
+ GfxFillRect(x + clk_dif, y + clk_dif, x + 8 + clk_dif, y + 5 + clk_dif, 0);
+ GfxFillRect(x + 1 + clk_dif, y + 1 + clk_dif, x + 7 + clk_dif, y + 4 + clk_dif, _cargo_legend_colors[i]);
SetDParam(0, _cargoc.names_s[i]);
- DrawString(x+14, y, STR_7065, 0);
+ DrawString(x + 14 + clk_dif, y + clk_dif, STR_7065, 0);
y += 8;
gd.colors[i] = _cargo_legend_colors[i];
for (j = 0; j != 20; j++) {