Feature: Make news and errors close hotkeys configurable

This commit is contained in:
dP
2020-07-05 21:18:35 +03:00
committed by Michael Lutz
parent 8f3d1ec970
commit 0110fa12da
5 changed files with 40 additions and 18 deletions

View File

@@ -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()
{