From 1a05e959451e042f639632a08f7c5882d88498f8 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 7 Dec 2022 23:32:27 +0000 Subject: [PATCH] Fix #10214: League and graph buttons in toolbar not having a default action --- src/toolbar_gui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index 1785a2021f..c0967054b7 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -716,7 +716,7 @@ static CallBackFunction ToolbarGraphsClick(Window *w) if (_toolbar_mode != TB_NORMAL) AddDropDownLeagueTableOptions(list); - ShowDropDownList(w, std::move(list), 0, WID_TN_GRAPHS, 140, true, true); + ShowDropDownList(w, std::move(list), GRMN_OPERATING_PROFIT_GRAPH, WID_TN_GRAPHS, 140, true, true); if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return CBF_NONE; @@ -728,7 +728,8 @@ static CallBackFunction ToolbarLeagueClick(Window *w) AddDropDownLeagueTableOptions(list); - ShowDropDownList(w, std::move(list), 0, WID_TN_LEAGUE, 140, true, true); + int selected = list[0]->result; + ShowDropDownList(w, std::move(list), selected, WID_TN_LEAGUE, 140, true, true); if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return CBF_NONE;