diff options
Diffstat (limited to 'dw')
-rw-r--r-- | dw/textblock.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc index 52ea7ed3..0958c1d2 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -521,28 +521,22 @@ bool Textblock::motionNotifyImpl (core::EventMotion *event) if (event->state & core::BUTTON1_MASK) return sendSelectionEvent (core::SelectionState::BUTTON_MOTION, event); else { - int linkOld, wordIndex; - core::style::Tooltip *tooltipOld; + int wordIndex, linkOld = hoverLink; + core::style::Tooltip *tooltipOld = hoverTooltip; wordIndex = findWord (event->xWidget, event->yWidget); // cursor from word or widget style - if (wordIndex == -1) - setCursor (getStyle()->cursor); - else - setCursor (words->getRef(wordIndex)->style->cursor); - - linkOld = hoverLink; - tooltipOld = hoverTooltip; - if (wordIndex == -1) { + setCursor (getStyle()->cursor); hoverLink = -1; hoverTooltip = NULL; } else { - hoverLink = words->getRef(wordIndex)->style->x_link; - hoverTooltip = words->getRef(wordIndex)->style->x_tooltip; + core::style::Style *style = words->getRef(wordIndex)->style; + setCursor (style->cursor); + hoverLink = style->x_link; + hoverTooltip = style->x_tooltip; } - // Show/hide tooltip if (tooltipOld != hoverTooltip) { if (tooltipOld) |