On Wed, Oct 17, 2007 at 04:04:35PM +0200, Helge Hafting wrote:
> Charstyles is nice for something - and now I even get
> the URL charstyle automatically when opening older documents.
> (Yes, I use 1.6 for work :-)
> 
> All very fine, but one problem. Whenever the cursor moves through an
> URL charstyle, stuff on the screen jumps all over the place.
> That is very distracting.
> 
> The line with the URL is shifted slightly down, possibly to make
> room for the upper corners that mark the URL inset.
> 
> The lines below the URL downshifts a lot, probably to make
> room for a label. But the URL charstyle don't have a label!
> 
> 
> Suggestions for improvements:
> 1. If there is no label (or a blank label or whatever),
>    don't try to make any room. No need!
> 
> 2. Don't shift the line down. Use whatever local line height there is,
>   and adapt the corners to that instead. Exceptions might be
>   necessary for heavily nested styles, but it'd be _very_ nice if _no_
>   text moves when entering a single charstyle. Ideally, no movement
>   even within two levels. Many levels will probably be rare.
>   This will make editing (or simply using LyX as a reader) much easier.
> 
>   If more visual feedback is needed, consider bigger corners,
>   colors, or whatever. Even "marching ants" is a lot less disruptive
>   than moving the line that I am reading.
> 
> 3. Possibly show the current style (and nested styles too?) on
>    the status line, so stuffing labels into the text won't be necessary.
>    A "charstyle combobox" in addition to the "paragraph style" box
>    will also serve this purpose, and of course it offers easier use
>   of charstyles too. Which is probably what we want. :-)
> 
> Helge Hafting

If Bo gets his info-on-mouseover working, the label can be permanently
disabled if turned off. Then nothing will move. It's the label (always 
drawn when inside the inset) that causes the movement. It's not true
what you say that URL has no label; in fact it has an empty label. The
worst of both worlds ;-/

(I could add specialcasing for that to InsetCollapsable; rather not.
The patch for this is attached, in case somebody likes it. BTW why is
URL in charstyles and not in custom insets? I spent some quality time
looking for it :-( )

- Martin

Index: InsetCollapsable.cpp
===================================================================
--- InsetCollapsable.cpp	(revision 21001)
+++ InsetCollapsable.cpp	(working copy)
@@ -172,7 +172,8 @@
 
 void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-	autoOpen_ = mi.base.bv->cursor().isInside(this);
+	autoOpen_ = mi.base.bv->cursor().isInside(this) 
+	    && !layout_.labelstring.empty();
 
 	switch (geometry()) {
 	case NoButton:
@@ -231,7 +232,8 @@
 
 void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
 {
-	autoOpen_ = pi.base.bv->cursor().isInside(this);
+	autoOpen_ = pi.base.bv->cursor().isInside(this)
+	    && !layout_.labelstring.empty();
 	int const old_color = pi.background_color;
 	pi.background_color = backgroundColor();
 

Reply via email to