]> git.lyx.org Git - features.git/commitdiff
Get rid of annoying tooltips. ERT tooltip survived for the time being.
authorPavel Sanda <sanda@lyx.org>
Fri, 29 Aug 2008 00:38:51 +0000 (00:38 +0000)
committerPavel Sanda <sanda@lyx.org>
Fri, 29 Aug 2008 00:38:51 +0000 (00:38 +0000)
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg142984.html

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26250 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCollapsable.cpp
src/insets/InsetFloat.cpp

index 3691337dec8eb93cc49595fb6e213eaf6769f6b7..c5b3cbe06b1aef316ec25d94901ce7d554e3797a 100644 (file)
@@ -109,19 +109,9 @@ docstring InsetCollapsable::toolTip(BufferView const & bv, int x, int y) const
        Dimension dim = dimensionCollapsed();
        if (geometry() == NoButton)
                return translateIfPossible(layout_->labelstring());
-       if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des)
+       if (x > xo(bv) + dim.wid || y > yo(bv) + dim.des || isOpen())
                return docstring();
 
-       docstring default_tip;
-       switch (status_) {
-       case Open:
-               default_tip = _("Left-click to collapse the inset");
-               break;
-       case Collapsed:
-               default_tip = _("Left-click to open the inset");
-               break;
-       }
-
        OutputParams rp(&buffer().params().encoding());
        odocstringstream ods;
        InsetText::plaintext(ods, rp);
@@ -129,9 +119,7 @@ docstring InsetCollapsable::toolTip(BufferView const & bv, int x, int y) const
        // shorten it if necessary
        if (content_tip.size() > 200)
                content_tip = content_tip.substr(0, 200) + "...";
-       if (!isOpen() && !content_tip.empty())
-               return content_tip + '\n' + default_tip;
-       return default_tip;
+       return content_tip;
 }
 
 
index 0f514bd1c35a5258a31946162ce46f6d56d665c3..0a537598697556e6d393cdc038aed8aaafefb1e0 100644 (file)
@@ -129,19 +129,11 @@ InsetFloat::~InsetFloat()
 
 docstring InsetFloat::toolTip(BufferView const & bv, int x, int y) const
 {
-       if (InsetCollapsable::toolTip(bv, x, y).empty())
+       if (InsetCollapsable::toolTip(bv, x, y).empty() || isOpen())
                return docstring();
 
-       docstring default_tip;
-       if (isOpen())
-               default_tip = _("Left-click to collapse the inset");
-       else
-               default_tip = _("Left-click to open the inset");
        OutputParams rp(&buffer().params().encoding());
-       docstring caption_tip = getCaptionText(rp);
-       if (!isOpen() && !caption_tip.empty())
-               return caption_tip + '\n' + default_tip;
-       return default_tip;
+       return getCaptionText(rp);
 }