On Wed, 15 Oct 2003, Jean-Marc Lasgouttes wrote: > So the question is: ``do we really want to do that?''. What I mean is > that nobody has complained yet that we lack an option to set alignment > to default. I should have complain, sorry ;-)
> What we do (or should be doing) currently is to consider > that, if the par alignment is the same as the layout one, then it is > ALIGN_LAYOUT. So in some sense, we could just get rid of the > LYX_ALIGN_LAYOUT value, which should be possible with a few tweaks. > What you propose is the opposite, that is to expose this ALIGN_LAYOUT > property to the world. At the user level, my slant is somewhat different. I can change the layout of a whole block (even by mistake), then change my mind and go back to the original. With your approach, this will imply to set back each "specifically aligned " paragraph that by chance were temporary assimilated to the layout. So I need a way -to make a persitent distinction between "I really want this paragraph like this" and "ok, follows the layout". - as a corrolary, one must be able to reset a paragraph to the "ordinary" behavior, thus the UI changes. > BTW, do your GUI changes give the user a hint > of what the default is? (sorry I cannot test the patch right now) Of course. in xforms, it was already there (with may be a bug for the "Right" label), and I reflect it again by setting the appropriate radio button. In qt, I dynamically modify the "default" label. > > So what would go wrong with your future plans if we decided to get rid > of LYX_ALIGN_LAYOUT? Admittedly, we would have to change > alignDefault() so that it tests whether the par alignment is the same > as the layout alignment, but what else? It may complexify the handling of tabular column alignments, as there will be some confusion between setups in tabular menus and paragraph ones (which are available for cells in fixed width columns). Here "default" takes its sense ;-) However, I've to think twice about this. Remember that I made all these changes at once on 1.3.0, and that the actual splitting is just a way to make the discussion easier. I just tried to follow the existing mechanisms as far as possible, without changing too much the developper's habits. I don't feel confortable with the actual behavior(I mean in 1.3.x, I didn't check for 1.4.0) where opening and closing the paragraph menu without performing any action results in a change of the data. Now, as long as I can detect which paragraph follows the default and which one is different, there may be other (better) solutions. The UI changes may be treated separately, though I pretend my approach is less "word processor" oriented than the present one. > > I am worried that adding this new 'default align' button will just > confuse the user and bring flexibility which is not realy needed. The qt patch is perharps better to this respect than the xforms one, as "default" is just one option of the choice instead of a separate button. May be an xforms-fluent developper can change that. > Alain> What is missing too is the handling of the latex output when > Alain> you want a justified paragraph when the default is something > Alain> else (parbox?), but this can be postponed > This is not always easy, since a parbox means that you must give a > width. that's why I didn't propose something already ;-) > As far as tabular align is concerned, I think that what we should do > is have a special Style entry in layout files for tabular cells (or > LR mode text in general). This style entry would look like > > TableStyle > Margin Static > LatexType Paragraph > LatexName dummy > ParIndent MM > ParSkip 0.4 > Align Left > AlignPossible Block, Left, Right, Center > LabelType No_Label > End > This style would not be added to the list of styles, but could be > return by some LyXTextClass::tableLayout() method. Then the code in > tabulars should use this method instead of defaultLayout() to set the > (fake) layout of the paragraph in the cell. > > Having this special pseudo-layouts for tabulars would also help fix > one of Jose's pet peeves about tabulars in docbook (and also one or > two bugs in bugzilla). > > Does what I write make sense? The problem is that there is much more in a layout than just alignment stuff, and you may need one for each column of each tabular ! So you have to create a layout instance for each combination you encounter (and at first I imagined to create it dynamicaly, without requiring a Style entry) and manage it when moving the tabular across environments. This looked like a nightmare, thus my approach : <<let the "default" be given by something else than the layout>> (which is the purpose of the patch #2). But, for this, I need a persistent meaning for "default". Thank's a lot for your help. I'll we wait a little bit more about comments before going further, as it seems clearly that my approach is not so "innocent" that I imagined ;-). Alain