On 06/25/2016 01:36 PM, Guillaume Munch wrote:
> Le 25/06/2016 17:00, Richard Heck a écrit :
>> On 06/25/2016 02:58 AM, Liviu Andronic wrote:
>>> On Sat, Jun 25, 2016 at 12:23 AM, Richard Heck <rgh...@lyx.org> wrote:
>>>> Attached please find a patch that implements a combo box for custom
>>>> insets, much like the layout box. This is a very simple version. More
>>>> complicated ones might also have an InsetLayout tag that governed
>>>> whether an inset would appear here. It would also be very easy to
>>>> adapt
>>>> this also to give us a combo for charstyles.
>>>>
>>> Looks good. Couple of comments:
>>> - since unlike styles we don't always have a "default" chunk, probably
>>> the first item in the list should be something like: <Insert Custom
>>> Inset>. This will also make the UI more intuitive.
>>> - using the knitr module, while I can insert Chunks without trouble,
>>> for S/R expression and Sweave Opts I get "undefined" inset
>>
>> I've fixed both these issues with the attached.
>>
>
> Hi Richard, thank you for the patch.
>
> I have:
>   warning: 4 space error ignored
>   warning: 9 lines have caused space errors
>
>
> Like Jean-Marc I think a button with an icon would be better suited
> (even though I mentioned a combo box myself at some point without
> thinking enough). This may however require some work as the current
> implementation of LayoutBox you rely on relies on a hack instead of
> defining a model for the contents of the combo box. Re-using LayoutBox
> is nice since it will make it easier to sort by categories of custom
> insets in the future.

It probably wouldn't be that hard for someone who knows what they're
doing with Qt to reimplement this as an icon with a menu. As I said,
though, I wouldn't know where to start.

For now, the branch is here:
http://git.lyx.org/?p=developers/rgheck/lyx.git;a=shortlog;h=refs/heads/features/CustomInsets

> The problem mentioned by Liviu is solved, e.g. some insets became
> "undefined" with the previous patch, e.g. Beamer notes,  but now it
> works.

The problem was that there are spaces in those inset names, so they have
to be quoted when passed as arguments to dispatch.

I removed the delete.

Richard

Reply via email to