See attached.

I defined Minimalistic (up till now unused) as being
just a text inset when open, and just a button (with
the first few words of the content displayed on it)
when closed. This will make the visual appearance more
compact when there are lots of branches.

It is not without its challenges: you want to be able
to close an inset with mouse button 3, but also
to bring up the context menu, which now requires the
inset to be closed. Also autoOpen may be deceptive:
an inset may look open when the cursor is in it, while
being logically closed. Perhaps some visual cue is
still needed.

Attached.

- Martin

Index: src/insets/InsetBranch.cpp
===================================================================
--- src/insets/InsetBranch.cpp	(revision 19919)
+++ src/insets/InsetBranch.cpp	(working copy)
@@ -47,6 +47,7 @@
 			 InsetBranchParams const & params)
 	: InsetCollapsable(bp), params_(params)
 {
+	setLayout(bp);
 	init();
 }
 
Index: src/insets/InsetCollapsable.cpp
===================================================================
--- src/insets/InsetCollapsable.cpp	(revision 19944)
+++ src/insets/InsetCollapsable.cpp	(working copy)
@@ -59,10 +59,10 @@
 			return ButtonOnly;
 
 	case Minimalistic:
-		return NoButton;
+		return status() == Open ? NoButton : ButtonOnly ;
 
 	case Conglomerate:
-		return status() == Open ? SubLabel : Corners;
+		return status() == Open ? SubLabel : Corners ;
 	}
 
 	// dummy return value to shut down a warning,
@@ -266,6 +266,11 @@
 		button_dim.y2 = top + dimc.height();
 
 		pi.pain.buttonText(xx, top + dimc.asc, layout_.labelstring, layout_.labelfont, mouse_hover_);
+	} else {
+		button_dim.x1 = 0;
+		button_dim.y1 = 0;
+		button_dim.x2 = 0;
+		button_dim.y2 = 0;
 	}
 
 	int textx, texty;
Index: src/insets/InsetCollapsable.h
===================================================================
--- src/insets/InsetCollapsable.h	(revision 19937)
+++ src/insets/InsetCollapsable.h	(working copy)
@@ -92,7 +92,7 @@
 	 *   -------------+-------------------------------
 	 *   Classic      | *) TopButton, <--x) ButtonOnly
 	 *                | LeftButton
-	 *   Minimalistic | NoButton            NoButton
+	 *   Minimalistic | ButtonOnly          NoButton
 	 *   Conglomerate | SubLabel            Corners
 	 *   ---------------------------------------------
 	 *   *) toggled by openinlined_
Index: lib/layouts/stdinsets.inc
===================================================================
--- lib/layouts/stdinsets.inc	(revision 19919)
+++ lib/layouts/stdinsets.inc	(working copy)
@@ -82,6 +82,7 @@
 
 InsetLayout ERT
 	LabelString           ERT
+	Decoration            minimalistic
 	Font
 	  Color               latex
 	  Family              typewriter
@@ -92,3 +93,12 @@
 	EndFont
 End
 
+InsetLayout Branch
+	Decoration            minimalistic
+	LabelFont
+	  Color               Red
+	  Size                Small
+	EndFont
+End
+
+

Reply via email to