1
0
Fork 0

Change tooltips to enable explicit.

Instead of using a negative delay to disable, make the setting
operate directly. This simplifies UI on top.
This commit is contained in:
James Turner 2013-10-25 09:18:59 +01:00
parent 81e86f5b20
commit 5c97b7e713

View file

@ -164,12 +164,14 @@ public:
{
tooltipTimeoutDone = false;
hoverPickScheduled = false;
tooltipsEnabled = false;
fgGetNode("/sim/mouse/hide-cursor", true )->addChangeListener(this, true);
fgGetNode("/sim/mouse/cursor-timeout-sec", true )->addChangeListener(this, true);
fgGetNode("/sim/mouse/right-button-mode-cycle-enabled", true)->addChangeListener(this, true);
fgGetNode("/sim/mouse/tooltip-delay-msec", true)->addChangeListener(this, true);
fgGetNode("/sim/mouse/click-shows-tooltip", true)->addChangeListener(this, true);
fgGetNode("/sim/mouse/tooltips-enabled", true)->addChangeListener(this, true);
fgGetNode("/sim/mouse/drag-sensitivity", true)->addChangeListener(this, true);
fgGetNode("/sim/mouse/invert-mouse-wheel", true)->addChangeListener(this, true);
}
@ -313,7 +315,8 @@ public:
rightClickModeCycle = node->getBoolValue();
} else if (node->getNameString() == "click-shows-tooltip") {
clickTriggersTooltip = node->getBoolValue();
} else if (node->getNameString() == "tooltips-enabled") {
tooltipsEnabled = node->getBoolValue();
}
}
@ -327,6 +330,7 @@ public:
bool clickTriggersTooltip;
int tooltipDelayMsec, cursorTimeoutMsec;
bool rightClickModeCycle;
bool tooltipsEnabled;
SGPropertyNode_ptr xSizeNode;
SGPropertyNode_ptr ySizeNode;
@ -478,9 +482,8 @@ void FGMouseInput::update ( double dt )
d->hoverPickScheduled = false;
}
// if delay is <= 0, disable tooltips
if ( !d->tooltipTimeoutDone &&
(d->tooltipDelayMsec > 0) &&
d->tooltipsEnabled &&
(m.timeSinceLastMove.elapsedMSec() > d->tooltipDelayMsec))
{
d->tooltipTimeoutDone = true;