]> git.lyx.org Git - features.git/commitdiff
Use LOCK symbol with Minimalistic decoration, too.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 6 Dec 2020 02:25:05 +0000 (21:25 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sun, 6 Dec 2020 02:25:05 +0000 (21:25 -0500)
In that case, we force a button with just the lock.

src/insets/InsetCollapsible.cpp
src/insets/InsetERT.cpp
src/insets/InsetListings.cpp

index 3b739d28c8985d2f72a890f0a967dc4cc38f1715..1e5473dc11d9677ce2bee0023d32974d0fa9c92b 100644 (file)
@@ -100,8 +100,11 @@ InsetCollapsible::Geometry InsetCollapsible::geometry(BufferView const & bv) con
                        return view_[&bv].openinlined_ ? LeftButton : TopButton;
                return ButtonOnly;
 
-       case InsetLayout::MINIMALISTIC:
-               return status(bv) == Open ? NoButton : ButtonOnly ;
+       case InsetLayout::MINIMALISTIC: {
+               return status(bv) == Open ?
+                       (tempfile_ ? LeftButton : NoButton)
+                       : ButtonOnly;
+       }
 
        case InsetLayout::CONGLOMERATE:
                return status(bv) == Open ? SubLabel : Corners ;
@@ -677,12 +680,14 @@ docstring InsetCollapsible::getLabel() const
 
 docstring const InsetCollapsible::buttonLabel(BufferView const & bv) const
 {
+       // U+1F512 LOCK
+       docstring const locked = tempfile_ ? docstring(1, 0x1F512) : docstring();
+       if (decoration() == InsetLayout::MINIMALISTIC)
+               return locked;
        // indicate changed content in label (#8645)
        // ✎ U+270E LOWER RIGHT PENCIL
        docstring const indicator = (isChanged() && geometry(bv) == ButtonOnly)
                ? docstring(1, 0x270E) : docstring();
-       // U+1F512 LOCK
-       docstring const locked = tempfile_ ? docstring(1, 0x1F512) : docstring();
        InsetLayout const & il = getLayout();
        docstring const label = getLabel();
        if (!il.contentaslabel() || geometry(bv) != ButtonOnly)
index d7a1a11832de1e6aa57b1e0f49227371444b32d5..d7e6f8a9b3e18e67aed8dccfaa12efbe0de0c378 100644 (file)
@@ -168,7 +168,10 @@ bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 docstring const InsetERT::buttonLabel(BufferView const & bv) const
 {
+       // U+1F512 LOCK
        docstring const locked = tempfile_ ? docstring(1, 0x1F512) : docstring();
+       if (decoration() == InsetLayout::MINIMALISTIC)
+               return locked;
        if (decoration() == InsetLayout::CLASSIC)
                return locked + (isOpen(bv) ? _("ERT") : getNewLabel(_("ERT")));
        return locked + getNewLabel(_("ERT"));
index e930ca80d4735d72ecd57b9e6baab2130ae06621..96b035ed12c6d578dd9e97b341e5aa769580cc38 100644 (file)
@@ -607,6 +607,8 @@ docstring const InsetListings::buttonLabel(BufferView const & bv) const
 {
        // FIXME UNICODE
        docstring const locked = tempfile_ ? docstring(1, 0x1F512) : docstring();
+       if (decoration() == InsetLayout::MINIMALISTIC)
+               return locked;
        if (decoration() == InsetLayout::CLASSIC)
                return locked + (isOpen(bv) ? _("Listing") : getNewLabel(_("Listing")));
        return locked + getNewLabel(_("Listing"));