Factor out the code that connects to a newly created dialog and then
use that also in GuiGraphics.
There must be many other dialogs that need this same treatment....
The bookmarks are added as virtual elements in display Rows. Bookmarks
are shown with circled numbers. A new color "bookmarks" has been
added. Currently bookmark 0 (the return position) is not displayed
because it is very disturbing in practice.
To make this work, a new method BookmarksSection::bookmarksInPar
retuns the list of bookmarks in a paragraph along with their position.
Force redraw when using bookmark-save and bookmark-clear.
Fixes bug #2496.
As suggested there, we attach ourselves to the newly created inset,
if we in fact just created an inset. (This will only matter if Apply
was clicked, so the dialog is still open, but I did the calcuation
anyway, as it seems cheap enough.) This allows the user to modify
that inset (e.g., change the format) and also prevents another click
on Apply, or OK, from creating another dialog.
I've also removed the override of disconnectOnApply(). It does not
work, anyway, I think because it only works with GuiDialog, not with
DialogView-based dialogs.
At the moment, there is no support for plurals and capitalization.
A long comment explains why. Support could be added for that without
a format change.
Mistakes are visible but word replacement is disabled. Disable relevant
widgets depending on the situation.
Move updateView code to SpellcheckerWidget::Private.
1/ remove boost regex code from 3rdparty/boost. Only the cmake stuff remains.
2/ remove traces of BOOST_LIB since there is no need anymore to
compile boost stuff.
3/ remove traces of boost regexp in config/lyxinclude.m4 and INSTALL
4/ require gcc 4.9 as minimal version in autoconf.
Unfortunately, the net gain is only 10% of included boost size (now 21M).
The current code did not give much information.
I am not sure why the <<FontInfo operator is not defined in
FontInfo.h, but I figured that it was not necessary to understand that
now.
The caret geometry is now computed in BufferView as a list of shapes
(caret, horizontal l-shape if needed, completion triangle if needed)
kept in a variable of type CaretGeometry.
The code in WorkArea.cpp only has to draw these shapes. The
CaretWidget (which never was a widget) in GuiWorkArea.cpp is gone
now.
As a consequence, the bounding box for the cursor is known precisely
and therefore rows should be repainted correctly now. This avoids
caret droppings.
Fixes bug #12024.
Because Compare uses threads, we need to make sure it is finished when a
compare is executed from the command line. This was a problem for command
sequences, because the next command would start running before the compare
was done, and the buffer with differences was available.
So this commit adds the "run-blocking" parameter when using
LFUN_DIALOG_SHOW to run a Compare. When calling Compare with run-sync, the
LFUN will wait for the compare worker thread to finish before returning and
possibly running the next command.
To do this, hard-coded test for xcb had to be replaced with a call to
platformName(). Since this method does not exist in Qt4, we emulate
it.
Note that Qt5 uses xcb bindings for X11 system, while Qt4 relies on
older X11 bindings. We return platorm == "qt4x11" in this case.
Fixes bug #11746.
The option here is to NOT indent the paragraph, so make that clear.
As it was, we would set "Indent" to false in the case of paragraphs
that do not permit indentation and then write that, uselessly, to the
LyX file if we wrote any other option (and then keep writing it, even
if other options were removed). Now, we will write it only if it's been
explicitly set.
The method horizontalAdvance() replaces width() starting with Qt 5.11.
To handle this, all direct calls to QFontMetrics::width() are replaced
by calls to GuiFontMetrics::width(), and the code for
GuiFontMetrics::width(QChar) uses horizontalAdvance on newer Qt
versions.
Without this patch, there would be errors like these (warnings turned into errors):
D:\LyX\lyx-unstable\src\frontends\qt\GuiView.cpp(2413): error C4101: 'e': unreferenced local variable
D:\LyX\lyx-unstable\src\frontends\qt\GuiView.cpp(4879): error C4101: 'ex': unreferenced local variable
Intended changes:
* code is shorter and cleaner
* caret scales better with zoom when cursor_width=0: completion
indicator, l-shaped cursor...
Details:
* Rename BufferView::getPosAndHeight to getPosAndDim because ascent is
needed too and width could in the future be set depending on font.
* Get rid of rect_ in CaretWidget and record a Dimension (and y value) instead.
Remove also caret_width_ and slant_, replace rtl_ with dir.
* Make CaretWidget members public and lose the trailing _.
* change CaretWidget::update to read its parameters from current bufferview.
This can lead to mistakes. If no buffer is required at the beginning,
it is better to pass 'nullptr' explicitly.
Fix a case of missing parameter in GuiCompleter (introduced at
f3656600). This avoids some spurious "There is no group open (creating
one)" messages.
Fixes for bug #11428. Emphasis is used regularly and it is helpful to
see whether the next text will be written emphasized directly from the
cursor.
This is also implemented in MS Word and Google docs but not in
LibreWriter.
Also fixes the caret for RTL languages whose width was previously
extended into the wrong direction.
Instead of working around crashes in update of caret geometry, only
request it as needed. The actual computation will take place just
before painting the caret.
It might be that this is overkill and that caret geometry should be
updated unconditionally. One would have to to some timing while idle to
ascertain that.
Fixes bug #11912.
The rules for typesetting math differ from the rules for typesetting
text. For example, two italic 'f' chars have to be typeset more closely
than two 'o' chars in text mode, but not in math mode. Qt provides a
method that returns the distance appropriate for drawing a subsequent
character in text mode, but nothing for math mode. Typically, the
distance appropriate for drawing the next character in math mode is
the actual width span by the character, corrected by the rules of
an appendix in the TeXbook. Recently, those rules are followed more
closely in LyX but not exactly, and we have to find a way to adapt to them.
Some symbols may need more spacing around them than the width they span.
So, we use the distance suggested by Qt, unless it is less than the
width of the rectangle bounding the symbol. Before Qt 5.11 the used method
was QFontMetrics::width(), but since then it has been declared obsolete
in favor of QFontMetrics::horizontalAdvance(), whose name conveys better
its meaning.
Instead of working around crashes in update of caret geometry, only
request it as needed. The actual computaiton will take place just
before painting the caret.
It might be that this is overkill and that caret geometry should be
updated unconditionally. One would have to to some timing while idle to
ascertain that.
Fixes bug #11912.
When the fonts distributed with texlive with same family name
as ours are also managed by fontconfig, Qt is not able to
discriminate ours by the style only. In order to be sure Qt
will load our fonts, we change the foundry name from 'PfEd'
to 'LyEd' and augment the font family name with this foundry
name. This only works on *nix, because adding a foundry name
seemingly breaks things on Windows. However, this is a *nix
only problem, seemingly.
This restores the debug output as it was intended before the
introduction of the LYXERR macro that was unconditionally outputing
an end of line. This is how this output was appearing until lyx 1.5:
Looking for font family cmr10 ... got: cmr10
got it normal!
instead of as it was since lyx 1.6 and until now:
Looking for font family cmr10 ...
got: cmr10
got it
normal!
Using US english desktop language LyX's Mac OS adds some items to the view menu:
1. Show/Hide Tab Bar and
2. Enter Full Screen
These items won't work properly and it's better to hide them.