Index: src/lang/english.txt =================================================================== --- src/lang/english.txt (Revision 27603) +++ src/lang/english.txt (Arbeitskopie) @@ -1372,6 +1372,8 @@ STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING :Left-click scrolling: {STRING2} STR_CONFIG_SETTING_LEFT_MOUSE_BTN_SCROLLING_HELPTEXT :Enable scrolling the map by dragging it with the left mouse button. This is especially useful when using a touch-screen for scrolling +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE :Close window on right-click: {STRING2} +STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT :Closes a window by right-clicking inside it. Disables the tooltip on right-click! STR_CONFIG_SETTING_AUTOSAVE :Autosave: {STRING2} STR_CONFIG_SETTING_AUTOSAVE_HELPTEXT :Select interval between automatic game saves Index: src/settings_gui.cpp =================================================================== --- src/settings_gui.cpp (Revision 27603) +++ src/settings_gui.cpp (Arbeitskopie) @@ -1509,6 +1509,7 @@ viewports->Add(new SettingEntry("gui.reverse_scroll")); viewports->Add(new SettingEntry("gui.smooth_scroll")); viewports->Add(new SettingEntry("gui.left_mouse_btn_scrolling")); + viewports->Add(new SettingEntry("gui.right_mouse_wnd_close")); /* While the horizontal scrollwheel scrolling is written as general code, only * the cocoa (OSX) driver generates input for it. * Since it's also able to completely disable the scrollwheel will we display it on all platforms anyway */ Index: src/settings_type.h =================================================================== --- src/settings_type.h (Revision 27603) +++ src/settings_type.h (Arbeitskopie) @@ -113,6 +113,7 @@ uint8 scrollwheel_multiplier; ///< how much 'wheel' per incoming event from the OS? bool timetable_arrival_departure; ///< show arrivals and departures in vehicle timetables bool left_mouse_btn_scrolling; ///< left mouse button scroll + bool right_mouse_wnd_close; ///< close window with right click bool pause_on_newgame; ///< whether to start new games paused or not bool enable_signal_gui; ///< show the signal GUI when the signal button is pressed Year coloured_news_year; ///< when does newspaper become coloured? Index: src/table/settings.ini =================================================================== --- src/table/settings.ini (Revision 27603) +++ src/table/settings.ini (Arbeitskopie) @@ -2584,6 +2584,14 @@ cat = SC_BASIC [SDTC_BOOL] +var = gui.right_mouse_wnd_close +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = false +str = STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE +strhelp = STR_CONFIG_SETTING_RIGHT_MOUSE_WND_CLOSE_HELPTEXT +cat = SC_BASIC + +[SDTC_BOOL] var = gui.measure_tooltip flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC def = true Index: src/window.cpp =================================================================== --- src/window.cpp (Revision 27603) +++ src/window.cpp (Arbeitskopie) @@ -771,8 +771,9 @@ Point pt = { x, y }; if (w->OnRightClick(pt, wid->index)) return; } - - if (_settings_client.gui.hover_delay_ms == 0 && wid->tool_tip != 0) GuiShowTooltips(w, wid->tool_tip, 0, NULL, TCC_RIGHT_CLICK); + /* Right-click close is enabled and there is a closebox */ + if (_settings_client.gui.right_mouse_wnd_close && w->nested_root->GetWidgetOfType(WWT_CLOSEBOX)) delete w; + else if (_settings_client.gui.hover_delay_ms == 0 && wid->tool_tip != 0) GuiShowTooltips(w, wid->tool_tip, 0, NULL, TCC_RIGHT_CLICK); } /**