From 0110fa12daabecfaa5e6454ba6f93b8024db552e Mon Sep 17 00:00:00 2001 From: dP Date: Sun, 5 Jul 2020 21:18:35 +0300 Subject: Feature: Make news and errors close hotkeys configurable --- src/news_gui.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/news_gui.cpp') diff --git a/src/news_gui.cpp b/src/news_gui.cpp index da613c55e..a3f73d729 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -519,16 +519,6 @@ struct NewsWindow : Window { } } - EventState OnKeyPress(WChar key, uint16 keycode) override - { - if (keycode == WKC_SPACE) { - /* Don't continue. */ - delete this; - return ES_HANDLED; - } - return ES_NOT_HANDLED; - } - /** * Some data on this window has become invalid. * @param data Information about the changed data. @@ -603,7 +593,6 @@ private: /* static */ int NewsWindow::duration = 0; // Instance creation. - /** Open up an own newspaper window for the news item */ static void ShowNewspaper(const NewsItem *ni) { @@ -1033,6 +1022,17 @@ static void ShowNewsMessage(const NewsItem *ni) } } +/** + * Close active news message window + * @return true if a window was closed. + */ +bool HideActiveNewsMessage() { + NewsWindow *w = (NewsWindow*)FindWindowById(WC_NEWS_WINDOW, 0); + if (w == nullptr) return false; + delete w; + return true; +} + /** Show previous news item */ void ShowLastNewsMessage() { -- cgit v1.2.3-54-g00ecf