Use LOCK symbol with Minimalistic decoration, too.

In that case, we force a button with just the lock.
This commit is contained in:
Richard Kimberly Heck 2020-12-05 21:25:05 -05:00
parent aa39a2aaf7
commit 16834a32ad
3 changed files with 14 additions and 4 deletions

View 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)

View 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"));

View 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"));