From 0a6ddf31a267648b45538a36223c99951f475359 Mon Sep 17 00:00:00 2001 From: innocenat Date: Thu, 8 Jun 2017 13:09:59 +0700 Subject: [PATCH] Double-clicking order in timetable change wait time This makes the process of setting up timetable manually easier. --- src/timetable_gui.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 5d495598aa..47b49de406 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -572,8 +572,16 @@ struct TimetableWindow : Window { case WID_VT_TIMETABLE_PANEL: { // Main panel. int selected = GetOrderFromTimetableWndPt(pt.y, v); + /* Allow change time by double-clicking order */ + if (click_count == 2) { + this->sel_index = selected == INVALID_ORDER ? -1 : selected; + this->OnClick(pt, WID_VT_CHANGE_TIME, click_count); + return; + } else { + this->sel_index = (selected == INVALID_ORDER || selected == this->sel_index) ? -1 : selected; + } + this->DeleteChildWindows(); - this->sel_index = (selected == INVALID_ORDER || selected == this->sel_index) ? -1 : selected; break; }