On Thu, Apr 20, 2000 at 06:27:21PM +0300, Dekel Tsur wrote:
> > Another idea, maybe even more useful would be to have a vertical line
> > in the left margin showing how the grouping is currently. It could be
> > possible then to click somehow on this line to increase/decrease depth.
> 
> This is a good idea, and can be implemented easily (at least drawing the
> lines). I've attached a patch that does it (only as a reference!
> [The patch is against CVS, and will not works with 1.1.4]).

Oops, I forgot to attach the patch.
Index: src/text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.52
diff -u -p -r1.52 text.C
--- src/text.C  2000/04/19 01:42:54     1.52
+++ src/text.C  2000/04/20 15:15:14
@@ -3835,6 +3841,29 @@ void LyXText::GetVisibleRow(int offset, 
                pain.line(paperwidth - 2, offset,
                          paperwidth - 2, offset + row_ptr->height,
                          LColor::appendixline);
+       }
+
+       int depth = row_ptr->par->GetDepth();
+       if (depth > 0) {
+               int next_depth = (row_ptr->next)
+                       ? next_depth = row_ptr->next->par->GetDepth() : 0; 
+               int prev_depth = (row_ptr->previous)
+                       ? row_ptr->previous->par->GetDepth() : 0;
+
+               for (int i = 1; i <= depth; ++i)
+                       pain.line(4*i, offset,
+                                 4*i, offset + row_ptr->height - 1 - 
+(i-next_depth-1)*3,
+                                 LColor::footnoteframe);
+
+               for (int i = prev_depth + 1; i <= depth; ++i)
+                       pain.fillRectangle(4*i, offset,
+                                          4, 2,
+                                          LColor::footnoteframe);
+
+               for (int i = next_depth + 1; i <= depth; ++i)
+                       pain.fillRectangle(4*i, offset + row_ptr->height - 2 - 
+(i-next_depth-1)*3,
+                                          4, 2,
+                                          LColor::footnoteframe);
        }
        
        if (row_ptr->par->pextra_type == LyXParagraph::PEXTRA_MINIPAGE) {

Reply via email to