Enrico Forestieri
a03faee92d
There is no reason for inhibiting the symbols dialog in mathed.
...
The dialog only offers symbols defined in the unicodesymbols file
and they will be wrapped in \text{} when inserted in math mode,
so there is no risk that an untypesettable symbol gets inserted.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34344 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-30 08:27:03 +00:00
Pavel Sanda
b3870eac50
typo
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34338 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 21:50:06 +00:00
Pavel Sanda
11510dbfc7
Unify "* space" into "* Space", its just double work for translators.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34337 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 21:48:10 +00:00
Pavel Sanda
11e7cc2344
Unify QQaud strings.
...
Inside math toolbars we use "Quadratin". Dunno if this difference is intention.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34336 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 21:48:08 +00:00
Pavel Sanda
ea24773537
Unify Inter-word and Interword space strings.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34335 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 21:48:03 +00:00
Enrico Forestieri
ba4e75f11c
The character dialog was disabled in r30810 for solving an assertion
...
due to a missing buffer and because the "dialog is only useful in texted".
The problem with the buffer member has been solved since then, and while
it is true that the character dialog is not much useful in mathed, it
is the only way for coloring only parts of equations. Given that this
would also be a regression with respect to 1.6, I am re-enabling it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34327 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 15:49:00 +00:00
Enrico Forestieri
9b3aadbe22
Don't hardcode Color_math, such that decorations and other math
...
elements can be drawn in the right color on screen.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34326 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 13:19:09 +00:00
Enrico Forestieri
beb3fa70e8
Also account for colors in math macros.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34325 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 11:38:01 +00:00
Vincent van Ravesteijn
6c4de0377c
Fix bug #6614 : Preview Other Format Button Greys Out After Preview.
...
getStatus() returns false for LFUN_BUFFER_VIEW when a previewing process is running. So, if this process has finished we should free the menu item.
P.S. on windows, the item does not get disabled anyway.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34324 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 04:51:05 +00:00
Vincent van Ravesteijn
25a41486d6
Fix bug #6619 : Display (Version Control) in Window Title.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34323 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 04:27:10 +00:00
Enrico Forestieri
d9bcbe5de6
Index: src/mathed/InsetMathEnsureMath.cpp
...
===================================================================
--- src/mathed/InsetMathEnsureMath.cpp (revisione 34304)
+++ src/mathed/InsetMathEnsureMath.cpp (copia locale)
@@ -13,8 +13,9 @@
#include "InsetMathEnsureMath.h"
-#include "MathStream.h"
#include "MathData.h"
+#include "MathStream.h"
+#include "MathSupport.h"
#include <ostream>
@@ -34,7 +35,8 @@ Inset * InsetMathEnsureMath::clone() con
void InsetMathEnsureMath::metrics(MetricsInfo & mi, Dimension & dim) const
{
- FontSetChanger dummy(mi.base, "mathnormal");
+ bool really_change_font = isTextFont(from_ascii(mi.base.fontname));
+ FontSetChanger dummy(mi.base, "mathnormal", really_change_font);
cell(0).metrics(mi, dim);
metricsMarkers(dim);
}
@@ -42,7 +44,8 @@ void InsetMathEnsureMath::metrics(Metric
void InsetMathEnsureMath::draw(PainterInfo & pi, int x, int y) const
{
- FontSetChanger dummy(pi.base, "mathnormal");
+ bool really_change_font = isTextFont(from_ascii(pi.base.fontname));
+ FontSetChanger dummy(pi.base, "mathnormal", really_change_font);
cell(0).draw(pi, x, y);
drawMarkers(pi, x, y);
}
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34321 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 01:58:11 +00:00
Enrico Forestieri
6c33aa2e5b
Index: src/mathed/InsetMathHull.cpp
...
===================================================================
--- src/mathed/InsetMathHull.cpp (revisione 34304)
+++ src/mathed/InsetMathHull.cpp (copia locale)
@@ -328,6 +328,23 @@ docstring InsetMathHull::standardFont()
}
+docstring InsetMathHull::standardColor() const
+{
+ docstring color;
+ switch (type_) {
+ case hullRegexp:
+ color = from_ascii("foreground");
+ break;
+ case hullNone:
+ color = from_ascii("foreground");
+ break;
+ default:
+ color = from_ascii("math");
+ }
+ return color;
+}
+
+
bool InsetMathHull::previewState(BufferView * bv) const
{
if (!editing(bv) && RenderPreview::status() == LyXRC::PREVIEW_ON) {
@@ -417,8 +434,11 @@ void InsetMathHull::draw(PainterInfo & p
return;
}
+ bool const really_change_color = pi.base.font.color() == Color_none;
+ ColorChanger dummy0(pi.base.font, standardColor(), really_change_color);
FontSetChanger dummy1(pi.base, standardFont());
StyleChanger dummy2(pi.base, display() ? LM_ST_DISPLAY : LM_ST_TEXT);
+
InsetMathGrid::draw(pi, x + 1, y);
if (numberedType()) {
Index: src/mathed/MathSupport.cpp
===================================================================
--- src/mathed/MathSupport.cpp (revisione 34311)
+++ src/mathed/MathSupport.cpp (copia locale)
@@ -653,6 +653,13 @@ bool isMathFont(docstring const & name)
}
+bool isTextFont(docstring const & name)
+{
+ fontinfo * f = lookupFont(name);
+ return f && f->color_ == Color_foreground;
+}
+
+
FontInfo getFont(docstring const & name)
{
FontInfo font;
Index: src/mathed/MathSupport.h
===================================================================
--- src/mathed/MathSupport.h (revisione 34311)
+++ src/mathed/MathSupport.h (copia locale)
@@ -51,6 +51,8 @@ bool isFontName(docstring const & name);
bool isMathFont(docstring const & name);
+bool isTextFont(docstring const & name);
+
// converts single cell to string
docstring asString(MathData const & ar);
// converts single inset to string
Index: src/mathed/InsetMathHull.h
===================================================================
--- src/mathed/InsetMathHull.h (revisione 34304)
+++ src/mathed/InsetMathHull.h (copia locale)
@@ -197,6 +197,8 @@ private:
void changeCols(col_type);
///
docstring standardFont() const;
+ ///
+ docstring standardColor() const;
/// consistency check
void check() const;
/// can this change its number of rows?
Index: src/MetricsInfo.cpp
===================================================================
--- src/MetricsInfo.cpp (revisione 34312)
+++ src/MetricsInfo.cpp (copia locale)
@@ -235,11 +235,15 @@ FontSetChanger::FontSetChanger(MetricsBa
save_ = mb;
FontSize oldsize = save_.font.size();
ColorCode oldcolor = save_.font.color();
+ docstring const oldname = from_ascii(save_.fontname);
mb.fontname = name;
mb.font = sane_font;
augmentFont(mb.font, from_ascii(name));
mb.font.setSize(oldsize);
- mb.font.setColor(oldcolor);
+ if (string(name) != "lyxtex"
+ && ((isTextFont(oldname) && oldcolor != Color_foreground)
+ || (isMathFont(oldname) && oldcolor != Color_math)))
+ mb.font.setColor(oldcolor);
}
}
@@ -252,11 +256,15 @@ FontSetChanger::FontSetChanger(MetricsBa
save_ = mb;
FontSize oldsize = save_.font.size();
ColorCode oldcolor = save_.font.color();
+ docstring const oldname = from_ascii(save_.fontname);
mb.fontname = to_utf8(name);
mb.font = sane_font;
augmentFont(mb.font, name);
mb.font.setSize(oldsize);
- mb.font.setColor(oldcolor);
+ if (name != "lyxtex"
+ && ((isTextFont(oldname) && oldcolor != Color_foreground)
+ || (isMathFont(oldname) && oldcolor != Color_math)))
+ mb.font.setColor(oldcolor);
}
}
@@ -294,17 +302,21 @@ WidthChanger::~WidthChanger()
//
/////////////////////////////////////////////////////////////////////////
-ColorChanger::ColorChanger(FontInfo & font, string const & color)
- : Changer<FontInfo, string>(font)
+ColorChanger::ColorChanger(FontInfo & font, docstring const & color,
+ bool really_change_color)
+ : Changer<FontInfo, ColorCode>(font), change_(really_change_color)
{
- save_ = lcolor.getFromLyXName(color);
- font.setColor(lcolor.getFromLyXName(color));
+ if (change_) {
+ save_ = font.color();
+ font.setColor(lcolor.getFromLyXName(to_utf8(color)));
+ }
}
ColorChanger::~ColorChanger()
{
- orig_.setColor(lcolor.getFromLyXName(save_));
+ if (change_)
+ orig_.setColor(save_);
}
Index: src/MetricsInfo.h
===================================================================
--- src/MetricsInfo.h (revisione 34312)
+++ src/MetricsInfo.h (copia locale)
@@ -222,12 +222,16 @@ public:
// temporarily change the used color
-class ColorChanger : public Changer<FontInfo, std::string> {
+class ColorChanger : public Changer<FontInfo, ColorCode> {
public:
///
- ColorChanger(FontInfo & font, std::string const & color);
+ ColorChanger(FontInfo & font, docstring const & color,
+ bool really_change_color = true);
///
~ColorChanger();
+private:
+ ///
+ bool change_;
};
} // namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34320 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 01:40:11 +00:00
Enrico Forestieri
c88eaf877e
Changing only the shape does not always work. For example,
...
\mathbb{\underbar{a}} is not correctly rendered on screen.
We really have to change the font set, but not always.
This cannot be done using an "if" statement, as when
the FontSetChanger scope ends, everything is restored,
defeating our change. Thus, this has to be done in the
FontSetChanger class itself. This is easily accomplished
by introducing a boolean with a default value of true
for really changing a font set.
This will also be useful in other cases that I am discovering.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34312 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-27 21:31:28 +00:00
Enrico Forestieri
dbb5ac93ea
The check for Color_math would fail if the font color is changed
...
in mathed, so implement a strategy which is immune to color changes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34311 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-27 19:23:31 +00:00
Enrico Forestieri
26ebe0865c
In mathed, also preserve the color when changing a font set,
...
otherwise symbols and font changes such as \mathit{a} are not
drawn in the selected color on screen.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34310 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-27 18:46:42 +00:00
Enrico Forestieri
17af3ea8f4
Change only the shape and not the whole font, otherwise constructs
...
such as \mathbf{\hat{a}} would not be correctly rendered on screen.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34297 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 20:20:49 +00:00
Vincent van Ravesteijn
87623ff478
Fix bug #6141 : Scrolling error with insets at top of file.
...
Fix the regression introduced in r28397 while fixing bug #5573 .
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34296 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 14:57:27 +00:00
Vincent van Ravesteijn
d2cc4a5b92
Tweak for X11.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34294 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 10:26:06 +00:00
Vincent van Ravesteijn
f8d64b4799
Fix bug #3871 : Shortcut to switch from TOC to text pane.
...
M-o now switches to the TOC pane, and Esc always returns from any DockView to the main window.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34293 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 10:03:09 +00:00
Vincent van Ravesteijn
f65f5be6d7
Fix bug #6451 (last part): Crash when interacting with buffer-dependent dialog with no buffer open.
...
- First, the comment for isBufferDependent is corrected. It seems that the actual use of this function differs from the comment. As the comment said, I decided to close all dialogs that were buffer dependent, but this didn't seem to be correct for the view source pan, the outliner, and find-and-replace.
- Second, the dialogs that are buffer dependent are now closed, but dockviews are not, except for the spellchecker pane, which really depends on an open buffer, but I can't test that.
So, please test whether the spellchecker dockviewed window behaves as one expects.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34291 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 02:12:10 +00:00
Vincent van Ravesteijn
28b167bfff
Make sure the Table of Contents is always on top in the model combobox of the TocWidget.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34290 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 01:36:24 +00:00
Vincent van Ravesteijn
c6c0559be0
Fix bug #6672 (part 2): Add tooltips to the outliner.
...
At some point we should implement that the tooltips are only shown when they are not completely shown in the outliner. However, this requires extending the QTreeView class.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34287 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-26 00:43:08 +00:00
Vincent van Ravesteijn
acff67f259
Fix bug #6672 (part 1): Notes, Footnotes, and Marginals are unnecessarily truncated.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34286 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-25 22:18:46 +00:00
Peter Kümmel
7f09a8b58b
cmake: remove recursive call, even if it breaks merged builds with GCC, fix linker error on win32
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34283 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-23 13:20:28 +00:00
Peter Kümmel
7aecb18f56
cmake: remove recursive call, even if it breaks merged builds with GCC, fix linker error on win32
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34280 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-23 12:58:17 +00:00
Peter Kümmel
be9fdbcad4
cmake: remove recursive call, even if it breaks merged builds with GCC
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34279 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-23 12:52:39 +00:00
Vincent van Ravesteijn
0f2e47c4ad
Fix bug #6664 : InsetInfo: lyxrc information broken.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34278 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-23 11:46:24 +00:00
Peter Kümmel
38628558a6
cmake: more merged build fixes
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34274 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-23 09:10:35 +00:00
Peter Kümmel
5b75a45bc1
don't forget to pack numpunct_lyx_char_type.h
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34269 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 22:04:21 +00:00
Vincent van Ravesteijn
6ec5776991
Fix bug #5543 : InsetInfo gives wrong result for textclasses.
...
InsetInfo only returned whether a layout file was available for a class, not whether the LaTeX document class was available.
This might be caused by the maybe misleading name of the "LayoutFileList::haveClass()" function.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34268 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 19:36:03 +00:00
Peter Kümmel
ed05787e41
add new files to Makefile.am.
...
numpunct_lyx_char_type.h is msvc specific.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34265 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 16:01:23 +00:00
Peter Kümmel
5b916eb7c5
don't pollute the global namespace, move bind and shared_ptr into the lyx scope.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34264 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 15:56:20 +00:00
Peter Kümmel
4654a8bf96
build with GCC
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34263 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 14:40:57 +00:00
Peter Kümmel
e948caf637
build with msvc10. Seems there is a bug in their STL code:
...
// std::numpunct has a hardcoded dllimport in definition, but we wanna it with 32 bit
// so we can't import it and must define it but then the compiler complains.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34262 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 14:28:52 +00:00
Peter Kümmel
aaf7bfd231
change was committed by accident.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34261 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 12:02:43 +00:00
Peter Kümmel
21514ad512
Seems boost also includes all std headers. Not including boost therefore produces errors.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34260 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 11:45:34 +00:00
Peter Kümmel
c9b9748cee
msvcUsing "using namespace std" with msvc10 makes also std::tr1::shared_ptr visible and generates conflicts with boost::shared_ptr.
...
Solution: don't use boost::shared_ptr for msvc10 (could also be extended to several GCC versions)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34259 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 11:37:32 +00:00
Peter Kümmel
87c6a4679a
at least compile with msvc10.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34258 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 11:19:49 +00:00
Peter Kümmel
61b2bd5e7f
Using "using namespace std" with msvc10 makes also std::tr1::bind visible and generates conflicts with boost::bind.
...
Solution: don't use boost::bind for msvc10 (could also be extended to several GCC versions)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34257 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 11:16:58 +00:00
Richard Heck
d01dec6dfe
UI for XHTML options. I removed the xml line from OutputUi.ui
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34251 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 15:20:31 +00:00
Richard Heck
5678dc566f
New XHTML math options. Format change.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34250 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 15:18:25 +00:00
Vincent van Ravesteijn
b14ef59db8
Remove boundary parameter from BufferView::coordOffset(). The first DocIterator parameter already contains this information.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34248 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 13:12:40 +00:00
Vincent van Ravesteijn
63d24ca3c4
Remove boundary parameter from BufferView::getPos(). The first DocIterator parameter already contains this information.
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34247 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 13:03:04 +00:00
Uwe Stöhr
3c957e1bb1
Exporter.cpp: revert r34230 because this interferes with Enrico's new LyXVC feature to setup what LyX should do on export
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34246 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:54:08 +00:00
Pavel Sanda
e1cabbf70e
Last bits.
...
Trunk should be funcFileName consistent now.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34245 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:36 +00:00
Pavel Sanda
e5ce07206c
BranchList:
...
*FilenameSuffix -> *FileNameSuffix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34244 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:35 +00:00
Pavel Sanda
88635c7e77
Buffer::getAutosaveFilename -> Buffer::getAutosaveFileName
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34243 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:33 +00:00
Pavel Sanda
bb59d0fd0a
support:
...
isLyXFilename -> isLyXFilename
isValidLaTeXFilename -> isValidLaTeXFileName
isSGMLFilename -> isSGMLFileName
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34242 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:31 +00:00
Pavel Sanda
61fa96cbae
Dialog::bufferFilepath -> Dialog::bufferFilePath
...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34241 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:30 +00:00
Pavel Sanda
72a6c77a51
support:
...
frontends:
onlyFilename -> onlyFileName
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34240 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 01:19:28 +00:00