why is a "shaded note" called "shaded"? AFAICS, a shaded note is in fact a colored note both on screen and in LaTeX output!

I suggest renaming the menu item and the underlying code. If you agree, I will prepare a patch.


Here comes a first proposal that cleans up the code. Personally, I think that we call too many things a note. At least, we are supposed to be consistent (internally & externally) with this patch.

What is missing is a lyx2lyx converter that converts the two former note types (Note & Shaded) to

  \begin_inset Note LyXInternal

and

\begin_inset Note Colored
Any volunteer? Any comments?

Michael

Index: src/Color.h
===================================================================
--- src/Color.h	(Revision 18810)
+++ src/Color.h	(Arbeitskopie)
@@ -85,20 +85,20 @@
 		/// The color used for previews
 		preview,
 
-		/// Text color for notes
-		note,
-		/// Background color of notes
-		notebg,
-		/// Text color for comments
-		comment,
-		/// Background color of comments
-		commentbg,
-		/// Text color for greyedout inset
-		greyedout,
-		/// Background color of greyedout inset
-		greyedoutbg,
-		/// Shaded box background
-		shadedbg,
+		/// Text color for lyx-internal notes
+		notelyxinternal,
+		/// Background color of lyx-internal notes
+		notelyxinternalbg,
+		/// Text color for tex comments
+		notecomment,
+		/// Background color of tex comments
+		notecommentbg,
+		/// Text color for greyedout notes
+		notegreyedout,
+		/// Background color of greyedout notes
+		notegreyedoutbg,
+		/// Background color of colored notes
+		notecoloredbg,
 
 		/// Color for the depth bars in the margin
 		depthbar,
Index: src/insets/InsetNomencl.cpp
===================================================================
--- src/insets/InsetNomencl.cpp	(Revision 18810)
+++ src/insets/InsetNomencl.cpp	(Arbeitskopie)
@@ -97,7 +97,7 @@
 			newlines += static_cast<InsetNomencl const &>(*it).docbookGlossary(os);
 			++it;
 		} else if(it->lyxCode() == Inset::NOTE_CODE &&
-			  static_cast<InsetNote const &>(*it).params().type == InsetNoteParams::Note) {
+			  static_cast<InsetNote const &>(*it).params().type == InsetNoteParams::LyXInternal) {
 			// Don't output anything nested in note insets
 			size_t const depth = it.depth();
 			++it;
Index: src/insets/InsetNote.cpp
===================================================================
--- src/insets/InsetNote.cpp	(Revision 18810)
+++ src/insets/InsetNote.cpp	(Arbeitskopie)
@@ -50,22 +50,22 @@
 
 NoteTranslator const init_notetranslator()
 {
-	NoteTranslator translator("Note", InsetNoteParams::Note);
+	NoteTranslator translator("LyXInternal", InsetNoteParams::LyXInternal);
 	translator.addPair("Comment", InsetNoteParams::Comment);
 	translator.addPair("Greyedout", InsetNoteParams::Greyedout);
 	translator.addPair("Framed", InsetNoteParams::Framed);
-	translator.addPair("Shaded", InsetNoteParams::Shaded);
+	translator.addPair("Colored", InsetNoteParams::Colored);
 	return translator;
 }
 
 
 NoteTranslatorLoc const init_notetranslator_loc()
 {
-	NoteTranslatorLoc translator(_("Note"), InsetNoteParams::Note);
+	NoteTranslatorLoc translator(_("LyX-internal"), InsetNoteParams::LyXInternal);
 	translator.addPair(_("Comment"), InsetNoteParams::Comment);
 	translator.addPair(_("Greyed out"), InsetNoteParams::Greyedout);
 	translator.addPair(_("Framed"), InsetNoteParams::Framed);
-	translator.addPair(_("Shaded"), InsetNoteParams::Shaded);
+	translator.addPair(_("Colored"), InsetNoteParams::Colored);
 	return translator;
 }
 
@@ -89,7 +89,7 @@
 
 
 InsetNoteParams::InsetNoteParams()
-	: type(Note)
+	: type(LyXInternal)
 {}
 
 
@@ -152,7 +152,7 @@
 {
 	switch (params_.type) {
 	case InsetNoteParams::Framed:
-	case InsetNoteParams::Shaded:
+	case InsetNoteParams::Colored:
 		return AlignLeft;
 	default:
 		return Inline;
@@ -186,20 +186,20 @@
 
 	Color_color c;
 	switch (params_.type) {
-	case InsetNoteParams::Note:
-		c = Color::note;
+	case InsetNoteParams::LyXInternal:
+		c = Color::notelyxinternal;
 		break;
 	case InsetNoteParams::Comment:
-		c = Color::comment;
+		c = Color::notecomment;
 		break;
 	case InsetNoteParams::Greyedout:
-		c = Color::greyedout;
+		c = Color::notegreyedout;
 		break;
 	case InsetNoteParams::Framed:
-		c = Color::greyedout;
+		c = Color::notegreyedout;
 		break;
-	case InsetNoteParams::Shaded:
-		c = Color::greyedout;
+	case InsetNoteParams::Colored:
+		c = Color::notegreyedout;
 		break;
 	}
 	font.setColor(c);
@@ -211,20 +211,20 @@
 {
 	Color_color c;
 	switch (params_.type) {
-	case InsetNoteParams::Note:
-		c = Color::notebg;
+	case InsetNoteParams::LyXInternal:
+		c = Color::notelyxinternalbg;
 		break;
 	case InsetNoteParams::Comment:
-		c = Color::commentbg;
+		c = Color::notecommentbg;
 		break;
 	case InsetNoteParams::Greyedout:
-		c = Color::greyedoutbg;
+		c = Color::notegreyedoutbg;
 		break;
 	case InsetNoteParams::Framed:
-		c = Color::greyedoutbg;
+		c = Color::notegreyedoutbg;
 		break;
-	case InsetNoteParams::Shaded:
-		c = Color::shadedbg;
+	case InsetNoteParams::Colored:
+		c = Color::notecoloredbg;
 		break;
 	}
 	return c;
@@ -284,7 +284,7 @@
 int InsetNote::latex(Buffer const & buf, odocstream & os,
 		     OutputParams const & runparams_in) const
 {
-	if (params_.type == InsetNoteParams::Note)
+	if (params_.type == InsetNoteParams::LyXInternal)
 		return 0;
 
 	OutputParams runparams(runparams_in);
@@ -298,7 +298,7 @@
 		type = "lyxgreyedout";
 	else if (params_.type == InsetNoteParams::Framed)
 		type = "framed";
-	else if (params_.type == InsetNoteParams::Shaded)
+	else if (params_.type == InsetNoteParams::Colored)
 		type = "shaded";
 
 	odocstringstream ss;
@@ -330,7 +330,7 @@
 int InsetNote::plaintext(Buffer const & buf, odocstream & os,
 			 OutputParams const & runparams_in) const
 {
-	if (params_.type == InsetNoteParams::Note)
+	if (params_.type == InsetNoteParams::LyXInternal)
 		return 0;
 
 	OutputParams runparams(runparams_in);
@@ -350,7 +350,7 @@
 int InsetNote::docbook(Buffer const & buf, odocstream & os,
 		       OutputParams const & runparams_in) const
 {
-	if (params_.type == InsetNoteParams::Note)
+	if (params_.type == InsetNoteParams::LyXInternal)
 		return 0;
 
 	OutputParams runparams(runparams_in);
@@ -380,7 +380,7 @@
 		features.require("color");
 		features.require("lyxgreyedout");
 	}
-	if (params_.type == InsetNoteParams::Shaded) {
+	if (params_.type == InsetNoteParams::Colored) {
 		features.require("color");
 		features.require("framed");
 	}
Index: src/insets/InsetNote.h
===================================================================
--- src/insets/InsetNote.h	(Revision 18810)
+++ src/insets/InsetNote.h	(Arbeitskopie)
@@ -21,11 +21,11 @@
 class InsetNoteParams {
 public:
 	enum Type {
-		Note,
+		LyXInternal,
 		Comment,
 		Greyedout,
 		Framed,
-		Shaded
+		Colored
 	};
 	/// \c type defaults to Note
 	InsetNoteParams();
@@ -53,7 +53,7 @@
 	Inset::Code lyxCode() const { return Inset::NOTE_CODE; }
 	///
 	docstring name() const { return from_ascii("Note"); }
-	/// framed and shaded notes are displayed
+	/// framed and colored notes are displayed
 	virtual DisplayType display() const;
 	///
 	void write(Buffer const &, std::ostream &) const;
Index: src/frontends/qt4/ui/NoteUi.ui
===================================================================
--- src/frontends/qt4/ui/NoteUi.ui	(Revision 18810)
+++ src/frontends/qt4/ui/NoteUi.ui	(Arbeitskopie)
@@ -58,19 +58,19 @@
        <number>6</number>
       </property>
       <item>
-       <widget class="QRadioButton" name="noteRB" >
+       <widget class="QRadioButton" name="lyxinternalRB" >
         <property name="toolTip" >
-         <string>LyX internal only</string>
+         <string>LyX-internal only</string>
         </property>
         <property name="text" >
-         <string>LyX &amp;Note</string>
+         <string>&amp;LyX-internal</string>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QRadioButton" name="commentRB" >
         <property name="toolTip" >
-         <string>Export to LaTeX/Docbook but don't print</string>
+         <string>Export to LaTeX/Docbook but do not print</string>
         </property>
         <property name="text" >
          <string>&amp;Comment</string>
@@ -98,12 +98,12 @@
        </widget>
       </item>
       <item>
-       <widget class="QRadioButton" name="shadedRB" >
+       <widget class="QRadioButton" name="coloredRB" >
         <property name="toolTip" >
-         <string>Box with shaded background</string>
+         <string>Box with colored background</string>
         </property>
         <property name="text" >
-         <string>&amp;Shaded</string>
+         <string>&amp;Colored</string>
         </property>
        </widget>
       </item>
@@ -117,11 +117,11 @@
   <include location="local" >qt_helpers.h</include>
  </includes>
  <tabstops>
-  <tabstop>noteRB</tabstop>
+  <tabstop>lyxinternalRB</tabstop>
   <tabstop>commentRB</tabstop>
   <tabstop>greyedoutRB</tabstop>
   <tabstop>framedRB</tabstop>
-  <tabstop>shadedRB</tabstop>
+  <tabstop>coloredRB</tabstop>
   <tabstop>okPB</tabstop>
   <tabstop>closePB</tabstop>
  </tabstops>
Index: src/frontends/qt4/QNote.cpp
===================================================================
--- src/frontends/qt4/QNote.cpp	(Revision 18810)
+++ src/frontends/qt4/QNote.cpp	(Arbeitskopie)
@@ -36,11 +36,11 @@
 	connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK()));
 	connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose()));
 
-	connect(noteRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
+	connect(lyxinternalRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
+	connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 	connect(greyedoutRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
-	connect(commentRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 	connect(framedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
-	connect(shadedRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
+	connect(coloredRB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 }
 
 
@@ -85,8 +85,8 @@
 	QRadioButton * rb = 0;
 
 	switch (controller().params().type) {
-	case InsetNoteParams::Note:
-		rb = dialog_->noteRB;
+	case InsetNoteParams::LyXInternal:
+		rb = dialog_->lyxinternalRB;
 		break;
 	case InsetNoteParams::Comment:
 		rb = dialog_->commentRB;
@@ -97,8 +97,8 @@
 	case InsetNoteParams::Framed:
 		rb = dialog_->framedRB;
 		break;
-	case InsetNoteParams::Shaded:
-		rb = dialog_->shadedRB;
+	case InsetNoteParams::Colored:
+		rb = dialog_->coloredRB;
 		break;
 	}
 
@@ -116,10 +116,10 @@
 		type = InsetNoteParams::Comment;
 	else if (dialog_->framedRB->isChecked())
 		type = InsetNoteParams::Framed;
-	else if (dialog_->shadedRB->isChecked())
-		type = InsetNoteParams::Shaded;
+	else if (dialog_->coloredRB->isChecked())
+		type = InsetNoteParams::Colored;
 	else
-		type = InsetNoteParams::Note;
+		type = InsetNoteParams::LyXInternal;
 
 	controller().params().type = type;
 }
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp	(Revision 18810)
+++ src/Paragraph.cpp	(Arbeitskopie)
@@ -976,7 +976,7 @@
 			// probably we should put here all interface colors used for
 			// font displaying! For now I just add this ones I know of (Jug)
 		case Color::latex:
-		case Color::note:
+		case Color::notelyxinternal:
 			break;
 		default:
 			features.require("color");
Index: src/LaTeXFeatures.cpp
===================================================================
--- src/LaTeXFeatures.cpp	(Revision 18810)
+++ src/LaTeXFeatures.cpp	(Arbeitskopie)
@@ -488,13 +488,13 @@
 				 << params_.graphicsDriver
 				 << "]{graphicx}\n";
 	}
-	// shadecolor for shaded
+	// shadecolor for colored
 	if (mustProvide("framed") && mustProvide("color")) {
-		RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg));
+		RGBColor c = RGBColor(lcolor.getX11Name(Color::notecoloredbg));
 		//255.0 to force conversion to double
 		//NOTE As Jürgen Spitzmüller pointed out, an alternative would be
 		//to use the xcolor package instead, and then we can do
-		// \define{shadcolor}{RGB}...
+		// \define{shadecolor}{RGB}...
 		//and not do any conversion. We'd then need to require xcolor
 		//in InsetNote::validate().
 		int const stmSize = packages.precision(2);
Index: src/Color.cpp
===================================================================
--- src/Color.cpp	(Revision 18810)
+++ src/Color.cpp	(Arbeitskopie)
@@ -280,13 +280,13 @@
 	{ selection, N_("selection"), "selection", "LightBlue", "selection" },
 	{ latex, N_("LaTeX text"), "latex", "DarkRed", "latex" },
 	{ preview, N_("previewed snippet"), "preview", "black", "preview" },
-	{ note, N_("note"), "note", "blue", "note" },
-	{ notebg, N_("note background"), "notebg", "yellow", "notebg" },
-	{ comment, N_("comment"), "comment", "magenta", "comment" },
-	{ commentbg, N_("comment background"), "commentbg", "linen", "commentbg" },
-	{ greyedout, N_("greyedout inset"), "greyedout", "red", "greyedout" },
-	{ greyedoutbg, N_("greyedout inset background"), "greyedoutbg", "linen", "greyedoutbg" },
-	{ shadedbg, N_("shaded box"), "shaded", "#ff0000", "shaded" },
+	{ notelyxinternal, N_("note (LyX-internal)"), "notelyxinternal", "blue", "notelyxinternal" },
+	{ notelyxinternalbg, N_("note background (LyX-internal)"), "notelyxinternalbg", "yellow", "notelyxinternalbg" },
+	{ notecomment, N_("note (comment)"), "notecomment", "magenta", "notecomment" },
+	{ notecommentbg, N_("note background (comment)"), "notecommentbg", "linen", "notecommentbg" },
+	{ notegreyedout, N_("note (greyedout)"), "notegreyedout", "red", "notegreyedout" },
+	{ notegreyedoutbg, N_("note background (greyedout)"), "notegreyedoutbg", "linen", "notegreyedoutbg" },
+	{ notecoloredbg, N_("note background (colored)"), "notecoloredbg", "#ff0000", "notecoloredbg" },
 	{ depthbar, N_("depth bar"), "depthbar", "IndianRed", "depthbar" },
 	{ language, N_("language"), "language", "Blue", "language" },
 	{ command, N_("command inset"), "command", "black", "command" },
@@ -296,7 +296,7 @@
 	{ math, N_("math"), "math", "DarkBlue", "math" },
 	{ mathbg, N_("math background"), "mathbg", "linen", "mathbg" },
 	{ graphicsbg, N_("graphics background"), "graphicsbg", "linen", "graphicsbg" },
-	{ mathmacrobg, N_("Math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
+	{ mathmacrobg, N_("math macro background"), "mathmacrobg", "linen", "mathmacrobg" },
 	{ mathframe, N_("math frame"), "mathframe", "Magenta", "mathframe" },
 	{ mathcorners, N_("math corners"), "mathcorners", "linen", "mathcorners" },
 	{ mathline, N_("math line"), "mathline", "Blue", "mathline" },
@@ -309,8 +309,8 @@
 	{ eolmarker, N_("end-of-line marker"), "eolmarker", "Brown", "eolmarker" },
 	{ appendix, N_("appendix marker"), "appendix", "Brown", "appendix" },
 	{ changebar, N_("change bar"), "changebar", "Blue", "changebar" },
-	{ deletedtext, N_("Deleted text"), "deletedtext", "#ff0000", "deletedtext" },
-	{ addedtext, N_("Added text"), "addedtext", "#0000ff", "addedtext" },
+	{ deletedtext, N_("deleted text"), "deletedtext", "#ff0000", "deletedtext" },
+	{ addedtext, N_("added text"), "addedtext", "#0000ff", "addedtext" },
 	{ added_space, N_("added space markers"), "added_space", "Brown", "added_space" },
 	{ topline, N_("top/bottom line"), "topline", "Brown", "topline" },
 	{ tabularline, N_("table line"), "tabularline", "black", "tabularline" },
@@ -318,7 +318,7 @@
 	     "LightSteelBlue", "tabularonoffline" },
 	{ bottomarea, N_("bottom area"), "bottomarea", "grey40", "bottomarea" },
 	{ pagebreak, N_("page break"), "pagebreak", "RoyalBlue", "pagebreak" },
-	{ buttonframe, N_("frame of button"), "buttonframe", "#dcd2c8", "buttonframe" },
+	{ buttonframe, N_("button frame"), "buttonframe", "#dcd2c8", "buttonframe" },
 	{ buttonbg, N_("button background"), "buttonbg", "#dcd2c8", "buttonbg" },
 	{ buttonhoverbg, N_("button background under focus"), "buttonhoverbg", "#C7C7CA", "buttonhoverbg" },
 	{ inherit, N_("inherit"), "inherit", "black", "inherit" },
Index: lib/ui/stdmenus.inc
===================================================================
--- lib/ui/stdmenus.inc	(Revision 18810)
+++ lib/ui/stdmenus.inc	(Arbeitskopie)
@@ -392,11 +392,11 @@
 	End
 
 	Menu "insert_note"
-		Item "LyX Note|N" "note-insert Note"
+		Item "LyX-internal|L" "note-insert LyXInternal"
 		Item "Comment|C" "note-insert Comment"
 		Item "Framed|F" "note-insert Framed"
 		Item "Greyed Out|G" "note-insert Greyedout"
-		Item "Shaded|S" "note-insert Shaded"
+		Item "Colored|o" "note-insert Colored"
 	End
 
 	Menu "insert_branches"

Reply via email to