Commit Graph

46551 Commits

Author SHA1 Message Date
Kornel Benko
7c8f3a5d28 Cmake build: Check for needed qt6 required packages before using QT6
compilation
2024-04-06 10:34:00 +02:00
Juergen Spitzmueller
012c739668 Document 0d3d91c055 2024-04-06 09:58:31 +02:00
Juergen Spitzmueller
9198ed5965 Fix assertion when pasting paragraph with insets in lyxrc.ct_markup_copied
This has to be done after the inset buffers have been initialized.
2024-04-06 09:47:22 +02:00
Pavel Sanda
77273303a5 Improve stats update times for buffer switches and toolbar toggles. 2024-04-05 22:59:07 +02:00
Pavel Sanda
6f8b944d39 * quote-insert lfun description 2024-04-05 19:47:20 +02:00
Pavel Sanda
7976cc2dac Allow relative statistics values in statusbar.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg221311.html
2024-04-05 19:36:23 +02:00
Jean-Marc Lasgouttes
9fd397ac1c Indicate that, by default, mouse LFUN do not require a metrics update
This is done easily in LyXAction.cpp. Remember that, by default, each
function is supposed to request a full metrics computation.

Part of bug #12297.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
73678dcde9 Avoid full metrics computation when entering/leaving inset
Annotate function LFUN_FINISHED_xxx to indicate that they do not
require a full metrics computation.

Remove an "optimization" that meant that when the cursor changed
inset, a full metrics computation was requested.

Part of bug #12297
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
5e8578837f Avoid some full metrics computations related to math previews
When entering/leaving a math hull inset, a Update::Force flag was set,
in case the metrics of the inset would change because of a switch
between normal and preview representation.

When entering the inset, this code is now used only when the inset was
in preview mode.

In both cases, Update::Force is replaced with Update::SinglePar.

This requites in Text::dispatch to honor Update::SinglePar when it has
been set by some lfun, even when singleparupdate is false.

Part of bug #12297.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
f7218cec18 Avoid metrics computation on resize when width did not change
Entering a math inset triggers a work area reize because the math
toobars appear automatically. However, by default these toolbars are
at the bottom of the screen and their presence does not change the
typesetting of paragraphs. Therefore it is useful to avoid a call to
updateMetrics() in the case where the width of the work area did not
change.

Part of bug #12297.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
1d1f95d2ed Reduce metrics updates from 4 to 1 when loading file
The number of metrics updates when loading file and showing it in a
new work area is unreasonable.

The first avoided call to updateMetrics() was an explicit resize in
BufferView::init(). Instead, an assertion is suppressed by exiting
early BufferView::processUpdateFlags() when BufferView::ready()
returns false. This is a new method introduced to factor in some
existing tests.

Two other metrics computations are avoided by setting the enclosing
View object busy() while creating the new tab. To make this work
properly, GuiWorkArea::scheduleRedraw has to return early in this
case.

When saving an unnamed document or invoking "Save as...", call
setBusy(false) earlier so that repainting occurs correctly.

Fixes bug #12976.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
a23522073c Update PAINTING_ANALYSIS 2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
2449693301 Do not compute metrics at each preview when loading file
With the branch-test.lyx file from #12297, loading takes forever when
previews are activated. This is because each preview element causes a
full screen metrics recomputation.

This commit just skips these calls and only does one when all previews
have been obtained. As a result, computing the previews takes 1 second
instead of 25 seconds on branch-test.lyx.

Part of bug #12297.
2024-04-05 13:06:26 +02:00
Jean-Marc Lasgouttes
f15d2ebf38 Improve the code that limits scrolling at top/bottom
The most visible part of this commit is the move of part of
BufferView::updateMetrics to a new TextMetrics::updateMetrics. This
new method makes sure that metrics are known for all visible paragraphs
(starting from anchor), and that the positions of the paragraphs have
been recorded.

This method is called up to 3 times in BufferView::updateMetrics:
* unconditionally, to update all visible metrics,
* then, if the bottom of the document is visible and too high, after
  updating the anchor ypos,
* and similarly if the top of the document is visible and too low.

This fixes for example the case where one jumps to Section 5.3 at the
end of Tutorial and 'scroll_below_document' is false.

Some now redundant code is removed from BufferView::scrollToCursor.

The anchor-setting code in BufferView::draw is not clearly useful, but
left here just in case. It generates a debug warning, though.

Part of bug #12297.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
08010c6a5e Implement quick scroll
Replace flag parameter for updateMetrics() by a `force' boolean. When
it is false, the method keeps the metrics of paragraphs that are still
visible in WorkArea instead of computing everything afresh. All it has
to do is update their positions.

Add code to updateMetrics() to update the value of the anchor pit/ypos
(similar to the one in draw()).

Update processUpdateFlags() to use this when update flag is ForceDraw.

Modify scrollDocView() to just change the anchor paragraph position
when the scrolling operation would re-use some of the existing
paragraphs.

The time needed to update the metrics when scrolling with mouse in the
branch-test.lyx document is now divided by 20!

Part of bug #12297.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
0b6105b924 Introduce new helpers ParagraphMetrics::top/bottom
This avoids code with position/ascent/descent that is difficult to follow.

No change in function intended.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
7f85024f80 In the no-draw phase, do not cache the positions of not visible insets
This can make a big difference for a very large branch that contains
lots of equations.

This is complementary to the previous patch, since instead of reducing
the number of calls to updatePosCache, we make it faster.

In the same test of scrolling with mouse wheel through the
branch-test.lyx document, one finds a 23% improvement for
BufferView::updateMetrics().

Part of bug #12297.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
d19ade9a61 Remove some redundant calls to updatePosCache
The setting of insets positions was done twice in updateMetrics.
When one of the paragraph is a huge branch, this can be very expensive.

This leads to a 17% improvement on updateMetrics time on a scrolling test.

Part of bug #12297
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
9a96726bcd Enable Update::SinglePar in nested insets too
The idea of single par update is to try to re-break only the paragraph
containing the cursor (if this paragraph contains insets etc.,
re-breaking will recursively descend).

The existing single paragraph update mechanism was tailored to work
only at top level. Indeed changing a paragraph nested into an inset may
lead to larger changes.

This commit tries a rather naive approach that seems to work well: we
need a full redraw if either

1/ the height has changed
or
2/ the width has changed and it was equal to the text metrics width;
   the goal is to catch the case of a one-row inset that grows with
   its contents, but optimize the case of typing in a short paragraph
   part of a larger inset.

NOTE: if only the height has changed, then it should be
  possible to update all metrics at minimal cost. However,
  since this is risky, we do not try that right now.

Part of bug #12297.
2024-04-05 13:03:22 +02:00
Jean-Marc Lasgouttes
f5bbadbad9 Implement undo coalescing
if the undo element we want to add only changes stuff that was already
modified by the previous one on undo stack (in the same group), then
skip it. There is nothing to gain in adding it to the stack.

The typical use case is when doing a search and replace in a large
document that does many replacements in each paragraph. In this case,
the same paragraph would be stored repeatedly.

Fixes bug #12564.
2024-04-05 12:50:20 +02:00
Stephan Witt
4c1db7cad8 #13049 add window activation for preferences to avoid it be hidden by main window on mac after alert prompts 2024-04-05 10:47:49 +02:00
Richard Kimberly Heck
eb57c93aab Update update-po.sh script
(cherry picked from commit b360b9ebf7)
2024-04-04 17:17:46 -04:00
Jean-Marc Lasgouttes
51562ff377 Do not include <QDate> in InsetInfo.h
This is used by getDate/getTime, which actually should not be
InsetInfoParams methods, but functions in anonymous namespace.
2024-04-04 17:47:33 +02:00
Juergen Spitzmueller
16fb7ae52d de.po 2024-04-04 17:17:41 +02:00
Jean-Marc Lasgouttes
b28655e91e fix typo in fr/Intro.lyx 2024-04-04 17:16:19 +02:00
Juergen Spitzmueller
aa7ff14933 Allow for multiple accelerator alternatives
This needs some testing before it could go to 2.4.x eventually
2024-04-04 17:12:48 +02:00
Jean-Marc Lasgouttes
6260689fd5 Compilation fix with Qt < 5.7
Qt::ImAnchorRectangle has only been introduced in Qt 5.7. Since it is
used to answer a query from the IM machinery, there is no need for
it with older Qt versions.
2024-04-03 12:41:45 +02:00
Kornel Benko
f89e39e403 Update sk.po 2024-04-03 12:24:28 +02:00
Juergen Spitzmueller
c1078811c4 de.po 2024-04-03 09:12:15 +02:00
Juergen Spitzmueller
728175f9ac Dissolve some shortcut conflicts in the wake of f3a4602c4c 2024-04-03 08:28:00 +02:00
Juergen Spitzmueller
a55ede6a74 Update German User Guide 2024-04-03 07:35:59 +02:00
Juergen Spitzmueller
77b680546d Merge branch 'master' of git.lyx.org:lyx 2024-04-03 07:26:11 +02:00
Richard Kimberly Heck
34dbdad957 Ignore all build* directories
(cherry picked from commit 368f10571a)
2024-04-02 22:05:14 -04:00
Richard Kimberly Heck
b8a988fa13 Docs for menu change
(cherry picked from commit c8534081c9)
2024-04-02 22:05:01 -04:00
jpc
3923c3abf4 Update fr.po 2024-04-02 18:56:42 +02:00
Richard Kimberly Heck
f374869687 Update doc info for quote-insert 2024-04-02 12:46:36 -04:00
Juergen Spitzmueller
655cdfbb7b de.po 2024-04-02 16:26:00 +02:00
Juergen Spitzmueller
f3a4602c4c Smarter menu length calculation
It is possible I have missed some shortcut conflicts, so please report
if you find any.
2024-04-02 14:41:54 +02:00
jpc
8850b68792 Translation of French Additional.lyx: chapter 3 completed 2024-04-02 11:52:40 +02:00
Kornel Benko
6ad572a3a2 Update sk.po 2024-04-02 11:35:56 +02:00
Kornel Benko
b8b9e8ec14 Cmake build: Adapt for branch 2.4 2024-04-02 10:46:20 +02:00
Juergen Spitzmueller
0b8e8eb174 de/UserGuide: update 2024-04-02 09:53:58 +02:00
P. De Visschere
4d02fb7ad7 cmake build with qt6 (macos) did not include "plugins" 2024-04-02 09:22:53 +02:00
Kornel Benko
8d79860ea7 Cmake build: Handle deprecated cmake versions
The warning says:
CMake Deprecation Warning at .../CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

Spotted by Scott Kostyshak
2024-04-02 09:22:53 +02:00
Daniel Ramoeller
638c04dd6a FindAdv: no paragraph indentation for more space in the search string
See #11555
2024-04-02 09:22:53 +02:00
Kornel Benko
07cacef398 FindAdv: Handle neg-spaces like normal space if searching without format 2024-04-02 09:22:53 +02:00
Kornel Benko
8de81e8dc1 Rename hasToString() to findUsesToString()
There are special cases where the toString() exist,
but still plaintext() is not to be used by find.
2024-04-02 09:22:53 +02:00
Juergen Spitzmueller
645ab7fa73 de.po 2024-04-02 08:23:42 +02:00
Juergen Spitzmueller
98080ca0d5 Fix label escaping in InsetMathRef (#12980)
This was completely broken: the IDs have been escaped in the LyX file
(which they absolutely shouldn't) but not in all LaTeX output (which
they should).
2024-04-02 08:15:53 +02:00
Richard Kimberly Heck
1198bbf01a Fix duplicate accelerator 2024-04-01 21:55:25 -04:00