Close news window more easily
This commit is contained in:
@@ -190,7 +190,7 @@ static const NWidgetPart _nested_small_news_widgets[] = {
|
||||
NWidget(WWT_INSET, COLOUR_LIGHT_BLUE, WID_N_INSET), SetPadding(2, 2, 2, 2),
|
||||
NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_N_VIEWPORT), SetSizingType(NWST_VIEWPORT), SetPadding(1, 1, 1, 1), SetMinimalSize(274, 47), SetFill(1, 0),
|
||||
EndContainer(),
|
||||
NWidget(WWT_EMPTY, COLOUR_WHITE, WID_N_MESSAGE), SetMinimalSize(275, 20), SetFill(1, 0), SetPadding(0, 5, 0, 5),
|
||||
NWidget(WWT_EMPTY, COLOUR_WHITE, WID_N_MESSAGE), SetMinimalSize(275, 20), SetFill(1, 0), SetPadding(0, 5, 0, 5), SetSizingType(NWST_STEP),
|
||||
EndContainer(),
|
||||
};
|
||||
|
||||
|
||||
@@ -2354,6 +2354,7 @@ bool GetWindowDraggedOffScreen(const Window *w)
|
||||
if (w->left + w->width > edge.right && w->left > visible.left) return true;
|
||||
if (w->top < edge.top && w->top + w->height < visible.bottom) return true;
|
||||
if (w->top + w->height > edge.bottom && w->top > visible.top) return true;
|
||||
if (w->window_class == WC_NEWS_WINDOW && abs(w->left + w->width / 2 - _screen.width / 2) > 3) return true; // News window closes with a light flick to the side
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user