[LyX/master] Use more convenient MenuButtonPopup

Scott Kostyshak skostysh at lyx.org
Sat Aug 1 14:04:04 UTC 2020


On Wed, Jul 29, 2020 at 03:21:56PM +0200, Daniel wrote:
> On 2020-07-29 12:51, Jürgen Spitzmüller wrote:
> > Am Samstag, den 18.07.2020, 00:33 -0400 schrieb Scott Kostyshak:
> > > This is a nice feature (added at 9495ff66 and modified here), and I
> > > agree that MenuButtonPopup is better. There is one thing that is a
> > > little annoying, which is that the arrow is not disabled if there is
> > > no
> > > item. We shouldn't disable the entire button because the action of
> > > the
> > > button is to paste from the *system* clipboard.
> > > 
> > > To reproduce what I'm talking about, start LyX, start a new document
> > > and
> > > click on the arrow next to the paste icon. The arrow lets you press
> > > it
> > > and looks like it will give something but never does. I actually
> > > expected something like the Edit > Paste Special submenu options to
> > > show, so I was confused.
> > > 
> > > The attached patch attempts to improve things. It only shows an arrow
> > > if
> > > there are items. It's not as nice as having a disabled arrow, but I
> > > don't know how to achieve that. Another disadvantage of the patch is
> > > that when it shows the arrow it takes up extra space on the toolbar
> > > so
> > > shifts the items to the right, which is unpleasant to the eye. There
> > > might be some style sheet padding magic that can be done to avoid the
> > > shift but I couldn't figure it out.
> > > 
> > > Any thoughts?
> > 
> > Actually I don't like any overpainting of style defaults. I prefer
> > having the arrow even though the history is empty.
> > 
> > Jürgen
> > 
> > > 
> > > Scott
> > > 
> 
> I didn't see the new button before because I had deactivated the paste
> toolbar button. It is supposed to show the LyX-internal copy history, right?

Yes.

> As for the arrow: I find it a bit strange too that it is not disabled when
> there is no menu. But maybe that's just a Qt thing.

I wonder if it's because in most cases when there is no menu the button
should be disabled also.

> A way to deal with this
> particular case other than hiding the arrow is to add the (static) Special
> Paste menu entries to the button menu as well. This is actually pretty
> common and hence to be expected in word processors.

That is an interesting idea. I would not want to add those entries just
for this case (i.e., just so that the menu is not empty), but if other
processors do it then we should consider it. I just checked and
LibreOffice behaves as you suggest.

So I guess the question is which of the following is best:

1. Only internal clipboard items (what we currently have).
2. Only paste special options (what Libre Office does)
3. Both, with a separator.

I'm not sure which I think is best. I think the internal clipboard items
might be more interesting if we rendered the math display, but as it
currently is I personally do not find them useful. But I think that's
because I have a system clipboard that I use (CopyQ) so I don't know if
my case is typical.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200801/1c6b2c6b/attachment.asc>


More information about the lyx-devel mailing list