From ed6f900552c72ab0a2b1c511d29b0ef747f5874e Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Sat, 1 Sep 2007 11:40:09 +0000 Subject: [PATCH] Use Minimalistic for branches git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19973 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/layouts/stdinsets.inc | 10 ++++++++++ src/insets/InsetBranch.cpp | 1 + src/insets/InsetCollapsable.cpp | 9 +++++++-- src/insets/InsetCollapsable.h | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index af2198c854..e8f60bb46a 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -82,6 +82,7 @@ End InsetLayout ERT LabelString ERT + Decoration minimalistic Font Color latex Family typewriter @@ -92,3 +93,12 @@ InsetLayout ERT EndFont End +InsetLayout Branch + Decoration minimalistic + LabelFont + Color Red + Size Small + EndFont +End + + diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 5174f6c7a0..c0a2043003 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -46,6 +46,7 @@ InsetBranch::InsetBranch(BufferParams const & bp, InsetBranchParams const & params) : InsetCollapsable(bp), params_(params) { + setLayout(bp); init(); } diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 54a4fc83b3..9600c0e9d3 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -59,10 +59,10 @@ InsetCollapsable::Geometry InsetCollapsable::geometry() const 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, @@ -261,6 +261,11 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const 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; diff --git a/src/insets/InsetCollapsable.h b/src/insets/InsetCollapsable.h index 0acb0dd8f3..2c95dcda91 100644 --- a/src/insets/InsetCollapsable.h +++ b/src/insets/InsetCollapsable.h @@ -92,7 +92,7 @@ public: * -------------+------------------------------- * Classic | *) TopButton, <--x) ButtonOnly * | LeftButton - * Minimalistic | NoButton NoButton + * Minimalistic | ButtonOnly NoButton * Conglomerate | SubLabel Corners * --------------------------------------------- * *) toggled by openinlined_