summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2010-04-22 01:30:41 +0000
committercorvid <corvid@lavabit.com>2010-04-22 01:30:41 +0000
commit058a4701d0bef09d21658923e0b4a30e12643b8e (patch)
tree30af5bb95c6fa73c09b3e5394e31329df7ed7843
parentd20fe82191d472b3073b793aee4508323a95b075 (diff)
move generic tooltip enter/leave to Widget
Technically, Textblock's notifyImpl()s should probably call the Widget one as well. It doesn't matter currently, since we don't look for title attrs on elements that correspond to entire Textblocks.
-rw-r--r--dw/image.cc10
-rw-r--r--dw/ui.cc2
-rw-r--r--dw/widget.cc12
3 files changed, 14 insertions, 10 deletions
diff --git a/dw/image.cc b/dw/image.cc
index 13212cdc..cab40ed5 100644
--- a/dw/image.cc
+++ b/dw/image.cc
@@ -247,28 +247,22 @@ void Image::enterNotifyImpl (core::EventCrossing *event)
{
// BUG: this is wrong for image maps, but the cursor position is unknown.
currLink = getStyle()->x_link;
- core::style::Tooltip *tooltip = getStyle()->x_tooltip;
if (currLink != -1) {
(void) layout->emitLinkEnter (this, currLink, -1, -1, -1);
}
- if (tooltip) {
- tooltip->onEnter();
- }
+ Widget::enterNotifyImpl(event);
}
void Image::leaveNotifyImpl (core::EventCrossing *event)
{
- core::style::Tooltip *tooltip = getStyle()->x_tooltip;
clicking = false;
if (currLink != -1) {
currLink = -1;
(void) layout->emitLinkEnter (this, -1, -1, -1, -1);
}
- if (tooltip) {
- tooltip->onLeave();
- }
+ Widget::leaveNotifyImpl(event);
}
/*
diff --git a/dw/ui.cc b/dw/ui.cc
index 7cad6332..058dfde8 100644
--- a/dw/ui.cc
+++ b/dw/ui.cc
@@ -62,11 +62,13 @@ void Embed::sizeAllocateImpl (Allocation *allocation)
void Embed::enterNotifyImpl (core::EventCrossing *event)
{
resource->emitEnter();
+ Widget::enterNotifyImpl(event);
}
void Embed::leaveNotifyImpl (core::EventCrossing *event)
{
resource->emitLeave();
+ Widget::leaveNotifyImpl(event);
}
bool Embed::buttonPressImpl (core::EventButton *event)
diff --git a/dw/widget.cc b/dw/widget.cc
index 670e2c43..fb0d29e0 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -594,12 +594,20 @@ bool Widget::motionNotifyImpl (EventMotion *event)
return false;
}
-void Widget::enterNotifyImpl (EventCrossing *event)
+void Widget::enterNotifyImpl (EventCrossing *)
{
+ core::style::Tooltip *tooltip = getStyle()->x_tooltip;
+
+ if (tooltip)
+ tooltip->onEnter();
}
-void Widget::leaveNotifyImpl (EventCrossing *event)
+void Widget::leaveNotifyImpl (EventCrossing *)
{
+ core::style::Tooltip *tooltip = getStyle()->x_tooltip;
+
+ if (tooltip)
+ tooltip->onLeave();
}
void Widget::removeChild (Widget *child)