Commit Graph

26881 Commits

Author SHA1 Message Date
Thibaut Cuvelier
6a4d3dbef7 DocBook: remove useless includes. 2020-09-19 20:43:38 +02:00
Thibaut Cuvelier
d8651cc60b More functions in anonymous namespace. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
25f72d392c DocBook: fine tuning of new lines. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
bdea21a87e DocBook: improve comments. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
9393ca74ba DocBook: new logic to handle the new lines, only used in output_docbook for now. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
27a44f8e48 XML: memorise if the last thing that is getting output is a line feed. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
6998e76495 DocBook: define new arguments in layouts to configure new-line behaviour. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
87dae26e4a Simplify code to generate only one paragraph at a time. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
9184ae14f0 A few more constants to avoid copies 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
dab71087cf DocBook: add a layout tag to tell whether an item is the abstract or not. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
7b0f9d9524 DocBook: simplify code to handle abstracts. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
0f145c3ef0 DocBook: use DocBookWrapperMergeWithPrevious in the code. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
c92e0bc5e7 DocBook: fix for ordering. 2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
72c304a629 DocBook: make openParTag/closeTag use paragraphs instead of layouts.
Not useful per se, but will be next with checking whether the wrapper tags should be opened/closed.
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
c417253d0b DocBook: use DocBookItemTag within paragraphs.
This is at least helpful for AAS, even though it slightly resembles a repurposition of that parameter.
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
1a09086ec2 Merge findLastParagraph and findLastBibliographyParagraph to lower code duplication.
Maybe these functions should move to ParagraphList.h/cpp?
2020-09-19 20:43:37 +02:00
Thibaut Cuvelier
4d78fe5957 Slight code-consistency improvements. 2020-09-19 20:43:36 +02:00
Thibaut Cuvelier
ad18c19492 DocBook: add new layout parameter DocBookWrapperMergeWithPrevious. 2020-09-19 20:43:36 +02:00
Thibaut Cuvelier
a852706bf0 DocBook: allow empty paragraphs before the <info> section. 2020-09-19 20:43:36 +02:00
Daniel Ramoeller
9a1f732664 Show slanted caret (cursor) when text style emphasis/italics/slanted.
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.
2020-09-18 13:27:06 +02:00
Yuriy Skalko
cd933534bd Increment preferences format to 34: rename Cyrillic *.kmap files 2020-09-17 15:05:31 +02:00
Jean-Marc Lasgouttes
b96b876403 Revert "Show toolbar context menu only when clicking on the toolbar"
Something is wrong.

This reverts commit f25253f89a.
2020-09-16 16:54:33 +02:00
Daniel Ramoeller
f25253f89a Show toolbar context menu only when clicking on the toolbar
Previsouly it was on the whole application window, except on disabled toolbar
buttons.

Fix for bug #11949
2020-09-16 11:18:57 +02:00
Jean-Marc Lasgouttes
ae37caacdd Add method FontMetrics::italic()
This can be useful for ticket #11428.
2020-09-14 16:26:19 +02:00
Yuriy Skalko
b0db575dc1 Show custom text styles in status bar
Fixes bug #11951.
2020-09-14 11:38:29 +02:00
Scott Kostyshak
670da1817e Fix documentation for LFUN_LAYOUT
The argument 'ignorenests' was renamed to 'ignoreautonests' at
d6fb2abb.
2020-09-12 19:31:42 -04:00
Stephan Witt
320b6b6656 #6401 correct cursor movement for word forward/backward with enabled Mac style (mac_like_cursor_movement)
The change includes a rewrite of the cursor movement when „mac style“ is enabled and don’t change anything otherwise.
The new code for mac uses the document iterator to go forward or backward. The traversal stops at word boundaries.
If going forward the position increments until a word is reached (if not already inside) and stops at the end of the word.
If going backward it does the same in opposite direction. The cursor jumps over non-editable insets and math.
Editable (open) insets are entered and the cursor move detects word boundaries inside them.
2020-09-12 14:34:56 +02:00
Yuriy Skalko
fb7b7e5223 Refactor runCommand 2020-09-11 16:13:23 +02:00
Jean-Marc Lasgouttes
c1f8c6c26d Fixup 5202d44e: make caret geometry update lazy
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.
2020-09-11 11:48:12 +02:00
Eugene Chornyi
46da0d9d4d Workaround Qtbug regarding the QAbstractScrollArea::mouseMoveEvent(...) (06969f9d) is only needed until Qt 5.15.1 as it was fixed there. 2020-09-10 20:40:48 +02:00
Daniel Ramöller
69841003a3 Let Ctrl-Click on a reference jump to the corresponding label.
Fix some warnings while we're at it. (That part by RKH.)
2020-09-10 12:38:41 -04:00
Daniel Ramöller
35aaa1c528 Show child documents in outline with their paths. 2020-09-10 12:30:12 -04:00
Richard Kimberly Heck
a8de13632a Add FIXME 2020-09-10 12:24:52 -04:00
Jean-Marc Lasgouttes
bf25e8568d Fixup ad954a32: make space insets easier to see.
The previous code left one extra pixel on each side of the visible space, and
spaces became too small to be readable.
2020-09-09 11:28:21 +02:00
Jean-Marc Lasgouttes
eda3219662 Remove unneeded space for \nolimits 2020-09-09 10:35:35 +02:00
Enrico Forestieri
fcd14df230 Avoid spurious requirements
The macros defined in the symbols file are only used for on-screen
representation, so that their definition should not require the use
on any latex package. Their definition should be taken into account
only when they are overridden by user macros with same name.
2020-09-09 01:32:51 +02:00
Enrico Forestieri
0762b52334 Try to use the right width for math symbols
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.
2020-09-08 22:30:02 +02:00
Jean-Marc Lasgouttes
b744c3e28a Revert "Fixup 5202d44e: make caret geometry update lazy"
Something is wrong with the cursor.

This reverts commit dc35f1ddf4.
2020-09-07 16:02:50 +02:00
Jean-Marc Lasgouttes
dc35f1ddf4 Fixup 5202d44e: make caret geometry update lazy
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.
2020-09-07 15:52:43 +02:00
Jean-Marc Lasgouttes
9b18a9b609 Fixup e1be71da5: avoid duplication of layout
If the containing paragraph has kept its layout, reset the layout of
the first paragraph of the newly inserted inset.
2020-09-07 14:16:47 +02:00
Jean-Marc Lasgouttes
a58bcf1d27 Fixup f96b99dcb3: read correctly \limits after macros
Move InsetMacro::limits_ to InsetMacro::Private, where it should have
been from the start. This means that limits_ is now copied when the
macro is cloned.
2020-09-07 12:13:42 +02:00
Enrico Forestieri
062d94c5da Fix on-screen display of special math fonts
Make sure that the on-screen representation of the special math fonts
mathbb, mathds, mathfrak, mathcal, and mathscr matches the latex output.
2020-09-06 18:16:04 +02:00
Juergen Spitzmueller
61739e5aef Add some hspacers 2020-09-05 08:23:56 +02:00
Juergen Spitzmueller
199fb4b934 set defaults for float_placement and float_alignment 2020-09-05 08:09:02 +02:00
Stephan Witt
45e8ea4acc #11756 Respect system preferences for tabbing on Mac 2020-09-04 23:28:27 +02:00
Enrico Forestieri
a9afdbb73c Personalize fonts
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.
2020-09-03 17:46:30 +02:00
Jean-Marc Lasgouttes
efc8d44d09 Fixup 2e784b2f: consider default layout too.
And simplify the test at the same time.
2020-09-03 12:56:33 +02:00
Juergen Spitzmueller
5c83c5c410 Foward-port tooltip addition from stable (3a7560dcb0) 2020-09-03 08:55:46 +02:00
Richard Kimberly Heck
5606e934ac Accelerators 2020-09-02 10:22:26 -04:00
Enrico Forestieri
8039b34802 Adjust debug output for fonts
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!
2020-09-01 12:12:55 +02:00
Richard Kimberly Heck
1ba785f2c6 Localization 2020-09-01 01:41:10 -04:00
Richard Kimberly Heck
3c25899eab Improved fix for edit button 2020-08-31 11:20:49 -04:00
Richard Kimberly Heck
cf7e32ee8f Fix problem with edit button.
The previous implementation relied upon the cursor being immediately
in front of the inset. A bad idea.
2020-08-31 10:50:59 -04:00
Richard Kimberly Heck
a385b7dc2b Fix bug 4475.
Add ability to create child from the include dialog.
2020-08-31 10:20:52 -04:00
Jean-Marc Lasgouttes
d68f6f7f40 Add FIXME: do we need to update scrollbar at each draw()?
Related to ticket #11947.
2020-08-30 19:16:38 +02:00
Stephan Witt
292799a4bd #11756 cleanup the view menu on Mac
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.
2020-08-30 15:35:02 +02:00
Stephan Witt
1c5a2fc0ec #11756 hide additional menu items in edit menu on Mac
Mac OS adds two extra menu entries to the edit menu.
These menu items are:
1. Start Dictation...
2. Emoji & Symbols
Both menu items don't work with LyX.
Therefore they shouldn't be present and the new code hides them.
2020-08-30 11:24:59 +02:00
Stephan Witt
784139da50 Remove unused leftover from Makefile. 2020-08-30 11:24:59 +02:00
Enrico Forestieri
80f94a9398 Use correct width for \fint
Both QTextLine::naturalTextWidth() and QTextLine::horizontalAdvance()
return the same value for \fint. However, examining esint10.ttf with
fontforge does not reveal any issue with the metrics. The fact that
\fint seems to be the only affected symbol might be due to its code
point, which corresponds to a space, so that maybe Qt makes some
assumptions on the metrics.

As QTextLine::naturalTextWidth() returns the width of the line that is
occupied by text, in the case of a single symbol we can obtain the
same value by using the width of the rectangle bounding the symbol.
2020-08-29 20:10:26 +02:00
Juergen Spitzmueller
6f476b960e Localize format prettyName in some more places (#11954) 2020-08-29 11:50:43 +02:00
Juergen Spitzmueller
3fc095e3bc Do not \protect label in subfloat caption (#11950) 2020-08-28 07:32:29 +02:00
Yuriy Skalko
3bd358a2f6 Prevent permanent disabling of comboboxes in Vertical/Horizontal space dialogs 2020-08-28 07:07:44 +02:00
Juergen Spitzmueller
4fdcf0e929 address deprecation warning 2020-08-27 14:43:23 +02:00
Pavel Sanda
28dd0e1f21 Fix Qt4 compilation. 2020-08-27 14:05:22 +02:00
Juergen Spitzmueller
bc76026da5 Disable citationSearchLE with citationSearchCB 2020-08-27 12:53:41 +02:00
Juergen Spitzmueller
39caa70100 Clear info_ cache if format changes 2020-08-27 12:41:40 +02:00
Juergen Spitzmueller
d44929ff81 Properly report back if showDirectory() doesn't succeed 2020-08-27 11:58:37 +02:00
Juergen Spitzmueller
ff14d0bd00 Report back if citation target could not be opened 2020-08-27 11:52:52 +02:00
Juergen Spitzmueller
5cc191ddee Fix string subst 2020-08-27 11:52:23 +02:00
Juergen Spitzmueller
b4ca3e4fa4 Assure bibinfo is correctly processed 2020-08-27 11:42:03 +02:00
Juergen Spitzmueller
c5c3323f32 Properly disable function 2020-08-27 10:59:15 +02:00
Juergen Spitzmueller
8365eabd6f Make paper search function accessible and customizable 2020-08-27 08:48:55 +02:00
Juergen Spitzmueller
d436a51024 About: Fix cutting of icon (#11946) 2020-08-26 10:01:53 +02:00
Jean-Marc Lasgouttes
cc349fd031 Add space before display math that starts a paragraph
This extra spacing was missing and is important for detecting extra
par breaks before equations (which are most of the times not wanted).

To do that, add a new member vmode to MetricsInfo which is equivalent
to LaTeX's \ifvmode (start of paragraph).

If in vmode, add the equivalent of an empty line before a display math inset.

At the same time, tweak value of \(above|below)displayskip, which was
12pt, whereas LaTeX uses 10pt in 10pt size (our reference).

Fixes bug #11891.
2020-08-25 13:20:37 +02:00
Stephan Witt
3c1b4a5d7e #6401 avoid use of lyxCode() 2020-08-25 10:54:49 +02:00
Jean-Marc Lasgouttes
294e4884ee Center correctly top labels like Abstract.
They used to take the paragraph indentation into account.

Fixes bug #11939.
2020-08-25 10:30:34 +02:00
Jean-Marc Lasgouttes
ee3a711316 Forgotten break in switch found by coverity scan. 2020-08-24 17:21:04 +02:00
Jean-Marc Lasgouttes
2a6f1d2b58 Fixup 907f0207: another place where pm.ascent() is wrong
Fix bug where selecting in first paragraph gave an end of selection on
wrong row.

Since pm.ascent() may contain the top margin, it makes sense in
setCursorFromCoordinates() to use the ascent of the front row instead,
like was none in907f0207 for getPitAndRowNearY().
2020-08-24 17:14:08 +02:00
Pavel Sanda
44ede7ef4b Do not hardcode launching of lyxpaperview script. 2020-08-24 15:11:53 +02:00
Yuriy Skalko
c160e21c48 Split some UI strings for translations 2020-08-24 07:23:40 +02:00
Pavel Sanda
894ad70eba Enable Open Citation menu item iff citation contain locator information or external search script is available.
Per Juergen's request.
2020-08-23 22:19:34 +02:00
Juergen Spitzmueller
0fa93fe55a Amend 76cdca6422
Use auto pointer in all loops over UsedLanguages_
2020-08-23 13:49:56 +02:00
Richard Kimberly Heck
17f9d6b192 Fix warnings 2020-08-23 05:48:15 -04:00
Juergen Spitzmueller
76cdca6422 range-based loops 2020-08-23 10:07:49 +02:00
Juergen Spitzmueller
c3cac2048b Sort secondary babel languages alphabetically 2020-08-23 10:04:56 +02:00
Juergen Spitzmueller
448e5efab4 Do not attempt to close language twice 2020-08-21 11:07:22 +02:00
Scott Kostyshak
4c0073cd03 Whitespace 2020-08-20 21:51:29 -04:00
Juergen Spitzmueller
c71551fd9d GuiAbout: some more polishment 2020-08-20 16:08:10 +02:00
Juergen Spitzmueller
1f92214d78 GuiAbout: use unformatted version info via Copy button 2020-08-20 15:50:31 +02:00
Pavel Sanda
e648202e7e Allow LyX to find pdfs and urls of citation references and follow them from context menu.
Currently tested:
- url & doi fields for bibtex.
- all documented eprinttypes of biblatex
- absolute paths of first entry of 'file' field for jabref and kbibtex
- external script searching for author + year pdf

Additional polishing will follow.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg212505.html
2020-08-20 09:12:54 +02:00
Yuriy Skalko
679c418b03 Fix UI string 2020-08-19 10:15:45 +02:00
Juergen Spitzmueller
55f7b337cc Simplification 2020-08-17 13:29:55 +02:00
Juergen Spitzmueller
3aefd7477c Fix font and encoding switch problem with directionality change at inset
Also fixes #10110
2020-08-17 13:25:02 +02:00
Juergen Spitzmueller
4d1d07ea10 Amend 92f6e4806e
This was too general
2020-08-17 13:11:46 +02:00
Stephan Witt
c88f331a06 Avoid a type mismatch warning resp. error for signed vs unsigned typed values comparison 2020-08-17 12:25:35 +02:00
Juergen Spitzmueller
957b615b1f Fix another crash with Grid pasting (follow-up to #11906) 2020-08-16 17:24:13 +02:00
Stephan Witt
2dae4ab4f3 Improved character count statistics for letter based insets (e.g. the LyX logo). 2020-08-16 17:07:04 +02:00
Stephan Witt
7ec0bdbf28 #6401 For correct document traversal special logo chars should be treated like letters 2020-08-16 17:05:44 +02:00
Stephan Witt
ba21c946a1 #6401 improve doc iterator to allow easy backward navigation 2020-08-16 16:54:03 +02:00
Juergen Spitzmueller
d9f1f7e348 Remove now redundant string 2020-08-16 11:31:56 +02:00