From: Richard Kimberly Heck Date: Sun, 6 Dec 2020 02:25:05 +0000 (-0500) Subject: Use LOCK symbol with Minimalistic decoration, too. X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=16834a32ad1a01666f50c53f1f1d26d2a1dde67d;p=features.git Use LOCK symbol with Minimalistic decoration, too. In that case, we force a button with just the lock. --- diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp index 3b739d28c8..1e5473dc11 100644 --- a/src/insets/InsetCollapsible.cpp +++ b/src/insets/InsetCollapsible.cpp @@ -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) diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp index d7a1a11832..d7e6f8a9b3 100644 --- a/src/insets/InsetERT.cpp +++ b/src/insets/InsetERT.cpp @@ -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")); diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index e930ca80d4..96b035ed12 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -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"));