diff --git a/src/lang/english.txt b/src/lang/english.txt index 811c38810f..1e8ea31162 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -285,7 +285,7 @@ STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Close wi STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Window title - drag this to move window STR_TOOLTIP_SHADE :{BLACK}Shade window - only show the title bar STR_TOOLTIP_DEBUG :{BLACK}Show NewGRF debug information -STR_TOOLTIP_DEFSIZE :{BLACK}Resize window to default size. Ctrl+Click to store current size as default +STR_TOOLTIP_DEFSIZE :{BLACK}Resize window to default size. Ctrl+Click to store current size as default. Double Ctrl+Click to reset stored default STR_TOOLTIP_STICKY :{BLACK}Mark this window as uncloseable by the 'Close All Windows' key. Ctrl+Click to also save state as default STR_TOOLTIP_RESIZE :{BLACK}Click and drag to resize this window STR_TOOLTIP_TOGGLE_LARGE_SMALL_WINDOW :{BLACK}Toggle large/small window size diff --git a/src/window.cpp b/src/window.cpp index 022f917c60..da33f07c33 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -685,8 +685,13 @@ static void DispatchLeftClickEvent(Window *w, int x, int y, int click_count) case WWT_DEFSIZEBOX: { if (_ctrl_pressed) { - w->window_desc.pref_width = w->width; - w->window_desc.pref_height = w->height; + if (click_count > 1) { + w->window_desc.pref_width = 0; + w->window_desc.pref_height = 0; + } else { + w->window_desc.pref_width = w->width; + w->window_desc.pref_height = w->height; + } } else { int16_t def_width = std::max(std::min(w->window_desc.GetDefaultWidth(), _screen.width), w->nested_root->smallest_x); int16_t def_height = std::max(std::min(w->window_desc.GetDefaultHeight(), _screen.height - 50), w->nested_root->smallest_y);