Changeset - r21677:f163b67c7199
[Not reviewed]
master
0 5 0
planetmaker - 10 years ago 2014-09-13 13:30:31
planetmaker@openttd.org
(svn r26815) -Change: Allow to set the granularity of the tooltip hover time in milliseconds instead of seconds. New default value is 250ms
5 files changed with 13 insertions and 12 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -1268,14 +1268,14 @@ STR_CONFIG_SETTING_AUTORENEW_MONTHS_VALU
 
STR_CONFIG_SETTING_AUTORENEW_MONEY                              :Autorenew minimum needed money for renew: {STRING2}
 
STR_CONFIG_SETTING_AUTORENEW_MONEY_HELPTEXT                     :Minimal amount of money that must remain in the bank before considering auto-renewing vehicles
 
STR_CONFIG_SETTING_ERRMSG_DURATION                              :Duration of error message: {STRING2}
 
STR_CONFIG_SETTING_ERRMSG_DURATION_HELPTEXT                     :Duration for displaying error messages in a red window. Note that some (critical) error messages are not closed automatically after this time, but must be closed manually
 
STR_CONFIG_SETTING_ERRMSG_DURATION_VALUE                        :{COMMA} second{P 0 "" s}
 
STR_CONFIG_SETTING_HOVER_DELAY                                  :Show tooltips: {STRING2}
 
STR_CONFIG_SETTING_HOVER_DELAY_HELPTEXT                         :Delay before tooltips are displayed when hovering the mouse over some interface element. Alternatively tooltips can be bound to the right mouse button
 
STR_CONFIG_SETTING_HOVER_DELAY_VALUE                            :Hover for {COMMA} second{P 0 "" s}
 
STR_CONFIG_SETTING_HOVER_DELAY_HELPTEXT                         :Delay before tooltips are displayed when hovering the mouse over some interface element. Alternatively tooltips are bound to the right mouse button when this value is set to 0.
 
STR_CONFIG_SETTING_HOVER_DELAY_VALUE                            :Hover for {COMMA} millisecond{P 0 "" s}
 
STR_CONFIG_SETTING_HOVER_DELAY_DISABLED                         :Right click
 
STR_CONFIG_SETTING_POPULATION_IN_LABEL                          :Show town population in the town name label: {STRING2}
 
STR_CONFIG_SETTING_POPULATION_IN_LABEL_HELPTEXT                 :Display the population of towns in their label on the map
 
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS                         :Thickness of lines in graphs: {STRING2}
 
STR_CONFIG_SETTING_GRAPH_LINE_THICKNESS_HELPTEXT                :Width of the line in the graphs. A thin line is more precisely readable, a thicker line is easier to see and colours are easier to distinguish
 

	
src/settings_gui.cpp
Show inline comments
 
@@ -1464,13 +1464,13 @@ static SettingsContainer &GetSettingsTre
 

	
 
		SettingsPage *interface = main->Add(new SettingsPage(STR_CONFIG_SETTING_INTERFACE));
 
		{
 
			SettingsPage *general = interface->Add(new SettingsPage(STR_CONFIG_SETTING_INTERFACE_GENERAL));
 
			{
 
				general->Add(new SettingEntry("gui.osk_activation"));
 
				general->Add(new SettingEntry("gui.hover_delay"));
 
				general->Add(new SettingEntry("gui.hover_delay_ms"));
 
				general->Add(new SettingEntry("gui.errmsg_duration"));
 
				general->Add(new SettingEntry("gui.window_snap_radius"));
 
				general->Add(new SettingEntry("gui.window_soft_limit"));
 
			}
 

	
 
			SettingsPage *viewports = interface->Add(new SettingsPage(STR_CONFIG_SETTING_INTERFACE_VIEWPORTS));
src/settings_type.h
Show inline comments
 
@@ -80,13 +80,13 @@ struct GUISettings {
 
	bool   show_finances;                    ///< show finances at end of year
 
	bool   sg_new_nonstop;                   ///< ttdpatch compatible nonstop handling read from pre v93 savegames
 
	bool   new_nonstop;                      ///< ttdpatch compatible nonstop handling
 
	uint8  stop_location;                    ///< what is the default stop location of trains?
 
	uint8  auto_scrolling;                   ///< scroll when moving mouse to the edge (see #ViewportAutoscrolling)
 
	byte   errmsg_duration;                  ///< duration of error message
 
	byte   hover_delay;                      ///< time required to activate a hover event, in seconds
 
	uint16 hover_delay_ms;                   ///< time required to activate a hover event, in milliseconds
 
	bool   link_terraform_toolbar;           ///< display terraform toolbar when displaying rail, road, water and airport toolbars
 
	uint8  smallmap_land_colour;             ///< colour used for land and heightmap at the smallmap
 
	bool   reverse_scroll;                   ///< right-Click-Scrolling scrolls in the opposite direction
 
	bool   smooth_scroll;                    ///< smooth scroll viewports
 
	bool   measure_tooltip;                  ///< show a permanent tooltip when dragging tools
 
	byte   liveries;                         ///< options for displaying company liveries, 0=none, 1=self, 2=all
src/table/settings.ini
Show inline comments
 
@@ -2567,19 +2567,20 @@ min      = 0
 
max      = 20
 
str      = STR_CONFIG_SETTING_ERRMSG_DURATION
 
strhelp  = STR_CONFIG_SETTING_ERRMSG_DURATION_HELPTEXT
 
strval   = STR_CONFIG_SETTING_ERRMSG_DURATION_VALUE
 

	
 
[SDTC_VAR]
 
var      = gui.hover_delay
 
type     = SLE_UINT8
 
var      = gui.hover_delay_ms
 
type     = SLE_UINT16
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
guiflags = SGF_0ISDISABLED
 
def      = 2
 
min      = 1
 
max      = 5
 
def      = 250
 
min      = 50
 
max      = 6000
 
interval = 50
 
str      = STR_CONFIG_SETTING_HOVER_DELAY
 
strhelp  = STR_CONFIG_SETTING_HOVER_DELAY_HELPTEXT
 
strval   = STR_CONFIG_SETTING_HOVER_DELAY_VALUE
 

	
 
[SDTC_OMANY]
 
var      = gui.osk_activation
src/window.cpp
Show inline comments
 
@@ -749,13 +749,13 @@ static void DispatchRightClickEvent(Wind
 
	/* No widget to handle, or the window is not interested in it. */
 
	if (wid->index >= 0) {
 
		Point pt = { x, y };
 
		if (w->OnRightClick(pt, wid->index)) return;
 
	}
 

	
 
	if (_settings_client.gui.hover_delay == 0 && wid->tool_tip != 0) GuiShowTooltips(w, wid->tool_tip, 0, NULL, TCC_RIGHT_CLICK);
 
	if (_settings_client.gui.hover_delay_ms == 0 && wid->tool_tip != 0) GuiShowTooltips(w, wid->tool_tip, 0, NULL, TCC_RIGHT_CLICK);
 
}
 

	
 
/**
 
 * Dispatch hover of the mouse over a window.
 
 * @param w Window to dispatch event in.
 
 * @param x X coordinate of the click.
 
@@ -2876,21 +2876,21 @@ void HandleMouseEvents()
 
		_input_events_this_tick++;
 
	}
 

	
 
	static uint32 hover_time = 0;
 
	static Point hover_pos = {0, 0};
 

	
 
	if (_settings_client.gui.hover_delay > 0) {
 
	if (_settings_client.gui.hover_delay_ms > 0) {
 
		if (!_cursor.in_window || click != MC_NONE || mousewheel != 0 || _left_button_down || _right_button_down ||
 
				hover_pos.x == 0 || abs(_cursor.pos.x - hover_pos.x) >= MAX_OFFSET_HOVER  ||
 
				hover_pos.y == 0 || abs(_cursor.pos.y - hover_pos.y) >= MAX_OFFSET_HOVER) {
 
			hover_pos = _cursor.pos;
 
			hover_time = _realtime_tick;
 
			_mouse_hovering = false;
 
		} else {
 
			if (hover_time != 0 && _realtime_tick > hover_time + _settings_client.gui.hover_delay * 1000) {
 
			if (hover_time != 0 && _realtime_tick > hover_time + _settings_client.gui.hover_delay_ms) {
 
				click = MC_HOVER;
 
				_input_events_this_tick++;
 
				_mouse_hovering = true;
 
			}
 
		}
 
	}
0 comments (0 inline, 0 general)