These are just some minor cosmetics to make the char style inset look a little 
bit better, now that is usable again (most importantly: I have removed the 
left margin which really annoyed me all the time).

Still missing: the label (not drawn for some reason I couldn't figure out 
yet).

I will apply after the weekend if nobody objects.

J�rgen
Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v
retrieving revision 1.2013
diff -u -r1.2013 ChangeLog
--- ChangeLog	30 Oct 2004 13:05:30 -0000	1.2013
+++ ChangeLog	30 Oct 2004 18:04:25 -0000
@@ -1,3 +1,7 @@
+2004-10-30  Jürgen Spitzmüller  <[EMAIL PROTECTED]>
+
+	* text.C (leftMargin): do not indent paragraphs in charstyle insets.
+
 2004-10-30  José Matos  <[EMAIL PROTECTED]>
 
 	* output_docbook.C (makeParagraphs):
Index: text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.583
diff -u -r1.583 text.C
--- text.C	23 Oct 2004 11:04:39 -0000	1.583
+++ text.C	30 Oct 2004 18:04:29 -0000
@@ -609,9 +609,10 @@
 	           && !isFirstInSequence(pit, pars_)))
 	    && align == LYX_ALIGN_BLOCK
 	    && !par.params().noindent()
-	    // in tabulars and ert paragraphs are never indented!
+	    // in charstyles, tabulars and ert paragraphs are never indented!
 	    && (par.ownerCode() != InsetBase::TEXT_CODE
-	            && par.ownerCode() != InsetBase::ERT_CODE)
+	            && par.ownerCode() != InsetBase::ERT_CODE
+		    && par.ownerCode() != InsetBase::CHARSTYLE_CODE)
 	    && (par.layout() != tclass.defaultLayout()
 	        || bv()->buffer()->params().paragraph_separation ==
 	           BufferParams::PARSEP_INDENT))
Index: insets/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/ChangeLog,v
retrieving revision 1.1065
diff -u -r1.1065 ChangeLog
--- insets/ChangeLog	30 Oct 2004 14:49:51 -0000	1.1065
+++ insets/ChangeLog	30 Oct 2004 18:04:45 -0000
@@ -6,6 +6,7 @@
 	* insetcharstyle.C (outputVerbatim): remove this function.
 	* insetcharstyle.C (priv_dispatch): fix typo in LFUN_MOUSE_PRESS, 
 	which caused an infinite loop.
+	* insetcharstyle.C: minor drawing cosmetics.
 
 2004-10-29  José Matos  <[EMAIL PROTECTED]>
 
Index: insets/insetcharstyle.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetcharstyle.C,v
retrieving revision 1.22
diff -u -r1.22 insetcharstyle.C
--- insets/insetcharstyle.C	30 Oct 2004 14:49:51 -0000	1.22
+++ insets/insetcharstyle.C	30 Oct 2004 18:04:45 -0000
@@ -18,6 +18,7 @@
 #include "dispatchresult.h"
 #include "funcrequest.h"
 #include "gettext.h"
+#include "debug.h"
 #include "LaTeXFeatures.h"
 #include "LColor.h"
 #include "lyxlex.h"
@@ -32,6 +33,7 @@
 #include <sstream>
 
 
+using std::endl;
 using std::string;
 using std::auto_ptr;
 using std::istringstream;
@@ -48,7 +50,7 @@
 
 InsetCharStyle::InsetCharStyle(BufferParams const & bp,
 				CharStyles::iterator cs)
-	: InsetCollapsable(bp), has_label_(true)
+	: InsetCollapsable(bp), has_label_(false)
 {
 	params_.type = cs->name;
 	params_.latextype = cs->latextype;
@@ -56,12 +58,13 @@
 	params_.latexparam = cs->latexparam;
 	params_.font = cs->font;
 	params_.labelfont = cs->labelfont;
+	setDrawFrame(false);
 	init();
 }
 
 
 InsetCharStyle::InsetCharStyle(InsetCharStyle const & in)
-	: InsetCollapsable(in), params_(in.params_), has_label_(true)
+	: InsetCollapsable(in), params_(in.params_), has_label_(false)
 {
 	init();
 }
@@ -97,7 +100,7 @@
 {
 	LyXFont tmpfont = mi.base.font;
 	getDrawFont(mi.base.font);
-	InsetCollapsable::metrics(mi, dim);
+	InsetText::metrics(mi, dim);
 	mi.base.font = tmpfont;
 	dim_ = dim;
 	if (has_label_)
@@ -111,7 +114,6 @@
 
 	// FIXME: setStatus(Inlined); this is not a const operation
 	LyXFont tmpfont = pi.base.font;
-	//setDrawFrame(InsetText::NEVER);
 	getDrawFont(pi.base.font);
 	InsetText::draw(pi, x, y);
 	pi.base.font = tmpfont;
@@ -124,6 +126,7 @@
 		y + InsetText::descent() - 4, params_.labelfont.color());
 
 	if (has_label_) {
+		lyxerr << "params_type = " << params_.type << endl;
 		LyXFont font(params_.labelfont);
 		font.realize(LyXFont(LyXFont::ALL_SANE));
 		font.decSize();

Reply via email to