]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.cpp
Circumvent odd stmary font metrics (part of #9990).
[lyx.git] / src / insets / InsetBranch.cpp
index 5a278f94c389b938cf339c1b693bdbd6f0b455ad..7d2d4d51cb36adb9529326219c0d75bbad96c9c4 100644 (file)
@@ -84,6 +84,8 @@ docstring InsetBranch::toolTip(BufferView const & bv, int, int) const
 
 docstring const InsetBranch::buttonLabel(BufferView const & bv) const
 {
+       static char_type const tick = 0x2714; // ✔ U+2714 HEAVY CHECK MARK
+       static char_type const cross = 0x2716; // ✖ U+2716 HEAVY MULTIPLICATION X
        docstring s = _("Branch: ") + params_.branch;
        Buffer const & realbuffer = *buffer().masterBuffer();
        BranchList const & branchlist = realbuffer.params().branchlist();
@@ -103,9 +105,9 @@ docstring const InsetBranch::buttonLabel(BufferView const & bv) const
        }
        bool const master_selected = isBranchSelected();
        bool const child_selected = isBranchSelected(true);
-       docstring symb = docstring(1, char_type(master_selected ? 0x2714 : 0x2716));
+       docstring symb = docstring(1, master_selected ? tick : cross);
        if (inchild && master_selected != child_selected)
-               symb += char_type(child_selected ? 0x2714 : 0x2716);
+               symb += child_selected ? tick : cross;
        if (decoration() == InsetLayout::CLASSIC)
                return symb + (isOpen(bv) ? s : getNewLabel(s));
        else
@@ -354,11 +356,15 @@ void InsetBranch::addToToc(DocIterator const & cpit, bool output_active,
 {
        DocIterator pit = cpit;
        pit.push_back(CursorSlice(const_cast<InsetBranch &>(*this)));
-
+       
+       docstring tooltip;
+       text().forOutliner(tooltip, TOC_ENTRY_LENGTH);
+       docstring str = params_.branch + ": " + tooltip;
+       tooltip = support::wrapParas(tooltip, 0, 60, 2);
+       
        shared_ptr<Toc> toc = buffer().tocBackend().toc("branch");
-       docstring str = params_.branch + ": ";
-       text().forOutliner(str, TOC_ENTRY_LENGTH);
-       toc->push_back(TocItem(pit, 0, str, output_active, toolTipText(docstring(), 3, 60)));
+       toc->push_back(TocItem(pit, 0, str, output_active, tooltip));
+       
        // Proceed with the rest of the inset.
        bool const doing_output = output_active && isBranchSelected();
        InsetCollapsable::addToToc(cpit, doing_output, utype);