(svn r26815) -Change: Allow to set the granularity of the tooltip hover time in milliseconds instead of seconds. New default value is 250ms
This commit is contained in:
@@ -752,7 +752,7 @@ static void DispatchRightClickEvent(Window *w, int x, int 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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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;
|
||||
|
Reference in New Issue
Block a user