On 2020-08-01 08:20, Richard Kimberly Heck wrote:
On 7/26/20 1:54 PM, Daniel wrote:
On 2020-07-24 18:13, Daniel wrote:
On 2020-04-14 09:47, Daniel wrote:
On 2020-04-14 09:29, Daniel wrote:
On 2020-04-14 09:23, Daniel wrote:
If I read correctly, then drop-down list items can be styled in
Qt. I think it would look awesome and, more importantly, enhance
finding items if the layout list would provide some of the WYSIWYM
styles from the work area. I'd suggest font attributes and labeling.

Attached is a mock-up of what this might look like.

Daniel


There was some grayish background color. A nicer version is attached.

Daniel

Some more thoughts on the content of the items in the list:

I guess the easiest way would be to always show

      label + layout-name

However, in some cases this leads to non-ideal results. For example,
this would result in

      Theorem 1. Theorem

That's long and confusing. So, instead there needs to be an
attribute, call it "LayoutListLabel", that allows the formatting if
the layout list item should have a different content. I guess it
would be enough to have a reference to the whole label (such as
Riki's ## for PrettyFormat but more customization, which might also
come to PrettyFormat soon, might be better). So, for the theorem
environments it would be:

      LayoutListLabel        "##"

Due to popular demand ;), and for the fun of it, I have made some
steps towards implementation. Attached is the visual result of these
first steps. I think looks nice and helps to more quickly find what
one is looking for. I'd be curious what you think?

Next step would be to try to figure out how to get the string with
counter and bullets. This would also make the stars (*) on the layout
names redundant.

Daniel



A first attempt is the attached patch.

Minor stuff: LyX style is: * ptr, not *ptr. Also x * y, not x*y.


However, there are a couple of (possible) issues:

1. I get an ASSERTION:

support/lassert.cpp (51): ASSERTION false VIOLATED IN
/Users/Shared/LyX/lyx/src/frontends/qt/GuiFontLoader.cpp:132
frontends/qt/GuiFontLoader.cpp (133): Unrealized font!

I guess I am not getting the QFont from the lyx::FontInfo correctly.
But I am not sure what the correct function is. It seems otherwise to
work as expected.

2. I am not sure the way I get the size of an unchanged row from the
dropdownlist in an efficient way.

Where is this?

Here:

// get default font pointsize and metric
...
QFontMetrics fm(guititem->font());

I am trying to get my hand on the default height of the dropdown list rows to set a minimum height on the rows when the font size is, e.g. "Tiny". There is probably a better way to do this. But I also noticed that setting the row height as I did leads to the width becoming fixed as well which in turn cuts off very long layout names with enlarged fonts. I guess I will have to learn a little qt stylesheeting for this. For now, I suggest a patch that just does not care about the rows becoming tiny.


Patch fixing first two issues posted to bug. I'm happy to commit this,
but I'd like a bit more input from the other devs and users about it.
(There's also the itemize, enumerate, etc, question, though that could
be handled later.)

Riki




--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to