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
 
@@ -1271,8 +1271,8 @@ STR_CONFIG_SETTING_ERRMSG_DURATION      
 
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
src/settings_gui.cpp
Show inline comments
 
@@ -1467,7 +1467,7 @@ static SettingsContainer &GetSettingsTre
 
			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"));
src/settings_type.h
Show inline comments
 
@@ -83,7 +83,7 @@ struct GUISettings {
 
	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
src/table/settings.ini
Show inline comments
 
@@ -2570,13 +2570,14 @@ strhelp  = STR_CONFIG_SETTING_ERRMSG_DUR
 
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
src/window.cpp
Show inline comments
 
@@ -752,7 +752,7 @@ static void DispatchRightClickEvent(Wind
 
		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);
 
}
 

	
 
/**
 
@@ -2879,7 +2879,7 @@ void HandleMouseEvents()
 
	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) {
 
@@ -2887,7 +2887,7 @@ void HandleMouseEvents()
 
			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)