RE: No paragraph alignment options

2007-06-25 Thread Leuven, E.
Helge Hafting wrote:
>> could you give a meaningful example with specific layouts between 
>> which you would be switching (out of curiosity) which would give rise 
>> to the above?
> I can't remember a layout with default centering,

f.e. title in the article layout

> but I believe the headings are left-justified.
> 
> So, set some "standard" paragraph to explicit left-justified.
> Turn it into a heading, then  turn it back to "standard" again.
> Information lost, if we don't have an explicit "default".

sure, i was pretty clear about this. note though that your example will hardly 
ever happen (except as a mistake). 

moreover, information loss on layout switch is frequently unavoidable. what 
will happen for example in the current implementation if you center the 
standard paragraph, switch to a heading (which doesn't allow center) and switch 
back again? we will loose information...

so to summarize i am don't think that this "proves" that we need an extra 
default button

btw, did you try you example with the current "solution"? you will see that you 
loose the same information (a problem there?)!

...

> Now, feel free to add an indicator saying what the current default
> alignment is, i.e.:
> 
> o default (justified)
> o justified
> o right
> o center
> o left
> 
> But don't add the indicator unless you make sure it is
> correct in all cases (except ERT abuse).
> 
> You must cope with changing paragraph layouts, changing document
> types, documents included into other documents,
> paragraphs nested into other paragraphs that possibly have different
> alignments set, document branches being turned on/off, and so on.
> 
> Seeing as we are near a release, I think just keeping "default"
> is the easy way to go here.

you can find example code in the patch i send...




Re: No paragraph alignment options

2007-06-25 Thread Helge Hafting

Edwin Leuven wrote:

Alfredo Braunstein wrote:

Edwin Leuven wrote:


case 2 is in my opinion not so relevant because i don't see why (in the
current solution) one would have default unchecked and then choose the
explicit alignment that matches default behavior


One such cases: I'm in Standard Layout and I want my par centered so 
I set

it explicitly. Then I change layout to one with centered default [then
realize it's not what I though] and change back. I've lost my explicit
centering.


this is not case 2, but case 1:

 x is set and we change the default to x

...

could you give a meaningful example with specific layouts between 
which you would be switching (out of curiosity) which would give rise 
to the above?

I can't remember a layout with default centering, but I believe the headings
are left-justified.

So, set some "standard" paragraph to explicit left-justified.
Turn it into a heading, then  turn it back to "standard" again.
Information lost, if we don't have an explicit "default".

Something similiar happens with paragraphs of increased depth - they
may inherit all sorts of settings from the outer paragraph.


So please let us have "default" in addition to explicit alignments.

Now, feel free to add an indicator saying what the current default
alignment is, i.e.:

o default (justified)
o justified
o right
o center
o left

But don't add the indicator unless you make sure it is
correct in all cases (except ERT abuse).

You must cope with changing paragraph layouts, changing document
types, documents included into other documents,
paragraphs nested into other paragraphs that possibly have different
alignments set, document branches being turned on/off, and so on.

Seeing as we are near a release, I think just keeping "default"
is the easy way to go here.

Helge Hafting




Re: No paragraph alignment options

2007-06-23 Thread Abdelrazak Younes

Richard Heck wrote:

Alfredo Braunstein wrote:
What happends if the user moves the cursor when the dialog is open, 
does it

get updated?
  
The dialog is presently modal, precisely because there's no reliable 
trigger right now to do the update. Making this work involves re-working 
the controller fairly extensively, or at least that was the conclusion 
Abdel and I reached when I was redoing this dialog a while ago.


Yes and FYI I have started the rewrite a while ago.

Abdel.



Re: No paragraph alignment options

2007-06-22 Thread Richard Heck

Alfredo Braunstein wrote:

Leuven, E. wrote:
  

Alfredo Braunstein wrote:
since default takes precedence things go fine in your example.

I see. 


WRT the current situation, your approach tends to make things default (on
layout switching) against user will, which is sort of lyx philosophy: don't
care what you want, no manual formatting allowed here! 
  
My own view is more with Alfredo and, I think, J"urgen. Users do switch 
layouts, and there is a difference between saying, "Use the default 
alignment, whatever that might be" and "Center this, come what may". If 
you collapse Default with whatever the default happens to be, it becomes 
impossible to say that. This was Helge's point a while ago, and Joost 
has made it, too.

At the end, maybe it's not so terrible. Question: what do you do if the
selection consists in paragraphs with different layouts (with different
defaults)
  
I take it the point of this question is: What counts as "default" in 
this case? There's no good answer if we're trying to collapse default 
with what the default is. Note, however, that it would make perfectly 
good sense to select a bunch of paragraphs you'd customized and then to 
choose "Default", precisely so as to restore them all to default. You 
could even select the whole document and do this to undo all 
paragraph-level alignment customization. Note that this also means the 
"Default (Justified)" strategy won't work, since there's no such thing 
in multi-paragraph selections. It also means that the font-switching 
strategy I'd implemented doesn't work. Default is just default. A 
tooltip will help a bit, perhaps.


That said, the issue is moot at present, because LyX itself (wrongly, in 
my view) collapses the default with what the default is. If the default 
is, in fact, Justified, and you choose Justified, then you get Default. 
That is, you get LYX_ALIGN_LAYOUT not LYX_ALIGN_BLOCK. This is in 
Text2.cpp, and fixing it would require more work than we want to do now, 
I suspect. A change may be needed in the LaTeX output routines (i.e., 
don't output alignment info if it's the default), and there are some 
other issues with how alignments are reported, via 
ParagraphParameters::align(), not to mention some general issues with 
mixing alignments and certain kinds of environments (bug 3434). A lot of 
this could be done right after 1.5.0, I think---though perhaps not 3434. 
It's not huge, just not now.


I'll send an updated patch shortly.

Richard

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: No paragraph alignment options

2007-06-22 Thread Richard Heck

Alfredo Braunstein wrote:

What happends if the user moves the cursor when the dialog is open, does it
get updated?
  
The dialog is presently modal, precisely because there's no reliable 
trigger right now to do the update. Making this work involves re-working 
the controller fairly extensively, or at least that was the conclusion 
Abdel and I reached when I was redoing this dialog a while ago.


Richard

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



RE: RE: RE: RE: Re: No paragraph alignment options

2007-06-22 Thread Leuven, E.
> I obviously did. Sorry. I'm still not entirely convinced.

i was thinking like the attached...
Index: src/frontends/qt4/QParagraph.cpp
===
--- src/frontends/qt4/QParagraph.cpp	(revision 18850)
+++ src/frontends/qt4/QParagraph.cpp	(working copy)
@@ -50,7 +50,6 @@
 	connect(applyPB, SIGNAL(clicked()), form_, SLOT(slotApply()));
 	connect(closePB, SIGNAL(clicked()), form_, SLOT(slotClose()));
 	connect(restorePB, SIGNAL(clicked()), form_, SLOT(slotRestore()));
-	connect(alignDefaultCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 	connect(alignJustRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 	connect(alignLeftRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 	connect(alignRightRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
@@ -77,9 +76,9 @@
 		" items is used."
 	));
 
-	radioMap[LYX_ALIGN_BLOCK] = alignJustRB;
-	radioMap[LYX_ALIGN_LEFT] = alignLeftRB;
-	radioMap[LYX_ALIGN_RIGHT] = alignRightRB;
+	radioMap[LYX_ALIGN_BLOCK]  = alignJustRB;
+	radioMap[LYX_ALIGN_LEFT]   = alignLeftRB;
+	radioMap[LYX_ALIGN_RIGHT]  = alignRightRB;
 	radioMap[LYX_ALIGN_CENTER] = alignCenterRB;
 }
 
@@ -105,35 +104,44 @@
 
 
 void QParagraphDialog::checkAlignmentRadioButtons() {
-	if (alignDefaultCB->isChecked()) {
-		QPRadioMap::const_iterator it = radioMap.begin();
-		for (; it != radioMap.end(); ++it)
-			it->second->setDisabled(true);
-	} else {
-		LyXAlignment alignPossible = form_->controller().alignPossible();
-		QPRadioMap::const_iterator it = radioMap.begin();
-		for (; it != radioMap.end(); ++it)
-			it->second->setEnabled(it->first & alignPossible);
+	LyXAlignment const alignPossible = form_->controller().alignPossible();
+	LyXAlignment const defaultAlignment = form_->controller().alignDefault();
+	QPRadioMap::iterator it = radioMap.begin();
+	for (; it != radioMap.end(); ++it) {
+		it->second->setEnabled((it->first & alignPossible) ||
+		   (it->first == LYX_ALIGN_LAYOUT));
+		string label;
+		switch (it->first) {
+			case LYX_ALIGN_BLOCK:
+label = "Justified";
+break;
+			case LYX_ALIGN_LEFT:
+label = "Left";
+break;
+			case LYX_ALIGN_CENTER:
+label = "Center";
+break;
+			case LYX_ALIGN_RIGHT:
+label = "Right";
+break;
+		}
+		
+		if (it->first == defaultAlignment)
+			label += " (Default)";
+	
+		it->second->setText(qt_(label));
 	}
 }
 
 
-void QParagraphDialog::on_alignDefaultCB_toggled(bool)
-{
-	checkAlignmentRadioButtons();
-	alignmentToRadioButtons();
-}
-
-
 void QParagraphDialog::alignmentToRadioButtons(LyXAlignment align)
 {
-	if (align == LYX_ALIGN_LAYOUT)
-		align = form_->controller().alignDefault();
-
 	QPRadioMap::const_iterator it = radioMap.begin();
 	for (;it != radioMap.end(); ++it) {
 		if (align == it->first) {
+			it->second->blockSignals(true);
 			it->second->setChecked(true);
+			it->second->blockSignals(false);
 			return;
 		}
 	}
@@ -145,18 +153,18 @@
 
 LyXAlignment QParagraphDialog::getAlignmentFromDialog()
 {
-	if (alignDefaultCB->isChecked())
-		return LYX_ALIGN_LAYOUT;
+	LyXAlignment const defaultAlignment = form_->controller().alignDefault();
 	LyXAlignment alignment = LYX_ALIGN_NONE;
 	QPRadioMap::const_iterator it = radioMap.begin();
 	for (; it != radioMap.end(); ++it) {
 		if (it->second->isChecked()) {
-			alignment = it->first;
+			if (it->first == defaultAlignment)
+alignment = LYX_ALIGN_LAYOUT;
+			else
+alignment = it->first;
 			break;
 		}
 	}
-	if (alignment == form_->controller().alignDefault())
-		return LYX_ALIGN_LAYOUT;
 	return alignment;
 }
 
@@ -243,15 +251,8 @@
 	}
 
 	// alignment
-	LyXAlignment newAlignment = params.align();
-	LyXAlignment defaultAlignment = controller().alignDefault();
-	bool alignmentIsDefault =
-		newAlignment == LYX_ALIGN_LAYOUT || newAlignment == defaultAlignment;
-	dialog_->alignDefaultCB->blockSignals(true);
-	dialog_->alignDefaultCB->setChecked(alignmentIsDefault);
-	dialog_->alignDefaultCB->blockSignals(false);
 	dialog_->checkAlignmentRadioButtons();
-	dialog_->alignmentToRadioButtons(newAlignment);
+	dialog_->alignmentToRadioButtons(params.align());
 
 	//indentation
 	bool const canindent = controller().canIndent();
Index: src/frontends/qt4/QParagraph.h
===
--- src/frontends/qt4/QParagraph.h	(revision 18850)
+++ src/frontends/qt4/QParagraph.h	(working copy)
@@ -49,8 +49,6 @@
 	void change_adaptor();
 	///
 	void enableLinespacingValue(int);
-	///
-	void on_alignDefaultCB_toggled(bool);
 };
 
 
Index: src/frontends/qt4/ui/ParagraphUi.ui
===
--- src/frontends/qt4/ui/ParagraphUi.ui	(revision 18850)
+++ src/frontends/qt4/ui/ParagraphUi.ui	(working copy)
@@ -8,8 +8,8 @@

 0
 0
-373
-203
+346
+226

   
   
@@ -36,76 +36,14 @@

 6

-   
-
- 
-  0
+   
+
+ 
+  Indent &Paragraph
  
- 
-  

RE: RE: Re: No paragraph alignment options

2007-06-22 Thread Alfredo Braunstein
Leuven, E. wrote:

> Alfredo Braunstein wrote:
>> Let me give you another case: I often write my titles first in Standard
>> Layout and *then* switch the layout to Title. With your approach I would
>> have to manually center it. Awful.
> 
> no.
> 
> reread what i wrote:

That implies I've read it in the first place...

> since default takes precedence things go fine in your example.

I see. 

WRT the current situation, your approach tends to make things default (on
layout switching) against user will, which is sort of lyx philosophy: don't
care what you want, no manual formatting allowed here! 

...

At the end, maybe it's not so terrible. Question: what do you do if the
selection consists in paragraphs with different layouts (with different
defaults)

>> In any case I prefer your other proposal with Default (Justified) and all
>> the rest.
> 
> i can live with that
> 
>> So I vote that or no change ;-)

Still prefer this I think.

> i should remind you that it is friday

I've written that smile yesterday. I keep one or two around for precaution.

A/




RE: RE: RE: Re: No paragraph alignment options

2007-06-22 Thread Juergen Spitzmueller
Leuven, E. wrote:

> you are misunderstanding me. the inset/layout should tell us what the
> default is (and i think it does at the moment). so sometimes this will be
> justified, in other cases center, etc.

I obviously did. Sorry. I'm still not entirely convinced.

Jürgen



RE: RE: RE: Re: No paragraph alignment options

2007-06-22 Thread Leuven, E.
Juergen Spitzmueller wrote:
> Where do you get your stats from?

from a very reliable source

> I just think it's wrong to assume that justified is the de facto "standard"
> alignment.

? 

you are misunderstanding me. the inset/layout should tell us what the default 
is (and i think it does at the moment). so sometimes this will be justified, in 
other cases center, etc.

> I often redefine the alignment of several paragraph styles in the preamble
> (or of certain classes) due to the guidelines of the publishers. The
> approach you are proposing results in dataloss/wrong output,

i don't think so





RE: RE: Re: No paragraph alignment options

2007-06-22 Thread Leuven, E.
Alfredo Braunstein wrote:
> Let me give you another case: I often write my titles first in Standard
> Layout and *then* switch the layout to Title. With your approach I would
> have to manually center it. Awful.

no.

reread what i wrote:

"i would be fine with having the default take precedence in both cases and have 
this in the interface:

o Justified (default)
o Left
o Center
o Right "

...

since default takes precedence things go fine in your example.

>> i really don't see the point of cluttering the user interface for these
>> very small contingencies.
> 
> Clutter is a big word...

CLUTTER is even bigger

> What happends if the user moves the cursor when the dialog is open, does it
> get updated?

it should be (until we get rid of these modeless dialogs)

> In any case I prefer your other proposal with Default (Justified) and all
> the rest.

i can live with that

> So I vote that or no change ;-)

i should remind you that it is friday



RE: RE: Re: No paragraph alignment options

2007-06-22 Thread Juergen Spitzmueller
Leuven, E. wrote:

>> No, they're not.
> 
> where do you get your stats from?

Where do you get your stats from?

I just think it's wrong to assume that justified is the de facto "standard"
alignment. This might be true for standard paragraphs in most book and
article classes, for others it is not. 
I often redefine the alignment of several paragraph styles in the preamble
(or of certain classes) due to the guidelines of the publishers. The
approach you are proposing results in dataloss/wrong output, and this is a
no-opt IMHO.

Jürgen



RE: Re: No paragraph alignment options

2007-06-22 Thread Alfredo Braunstein
Leuven, E. wrote:

> so given that:
> 
> - people don't switch document classes often (i for example never do)
> - switching document layouts often involve information loss because they
> do not define similar environments - case 1 & 2 are rare

Let me give you another case: I often write my titles first in Standard
Layout and *then* switch the layout to Title. With your approach I would
have to manually center it. Awful.

> i really don't see the point of cluttering the user interface for these
> very small contingencies.

Clutter is a big word...

> i also think that
> 
> o Justified (Default)
> o Left
> o Center
> o Right
> 
> will be more understandable to users who don't know latex while at the
> same time it makes default explicit which is think was the starting point

Is not about latex imo, is about document layouts.

> imo of course...

What happends if the user moves the cursor when the dialog is open, does it
get updated?

In any case I prefer your other proposal with Default (Justified) and all
the rest. So I vote that or no change ;-)

A/





RE: RE: Re: No paragraph alignment options

2007-06-22 Thread Leuven, E.
>> - case 1 & 2 are rare
> 
> No, they're not.

where do you get your stats from?





RE: Re: No paragraph alignment options

2007-06-22 Thread Juergen Spitzmueller
Leuven, E. wrote:

> - case 1 & 2 are rare

No, they're not.

Jürgen



RE: Re: No paragraph alignment options

2007-06-22 Thread Leuven, E.
Alfredo Braunstein wrote:
> Specially with new document classes I normally don't know what the layouts
> really are so I switch back and forth several times...

i agree that the only situation where this might reasonably occur is when 
switching document classes.

so given that:

- people don't switch document classes often (i for example never do)
- switching document layouts often involve information loss because they do not 
define similar environments
- case 1 & 2 are rare

i really don't see the point of cluttering the user interface for these very 
small contingencies.

i also think that

o Justified (Default)
o Left
o Center
o Right

will be more understandable to users who don't know latex while at the same 
time it makes default explicit which is think was the starting point

imo of course...





Re: No paragraph alignment options

2007-06-21 Thread Alfredo Braunstein
Edwin Leuven wrote:

> Alfredo Braunstein wrote:
>> Edwin Leuven wrote:
>> 
>>> case 2 is in my opinion not so relevant because i don't see why (in the
>>> current solution) one would have default unchecked and then choose the
>>> explicit alignment that matches default behavior
>> 
>> One such cases: I'm in Standard Layout and I want my par centered so I
>> set it explicitly. Then I change layout to one with centered default
>> [then realize it's not what I though] and change back. I've lost my
>> explicit centering.
> 
> this is not case 2, but case 1:
> 
>   x is set and we change the default to x

It's both ;-)

After changing the default to x, the situation is such that (with the
current code) the default is not checked but x == default. So changing back
falls in case 2.

> 
> ...
> 
> could you give a meaningful example with specific layouts between which
> you would be switching (out of curiosity) which would give rise to the
> above?

Specially with new document classes I normally don't know what the layouts
really are so I switch back and forth several times...

The point is that we will be changing an explicit user setting on the user's
back. I think it's wrong.

A/




Re: No paragraph alignment options

2007-06-21 Thread Edwin Leuven

Alfredo Braunstein wrote:

Edwin Leuven wrote:


case 2 is in my opinion not so relevant because i don't see why (in the
current solution) one would have default unchecked and then choose the
explicit alignment that matches default behavior


One such cases: I'm in Standard Layout and I want my par centered so I set
it explicitly. Then I change layout to one with centered default [then
realize it's not what I though] and change back. I've lost my explicit
centering.


this is not case 2, but case 1:

 x is set and we change the default to x

...

could you give a meaningful example with specific layouts between which 
you would be switching (out of curiosity) which would give rise to the 
above?




Re: No paragraph alignment options

2007-06-21 Thread Alfredo Braunstein
Edwin Leuven wrote:

> case 2 is in my opinion not so relevant because i don't see why (in the
> current solution) one would have default unchecked and then choose the
> explicit alignment that matches default behavior

One such cases: I'm in Standard Layout and I want my par centered so I set
it explicitly. Then I change layout to one with centered default [then
realize it's not what I though] and change back. I've lost my explicit
centering.

A/




Re: No paragraph alignment options

2007-06-21 Thread Edwin Leuven

Alfredo Braunstein wrote:

This is bad. What if the user changes layout (or worse document class) and
the new layout has different default alignment? You are losing information
here.


ah, i see the problem now.

there seem to be 2 problem cases:

1 x is set and we change the default to x:
2 x (default) is set and the default changes:

(x being one of justified/left/center/right)

case 2 is in my opinion not so relevant because i don't see why (in the 
current solution) one would have default unchecked and then choose the 
explicit alignment that matches default behavior


which leaves case 1 and the question if we would like to keep the 
explicit formatting here.


i would be fine with having the default take precedence in both cases 
and have this in the interface:


o Justified (default)
o Left
o Center
o Right

but i can understand that others might think otherwise...





Re: No paragraph alignment options

2007-06-21 Thread Anders Ekberg

On Jun 21, 2007, at 17:28 , Richard Heck wrote:

Anders Ekberg wrote:

On 21 jun 2007, at 13.12, Helge Hafting wrote:

Bennett Helm wrote:
It shouldn't be a radio button just like the others, since it's  
not an option in the way that the others are.

Sorry, but I consider that a bad argument. Sure, "default" is a bit
different. That does NOT imply it can't be a radio button like  
the rest.


To me, "default" means "whatever is default for this paragraph type"
while the other choices are explicit. (I.e. if you really want a
right-adjusted heading, and so on.)

The problem is not so much that the interface is hard to understand.
(It _is_, but people always learn such stuff after a while. Even  
non-latexers

keep a few useful latex commands around. . .)
It is also clunky to use, which is the big killer here.
If I want "centered", I want to click "centered" and be done with  
it!

I do not want to have to uncheck "default" first.
And I believe most other writers see it the same way.

Agree.
It is also consistent with the text settings where "Reset" (read  
Default) is an option like all others in the pop-up menus. In fact  
to use a pop-up menu with

No change
Justified
Left
Center
Right
Reset
would increase the consistency. Would this be a possibility?
I agree with Helge's analysis, too, and have prepared a patch which  
I'll send separately. I propose to stick with "default", though,  
again for Helge's reasons: It means "whatever the default is for  
this paragraph" and corresponds to LYX_ALIGN_LAYOUT. So it  
basically means "No special alignment". There's no need to "No  
change", so far as I can see. If you want that, you just don't do  
anything, since the button will always be set to whatever it was  
before.


Of course, "No change" is for the pop-up menu case where you need a  
possibility to select "nothing" (since you can't use Cancel if you  
wish to apply other changes in the dialogue).

/A

Re: No paragraph alignment options

2007-06-21 Thread Alfredo Braunstein
Bennett Helm wrote:

> On Jun 21, 2007, at 11:38 AM, Edwin Leuven wrote:
> 
>> and this one doesn't make sense:
>>
>> if we could tell beforehand what the default was because then we
>> could show something like:
>>
>> o Justified (default)
>> o Left
>> o Center
>> o Right
>>
>>
>> ?
>>
> 
> Of the options I've seen, I agree that this is the best.

This is bad. What if the user changes layout (or worse document class) and
the new layout has different default alignment? You are losing information
here.

A/




Re: No paragraph alignment options

2007-06-21 Thread Richard Heck

Bennett Helm wrote:

On Jun 21, 2007, at 11:38 AM, Edwin Leuven wrote:

and this one doesn't make sense:

if we could tell beforehand what the default was because then we 
could show something like:

o Justified (default)
o Left
o Center
o Right
?

Of the options I've seen, I agree that this is the best.
In principle, I think default ought to be separate: Saying "default" 
means "don't do anything special", whereas saying "Justified" ought to 
mean, "Make it justified, no matter what". (Imagine you have a child 
doc, and it might be included in different master docs with different 
defaults.) In fact, that's not how LyX handles things at present. If you 
check "Justified" and that happens to be the default, then it's the same 
as checking "Default". But this is a different bug, I think, viz:


void Text::setParagraph(Cursor & cur,
   Spacing const & spacing, LyXAlignment align,
   docstring const & labelwidthstring, bool noindent)
{
BOOST_ASSERT(cur.text());
// make sure that the depth behind the selection are restored, too
pit_type undopit = undoSpan(cur.selEnd().pit());
recUndo(cur, cur.selBegin().pit(), undopit - 1);

for (pit_type pit = cur.selBegin().pit(), end = cur.selEnd().pit();
 pit <= end; ++pit) {
Paragraph & par = pars_[pit];
ParagraphParameters & params = par.params();
params.spacing(spacing);

// does the layout allow the new alignment?
Layout_ptr const & layout = par.layout();

if (align == LYX_ALIGN_LAYOUT)
align = layout->align;
if (align & layout->alignpossible) {
/// NOTE: It's right here that the bug mentioned above lies. It would be trivial
/// to change this if people thought it necessary. Just delete the next three 
lines
/// and fix the whitespace.
if (align == layout->align)
params.align(LYX_ALIGN_LAYOUT);
else
params.align(align);
}
par.setLabelWidthString(labelwidthstring);
params.noindent(noindent);
}
}

Richard

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: No paragraph alignment options

2007-06-21 Thread Bennett Helm

On Jun 21, 2007, at 11:38 AM, Edwin Leuven wrote:


and this one doesn't make sense:

if we could tell beforehand what the default was because then we  
could show something like:


o Justified (default)
o Left
o Center
o Right


?



Of the options I've seen, I agree that this is the best.

Bennett



Re: No paragraph alignment options

2007-06-21 Thread Edwin Leuven

and this one doesn't make sense:

if we could tell beforehand what the default was because then we could 
show something like:


o Justified (default)
o Left
o Center
o Right


?



Re: No paragraph alignment options

2007-06-21 Thread Richard Heck

Anders Ekberg wrote:

On 21 jun 2007, at 13.12, Helge Hafting wrote:

Bennett Helm wrote:
It shouldn't be a radio button just like the others, since it's not 
an option in the way that the others are.

Sorry, but I consider that a bad argument. Sure, "default" is a bit
different. That does NOT imply it can't be a radio button like the rest.

To me, "default" means "whatever is default for this paragraph type"
while the other choices are explicit. (I.e. if you really want a
right-adjusted heading, and so on.)

The problem is not so much that the interface is hard to understand.
(It _is_, but people always learn such stuff after a while. Even 
non-latexers

keep a few useful latex commands around. . .)
It is also clunky to use, which is the big killer here.
If I want "centered", I want to click "centered" and be done with it!
I do not want to have to uncheck "default" first.
And I believe most other writers see it the same way.

Agree.
It is also consistent with the text settings where "Reset" (read 
Default) is an option like all others in the pop-up menus. In fact to 
use a pop-up menu with

No change
Justified
Left
Center
Right
Reset
would increase the consistency. Would this be a possibility?
I agree with Helge's analysis, too, and have prepared a patch which I'll 
send separately. I propose to stick with "default", though, again for 
Helge's reasons: It means "whatever the default is for this paragraph" 
and corresponds to LYX_ALIGN_LAYOUT. So it basically means "No special 
alignment". There's no need to "No change", so far as I can see. If you 
want that, you just don't do anything, since the button will always be 
set to whatever it was before.


Richard



/Anders



--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: No paragraph alignment options

2007-06-21 Thread Anders Ekberg

On 21 jun 2007, at 13.12, Helge Hafting wrote:

Bennett Helm wrote:
It shouldn't be a radio button just like the others, since it's  
not an option in the way that the others are.

Sorry, but I consider that a  bad argument. Sure, "default" is a bit
different.  That does NOT imply it can't be a radio button like the  
rest.


To me, "default" means "whatever is default for this paragraph type"
while the other choices are explicit. (I.e. if you really want a
right-adjusted heading, and so on.)

The problem is not so much that the interface is hard to understand.
(It _is_, but people always learn such stuff after a while. Even  
non-latexers

keep a few useful latex commands around. . .)
It is also clunky to use, which is the big killer here.
If I want "centered", I want to click "centered" and be done with it!
I do not want to have to uncheck "default" first.
And I believe most other writers see it the same way.


Agree.
It is also consistent with the text settings where "Reset" (read  
Default) is an option like all others in the pop-up menus. In fact to  
use a pop-up menu with

  No change
  Justified
  Left
  Center
  Right
  Reset
would increase the consistency. Would this be a possibility?

/Anders


Re: No paragraph alignment options

2007-06-21 Thread Helge Hafting

Bennett Helm wrote:
It shouldn't be a radio button just like the others, since it's not an 
option in the way that the others are. 

Sorry, but I consider that a  bad argument. Sure, "default" is a bit
different.  That does NOT imply it can't be a radio button like the rest.

To me, "default" means "whatever is default for this paragraph type"
while the other choices are explicit. (I.e. if you really want a
right-adjusted heading, and so on.)

The problem is not so much that the interface is hard to understand.
(It _is_, but people always learn such stuff after a while. Even 
non-latexers

keep a few useful latex commands around. . .)
It is also clunky to use, which is the big killer here.
If I want "centered", I want to click "centered" and be done with it!
I do not want to have to uncheck "default" first.
And I believe most other writers see it the same way.

"Conceptual" differences really isn't that interesting.  So please -
make "default" a radio button the same way as left/rigth/center.

If you feel a need to mark the conceptual difference - feel free
to set the "default" radio button a little apart from the other
radio buttons, as you suggested.  That is fine!  But it should
definitely _work_ like "just another radio button" in this case.
The user can then change alignment with a _single_
click or hotkey. It is easy to understand too. :-)

Some ideas. Separator line:

o Default
 -
o Justified
o Right
o Center
o Left

or indentation:

o Default
o Justified
o Right
o Center
o Left

The user can now see that "default" is a special state, but
still change it with a _single_ operation. Ease of use, and easily learned.

(Which alignment is the default varies depending on the environment, 
but the default will be one of left, right, centered, or justified.) 
It's for this reason that I haven't been able to think of anything 
better than how it is now, and once you see the logic of it, it does 
seem reasonable. The only trouble is that the logic isn't obvious.


So, to answer Richard: I don't have any good idea how to improve it. I 
wouldn't put in a line to separate them; that does the opposite of 
what you want: to indicate a link between them. Boldface doesn't seem 
the right sort of thing: what's wanted is a visual image that 
indicates that the default checkbox has a kind of priority or control 
over the status of the radio buttons. Perhaps, then, the radio buttons 
should be indented a bit underneath the checkbox?


X Default
  o Justified
  o Left
  o Center
  o Right

(Notice that I've switched the order of the radio buttons, putting 
center in the middle rather than at the end.) 

Center in the center - nice idea!

Helge Hafting


Re: No paragraph alignment options

2007-06-21 Thread Edwin Leuven

Bennett Helm wrote:

X Default
  o Justified
  o Left
  o Center
  o Right


maybe giving the choice between "default" or "environment default" and 
"custom" or "force" makes it more explicit?


o Default
o Custom
  o Justified
  o Left
  o Center
  o Right

it would of course be nicer if we could tell beforehand what the default 
was because then we could show something like:


o Justified (default)
o Left
o Center
o Right

and not take any action when the default button is checked

...


Re: No paragraph alignment options

2007-06-20 Thread Bennett Helm

On Jun 20, 2007, at 6:22 PM, Anders Ekberg wrote:


Richard Heck
Wed, 20 Jun 2007 14:30:21 -0700


Bennett Helm wrote:

On Jun 20, 2007, at 2:56 PM, Neal Becker wrote:

Bennett Helm wrote:

On Jun 20, 2007, at 1:54 PM, Neal Becker wrote:
1.50rc1. Under paragraph settings dialog, all alignment  
options always seem to be greyed out.

Did you uncheck the "Default" box?
Ah! Well, at least one reasonably intelligent somewhat  
experienced lyx user was confused about this interface.

Make that two: I was confused initially as well.
Any suggestions how to make it more intuitive? The change here was  
to include a "default" option, so that you can unset changes you'd  
made before. It wasn't previously clear how to do that---though  
the solution was, set the default, whatever that is. Is it  
possible that something as simple as a line separating "default"  
from the others would help? Or putting "DEFAULT" like that? or in  
bold? or...?

rh

Is there a reason the Default box is not a radio button as the  
other? It is different in behaviour (since not specified), but  
isn't the italic font a sufficient indicator for that? Or am I  
missing something?


It shouldn't be a radio button just like the others, since it's not  
an option in the way that the others are. (Which alignment is the  
default varies depending on the environment, but the default will be  
one of left, right, centered, or justified.) It's for this reason  
that I haven't been able to think of anything better than how it is  
now, and once you see the logic of it, it does seem reasonable. The  
only trouble is that the logic isn't obvious.


So, to answer Richard: I don't have any good idea how to improve it.  
I wouldn't put in a line to separate them; that does the opposite of  
what you want: to indicate a link between them. Boldface doesn't seem  
the right sort of thing: what's wanted is a visual image that  
indicates that the default checkbox has a kind of priority or control  
over the status of the radio buttons. Perhaps, then, the radio  
buttons should be indented a bit underneath the checkbox?


X Default
  o Justified
  o Left
  o Center
  o Right

(Notice that I've switched the order of the radio buttons, putting  
center in the middle rather than at the end.)


Bennett


Re: No paragraph alignment options

2007-06-20 Thread Anders Ekberg

Richard Heck
Wed, 20 Jun 2007 14:30:21 -0700


Bennett Helm wrote:

On Jun 20, 2007, at 2:56 PM, Neal Becker wrote:

Bennett Helm wrote:

On Jun 20, 2007, at 1:54 PM, Neal Becker wrote:
1.50rc1. Under paragraph settings dialog, all alignment options  
always seem to be greyed out.

Did you uncheck the "Default" box?
Ah! Well, at least one reasonably intelligent somewhat  
experienced lyx user was confused about this interface.

Make that two: I was confused initially as well.
Any suggestions how to make it more intuitive? The change here was  
to include a "default" option, so that you can unset changes you'd  
made before. It wasn't previously clear how to do that---though the  
solution was, set the default, whatever that is. Is it possible  
that something as simple as a line separating "default" from the  
others would help? Or putting "DEFAULT" like that? or in bold? or...?

rh

Is there a reason the Default box is not a radio button as the other?  
It is different in behaviour (since not specified), but isn't the  
italic font a sufficient indicator for that? Or am I missing something?


Anders Ekberg




Re: No paragraph alignment options

2007-06-20 Thread Richard Heck

Bennett Helm wrote:

On Jun 20, 2007, at 2:56 PM, Neal Becker wrote:

Bennett Helm wrote:

On Jun 20, 2007, at 1:54 PM, Neal Becker wrote:
1.50rc1. Under paragraph settings dialog, all alignment options 
always seem to be greyed out.

Did you uncheck the "Default" box?
Ah! Well, at least one reasonably intelligent somewhat experienced 
lyx user was confused about this interface.

Make that two: I was confused initially as well.
Any suggestions how to make it more intuitive? The change here was to 
include a "default" option, so that you can unset changes you'd made 
before. It wasn't previously clear how to do that---though the solution 
was, set the default, whatever that is. Is it possible that something as 
simple as a line separating "default" from the others would help? Or 
putting "DEFAULT" like that? or in bold? or...?


rh

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: No paragraph alignment options

2007-06-20 Thread Bennett Helm

On Jun 20, 2007, at 2:56 PM, Neal Becker wrote:


Bennett Helm wrote:


On Jun 20, 2007, at 1:54 PM, Neal Becker wrote:


1.50rc1.  Under paragraph settings dialog, all alignment options
always seem
to be greyed out.


Did you uncheck the "Default" box?



Ah!  Well, at least one reasonably intelligent somewhat experienced  
lyx user

was confused about this interface.


Make that two: I was confused initially as well.

Bennett


Re: No paragraph alignment options

2007-06-20 Thread Neal Becker
Bennett Helm wrote:

> On Jun 20, 2007, at 1:54 PM, Neal Becker wrote:
> 
>> 1.50rc1.  Under paragraph settings dialog, all alignment options
>> always seem
>> to be greyed out.
> 
> Did you uncheck the "Default" box?
> 

Ah!  Well, at least one reasonably intelligent somewhat experienced lyx user
was confused about this interface.



Re: No paragraph alignment options

2007-06-20 Thread Bennett Helm

On Jun 20, 2007, at 1:54 PM, Neal Becker wrote:

1.50rc1.  Under paragraph settings dialog, all alignment options  
always seem

to be greyed out.


Did you uncheck the "Default" box?

Bennett


No paragraph alignment options

2007-06-20 Thread Neal Becker
1.50rc1.  Under paragraph settings dialog, all alignment options always seem
to be greyed out.