summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-18 01:01:19 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-18 01:01:19 +0300
commite2210e88b0cf4620b820aea083c231be3eadb80a (patch)
tree38b6043daa63387c8d15438c3856bd4ec5d81ff7 /src
parent35428de23796a505aad33654e1506b27ba1f89f7 (diff)
downloadmv-e2210e88b0cf4620b820aea083c231be3eadb80a.tar.gz
mv-e2210e88b0cf4620b820aea083c231be3eadb80a.tar.bz2
mv-e2210e88b0cf4620b820aea083c231be3eadb80a.tar.xz
mv-e2210e88b0cf4620b820aea083c231be3eadb80a.zip
Use tooltiplistener in labels.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/label.cpp4
-rw-r--r--src/gui/widgets/label.h5
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index 125adbce9..b1ec8e61e 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -76,6 +76,7 @@ int Label::mInstances = 0;
Label::Label(const Widget2 *const widget) :
Widget(widget),
+ ToolTipListener(),
mCaption(),
mAlignment(Graphics::LEFT),
mPadding(0)
@@ -86,6 +87,7 @@ Label::Label(const Widget2 *const widget) :
Label::Label(const Widget2 *const widget,
const std::string &caption) :
Widget(widget),
+ ToolTipListener(),
mCaption(caption),
mAlignment(Graphics::LEFT),
mPadding(0)
@@ -110,10 +112,12 @@ Label::~Label()
if (theme)
theme->unload(mSkin);
}
+ removeMouseListener(this);
}
void Label::init()
{
+ addMouseListener(this);
mAllowLogic = false;
mForegroundColor = getThemeColor(Theme::LABEL);
mForegroundColor2 = getThemeColor(Theme::LABEL_OUTLINE);
diff --git a/src/gui/widgets/label.h b/src/gui/widgets/label.h
index 9c9875a0b..9af6ed123 100644
--- a/src/gui/widgets/label.h
+++ b/src/gui/widgets/label.h
@@ -67,6 +67,8 @@
#include "gui/widgets/widget.h"
+#include "listeners/tooltiplistener.h"
+
#include "localconsts.h"
class Skin;
@@ -77,7 +79,8 @@ class Skin;
*
* \ingroup GUI
*/
-class Label final : public Widget
+class Label final : public Widget,
+ public ToolTipListener
{
public:
/**