]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.cpp
* src/insets/InsetTabular.h:
[lyx.git] / src / insets / InsetFloat.cpp
index f449e97783e7aec983cd436187364b2fa9603c67..a595b2e0321f5560530f58b5abef6d6fd352c9b4 100644 (file)
@@ -34,9 +34,9 @@
 
 #include "support/convert.h"
 #include "support/debug.h"
+#include "support/docstream.h"
 #include "support/gettext.h"
 #include "support/lstrings.h"
-#include "support/docstream.h"
 
 #include "frontends/Application.h"
 
@@ -129,8 +129,15 @@ InsetFloat::~InsetFloat()
 
 docstring InsetFloat::toolTip(BufferView const & bv, int x, int y) const
 {
+       if (InsetCollapsable::toolTip(bv, x, y).empty())
+               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 default_tip = InsetCollapsable::toolTip(bv, x, y);
        docstring caption_tip = getCaptionText(rp);
        if (!isOpen() && !caption_tip.empty())
                return caption_tip + '\n' + default_tip;
@@ -173,7 +180,7 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
 
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
-               flag.enabled(true);
+               flag.setEnabled(true);
                return true;
 
        default:
@@ -184,11 +191,12 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 void InsetFloat::updateLabels(ParIterator const & it)
 {
-       Counters & cnts = buffer().params().documentClass().counters();
+       Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
        string const saveflt = cnts.current_float();
        bool const savesubflt = cnts.isSubfloat();
 
-       bool const subflt = it.innerInsetOfType(FLOAT_CODE);
+       bool const subflt = (it.innerInsetOfType(FLOAT_CODE)
+                            || it.innerInsetOfType(WRAP_CODE));
        // floats can only embed subfloats of their own kind
        if (subflt)
                params_.type = saveflt;