Commit Graph

9949 Commits

Author SHA1 Message Date
Juergen Spitzmueller
879aa03a3e Add some tooltips wrt document backup 2023-02-15 11:22:19 +01:00
Juergen Spitzmueller
03ced49d9f whitespace 2023-02-12 14:37:35 +01:00
Juergen Spitzmueller
ced6c591fb Silence warning when unappropriate 2023-02-12 14:33:27 +01:00
Jean-Marc Lasgouttes
f0b60d0b4e fix comment. 2023-02-08 12:28:01 +01:00
Juergen Spitzmueller
713264ae2b Disable "search in selection only" with instant search
These two do not go well together. Making it work requires some major
overhaul of selection while searching (see #12655)
2023-02-07 14:48:09 +01:00
Jean-Marc Lasgouttes
418fd911f8 Revert "Extended comment and indentation for source code"
This was pushed by mistake. A different version of this patch will
eventually be committed.

This reverts commit 439c099124.
2023-02-01 00:12:14 +01:00
Daniel Ramoeller
439c099124 Extended comment and indentation for source code
- automatically inherit indentation from previous block
- (un)indent blocks
- (un)comment blocks
- add feature to show tabs and spaces
2023-02-01 00:09:49 +01:00
Juergen Spitzmueller
2371bfdf15 Fix font combos with Qt6 (#12630)
Use CategorizedCombos methods to properly access the model
2023-01-30 08:46:36 +01:00
Juergen Spitzmueller
b260ff8b27 Allow to hide categories in CategorizedCombo
font combos do not need that
2023-01-30 08:45:58 +01:00
Scott Kostyshak
2ccaefa8a1 Fix -Winconsistent-missing-override
Fix the following warning:

src/frontends/qt/GuiDocument.h:377:7: error: 'eventFilter' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
        bool eventFilter(QObject * sender, QEvent * event);
             ^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:139:18: note: overridden virtual function is here
    virtual bool eventFilter(QObject *watched, QEvent *event);
                 ^

Amends 62413580de.
2023-01-25 10:56:40 -05:00
Daniel Ramöller
62413580de Fix bug #12061. 2023-01-23 18:05:26 -05:00
Daniel Ramoeller
f608328059 Allow multiple selections in the file open dialog
Fix for bug #4315.
2023-01-09 15:52:33 +01:00
Richard Kimberly Heck
30189332c8 Fix minor bug mentioned in #10827 2023-01-04 23:23:30 -05:00
Juergen Spitzmueller
69d54ff9d8 Master/Child: do not clean includeonly list while editing (part of #12470) 2022-12-27 15:36:36 +01:00
Juergen Spitzmueller
4c8a698a28 MasterChild.ui: Group radio buttons (part of #12470) 2022-12-27 15:10:37 +01:00
Juergen Spitzmueller
14d74c9578 Try to be more precise in the hyperlink type tooltips 2022-12-26 10:46:54 +01:00
Juergen Spitzmueller
5f8e41dc9b GuiHyperlink: some minor fixes
* disambiguate "Other" label
* Add accelerator
* Add tooltip to "Other" widget
* Amend tooltip of "Web" widget (since "other" now seems to have taken
part of its function)
2022-12-26 10:13:51 +01:00
Richard Kimberly Heck
144cf4bb9a Allow an 'other' type for hyperlinks. Format change.
Also, perform the URL fixing magic for DocBook and XHTML.

As it was, it was impossible to enter e.g. "tel:" type links. Now
choosing the "Other" type just outputs the URL as given.

Also, the addition of "http" or "file" was not being done for
DocBook and XHTML. Now it is.
2022-12-25 12:45:48 -05:00
Juergen Spitzmueller
064955b151 Used pressed() signal in status bar widgets (fixes #12613) 2022-12-24 07:20:39 +01:00
Juergen Spitzmueller
f06ddb2342 Fix signals 2022-12-23 16:07:47 +01:00
Juergen Spitzmueller
d90484de0a Fix UI of document color selection
The coloring of push buttons does not work with all themes, so use a
dedicated widget.

Also, accelerators have been used multiple times.
2022-12-23 09:17:01 +01:00
Juergen Spitzmueller
7015d7db07 Mark "edit externally" button of preamble and local layout
while external editing is underway
2022-12-23 08:19:26 +01:00
Juergen Spitzmueller
d888d0d130 Inform user if panel or tab has invalid content (#10827)
This adds a warning icon to either the tab header or the panel stack
entry item if a widget on the panel/stack has invalid content.

Particularly helpful to get aware of such content on other tabs/panes
than the one currently selected.
2022-12-22 15:01:58 +01:00
Juergen Spitzmueller
4a3871f5db Add toolbar option to reset font + language settings (#12199) 2022-12-18 16:36:30 +01:00
Juergen Spitzmueller
23a2920dae Remove preceding spaces 2022-12-15 08:39:52 +01:00
Richard Kimberly Heck
fdabd46e8e Fix shortcut 2022-12-12 17:36:07 -05:00
Richard Kimberly Heck
88f0a98b52 Fix bug #12609 2022-12-12 17:33:56 -05:00
Richard Kimberly Heck
bbe2ee10a4 Pronoun 2022-12-12 17:18:35 -05:00
Juergen Spitzmueller
163844a6d0 Allow defaultfamily change with non_TeX fonts (#12608) 2022-12-11 14:47:13 +01:00
Juergen Spitzmueller
c7c3b39413 Minor checkedLineEdit fixes
* Do not disallow application if an invalid widget is disabled
* Fix coloring of text
2022-12-11 10:01:09 +01:00
Daniel Ramoeller
bfff93d879 Restrict toolbar menu to toolbar
Partial fix for bug #11949.
2022-12-10 20:30:58 +01:00
Jean-Marc Lasgouttes
46992201b7 Add != operator to FuncRequest and special value FuncRequest::prefix
Use this value (and `unknown' where relevant)
2022-12-10 20:30:58 +01:00
Scott Kostyshak
9f7bbeadda Change Doc Settings "Edit" PB to "Edit Externally"
"Edit" by itself is not clear if the user doesn't already know what
it does.

This affects both the local layout tab and the LaTeX preamble tab.

Brief ML discussion here:

  https://www.mail-archive.com/search?l=mid&q=20221202193312.myfnuhuz6xcil6qt%40gary
2022-12-10 10:02:48 -05:00
Juergen Spitzmueller
7f1cb306f9 Warn if buffer is switched with unapplied document changes (#9369) 2022-12-10 14:28:46 +01:00
Stephan Witt
deae5ea23a Follow-up for change a66ee4109e - guard Qt 5.4 code with version check 2022-12-08 18:05:37 +01:00
Stephan Witt
a66ee4109e Add OS version info to About box. 2022-12-07 00:08:11 +01:00
Jean-Marc Lasgouttes
f3f478c2fb C++11 compilation fix 2022-12-06 17:12:45 +01:00
Juergen Spitzmueller
6c904004b6 More refs sorting fixes
This now uses a Vector of pairs, which is more robust with non-unique
labels (e.g. in change tracking).
2022-12-05 09:45:40 +01:00
Richard Kimberly Heck
d4f2460ac4 Fix bug #11410.
Main part of patch from Daniel, adapted by me.
I also added the lyx2lyx code.
2022-12-04 18:33:58 -05:00
Juergen Spitzmueller
3ec87be050 Fixup refs sorting
This has been broken at df59649a18
2022-12-04 16:21:14 +01:00
Juergen Spitzmueller
abd69b06f4 Fixup refs grouping
This has been broken at df59649a18
2022-12-04 15:32:47 +01:00
Daniel Ramoeller
7bdf372ecc Properly reset on ESC key on LayoutBox/CategorizedCombo
Fix for bug #12497.
2022-12-04 13:45:49 +01:00
Richard Kimberly Heck
233ce1ec12 Partially fix bug #10827. Patch from Daniel, slightly modified by me. 2022-12-03 22:44:05 -05:00
Juergen Spitzmueller
c4b1f7b31c Some string fixes in compare UI 2022-12-03 15:21:15 +01:00
Scott Kostyshak
c7269ffa86 Comment 2022-12-02 19:34:36 -05:00
Scott Kostyshak
a41b866e60 Line width 2022-12-02 19:29:04 -05:00
Scott Kostyshak
6f9cfdea7e Comment
Jürgen confirms that the behavior in #8493 is present with Qt6.
2022-12-02 19:28:10 -05:00
Jean-Marc Lasgouttes
9376f0203d Merge branch 'killqt4'
Remove all trace of Qt4 support. The different elements have been
considered carefully before removal.

The only changes that need to be done concern Windows and macOS
compilation instruction and will need to be taken care of by the
respective maintainers before prerelease.

The file TODO.killqt4 lists what remains to be done.
2022-11-28 15:19:41 +01:00
Richard Kimberly Heck
5db9e91f16 Fix bug #11781. Patch from Daniel. 2022-11-27 13:20:17 -05:00
Daniel Ramoeller
2d01fcd079 Activate another tab group (aka split view)
Bind the new functions tab-group-next/previous to F6/S-F6 in CUA bindings.

Fix for #12115.
2022-11-27 18:52:05 +01:00
Jean-Marc Lasgouttes
cd5fe091d2 Stephan has checked that caching is still needed on macOS
Basically removing the cache makes getTextLayout 17x more expensive on
a simple test of scrolling through the Tutorial.
2022-11-25 12:44:56 +01:00
Jean-Marc Lasgouttes
c24233e3f1 Improve replacement for qDegreesToRadians
This is for Qt 5.0.X compatibility.
2022-11-25 00:07:37 +01:00
Scott Kostyshak
3b30dbfca4 Centralize cancelation of export
An export can be canceled by clicking on the status bar icon or by
executing export-cancel (e.g., via Document > Cancel Background
Process).

The centralized code kills the script and updates the status bar
icons.

No change in functionality intended.

Related commits: 70a71a82 and 01abab9a.
2022-11-22 14:55:26 -05:00
Scott Kostyshak
01abab9ad9 After export-cancel, hide busy and cancel buttons
This is consistent with 70a71a82 (which is about the code path
through clicking on the 'x' status bar icon).

In the next commit I'll make a function to centralize this sequence
of killing a script and emitting the scriptKilled() signal.
2022-11-22 14:30:52 -05:00
Scott Kostyshak
70a71a824b After confirm cancel, hide busy and cancel buttons 2022-11-22 14:24:11 -05:00
Juergen Spitzmueller
869247b617 Add button to stop processing
(rather than having it stop by clicking on the spinner)
2022-11-21 18:56:28 +01:00
Kornel Benko
43d506b104 Amend(2) 580dea63: get rid of Qt4 code also in cmake build 2022-11-21 09:31:48 +01:00
Jean-Marc Lasgouttes
7d196fea77 Fix handling of codepoints 9, 10, 12, 13
Qt >= 5 refuses to display them. We work around this in lib/symbols
already, but make sure we do not try to display math glyphs at these
code points anyway.

Fixes bug #8493.
2022-11-20 20:53:55 +01:00
Juergen Spitzmueller
e26a60edef Regenerate previews after zoom (#11919) 2022-11-20 18:18:59 +01:00
Jean-Marc Lasgouttes
546efc3ff1 Remove a workaround that seems to be useless since Qt 4.8 2022-11-19 20:09:59 +01:00
Jean-Marc Lasgouttes
e11c7cb71d Remove all uses of Q_WS_* macros
They are only defined with Qt4.
2022-11-19 19:53:28 +01:00
Jean-Marc Lasgouttes
a3327f576c Get rid of setSectionResizeMode helper functions. 2022-11-19 15:04:38 +01:00
Jean-Marc Lasgouttes
11369131ee Remove workaround that was needed only by Qt4 2022-11-19 14:58:50 +01:00
Jean-Marc Lasgouttes
0f8b4e36d8 Remove old workaround that was needed for Qt 4.2
Jürgen believes that this is not needed anymore.
2022-11-19 14:55:33 +01:00
Jean-Marc Lasgouttes
ac248e392d Get rid of Qt4 code in src/
Qt4 code has been identidifed by
  git grep -l 'QT_VERSION.*\(0x050000\|0x04\)' src

Uses of QT_VERSION_CHECK have been checked too.

been used to remember what places need further work.

Then remaining Qt4 references have been searched using
  git grep -i qt4
  git grep -i 'qt 4'
and relevant issues have been either fixed or noted in the new
TODO.killqt4 file.
2022-11-18 17:19:50 +01:00
Jean-Marc Lasgouttes
50e1bdf320 (almost) Fix Qt4 support
When is it detected that our zero-width characters are not really
zero-width, avoid to use them altogether. Currently, this is known to
happen in Qt4 with monospace fonts.

This allow to remove the special Qt4 code in breaskString_helper.

Related to bug #10117.
2022-11-10 17:27:45 +01:00
Jean-Marc Lasgouttes
23cd38bc1c Use TextLayoutHelper in x2pos and pos2x
This leads to substantial code simplification.

No intended behavior change.

Related to ticket #10117.
2022-11-10 16:13:29 +01:00
Jean-Marc Lasgouttes
7fdc604606 Refactor GuiFontMetrics::getLayout
This allows to create a new version that takes an already built
TextLayoutHelper struct as parameter.

No intended change.

See discussion in bug #10117.
2022-11-10 16:13:28 +01:00
Jean-Marc Lasgouttes
201c95a76e Handle multiple spaces at row break
In order to work around the Qt row breaking algorithm, which considers
multiple spaces as one at QTextLine break, we insert word_joiner unicode
characters beteween each pair of spaces.

The TextLayoutHelper class makes it easy to handle that.

Update Row::Element::rtrim() to only remove one space at row end.

Update support::countExpanders() to count all spaces, without special
handling for consecutive ones.

Fixes bug #10117.
2022-11-10 15:21:02 +01:00
Jean-Marc Lasgouttes
a48efa03b1 Introduce a struct to handle docstring <-> QString index translation
This new code allows to get rid of some hardcoded stuff and will be a
foundation for handling of consecutive spaces.

This code can be used in the future for getTextLayout, x2pos, and
pos2x in order to streamline code. Actually some features as the naked
parameter are here to prepare for this second set of changes.

No change intended. The modified code is much clearer, though.

Related to bug #10117.
2022-11-10 12:06:15 +01:00
Jean-Marc Lasgouttes
a99f76477d Revert "Fixup 572b06d6: reduce cache size for breakString"
10MB cache is not so large after all, and it can be helpful with
Scott's perverse examples.

This reverts commit 2abe771407.

Fixes part of bug #12598.
2022-11-08 00:12:40 +01:00
Daniel Ramoeller
89394bcd0f Show suggestions containing the input in the command buffer
Previously, only the suggestions starting with the current input were
shown.

Contains the following minor improvements:
- Add space to indicate when only one suggestion is found

- Select first item in suggestion-list in order to make selecting with
  arrow keys more intuitive

- Fix selection with Shift+Up/Down in text-field

Fix for bug #12572.
2022-11-04 22:27:31 +01:00
Juergen Spitzmueller
293b8dbe67 Do not unnecessarily reset the outliner to TOC on internal model changes
The activated() signal is only issued on user changes, what we want here,
not internal model changes (as with currentIndexChanged())
2022-11-02 12:33:20 +01:00
Juergen Spitzmueller
3a949b32f0 Merge branch 'master' into features/indexmacros 2022-10-29 11:42:14 +02:00
Juergen Spitzmueller
6415afc1fe Minor improvements to the screen width UI
* fix order of input and unit widgets
* remove redundant "Screen used" label
* Add tooltip
2022-10-29 11:17:22 +02:00
Scott Kostyshak
172e544e2c Whitespace 2022-10-28 18:28:31 -04:00
chillenb
22e5903bf3 adjust text display width in windowed mode 2022-10-27 17:49:43 +02:00
Juergen Spitzmueller
b3b22b0c70 Sync with master 2022-10-26 10:52:21 +02:00
Jean-Marc Lasgouttes
fff28c5756 Always qualify calls to std::move()
This quashes a new warning in clang++ 15, when std::move() (the
one-parameter version) is used as simply move(). There is a strong
recommendation from WG21 to avoid that.

Details here: https://reviews.llvm.org/D119670

It might be that we should not use that many move()s. I am not
competent to decide on that.

I also used this occasion to get rid of a spacial casing for C++11
that does not seem necessary after all.
2022-10-21 14:11:36 +02:00
Juergen Spitzmueller
647c7b1ac3 GuiLog: don't miss package warnings for packages with dashes
(e.g. scrlayer-scrpage)
2022-10-16 12:08:21 +02:00
Juergen Spitzmueller
2c72884f26 GuiLyXFiles: differentiate user and system folders 2022-10-09 16:13:48 +02:00
Juergen Spitzmueller
0e4ca9aa88 GuiLyXFiles: Hide empty categories on filtering (#12584) 2022-10-09 16:01:49 +02:00
Juergen Spitzmueller
5ee0ba6403 GuiLyXFiles: Visually distinguish folders from files (#12584) 2022-10-08 16:45:52 +02:00
Yuriy Skalko
8f43f83ddf Show branches from master document in branch inset dialog 2022-10-07 19:00:37 +03:00
Jean-Marc Lasgouttes
8508c3fe04 Completion: handle undo in insets' insertCompletion methods
I mathed, undo should record the underlying inset on completion,
whereas in test recording the paragraph is enough.

Therefore the recordUndo() in GuiCompleter::tab is removed, and the
relevant recordUndo/recordUndoInset are used at the right places.

As a further cleanup, the parameter `finished' of
Text::insertCompletion is removed as it is useless.

Fixes bug #12581.
2022-10-05 09:48:01 +02:00
Jean-Marc Lasgouttes
2abe771407 Fixup 572b06d6: reduce cache size for breakString
This was necessary only due to bug #12534.

Reduce the size from 10Mb to 1Mb. Profiling shows that the cache hit rate
is the same.
2022-09-21 19:10:57 +02:00
Jean-Marc Lasgouttes
8319bdbbbe Unify wording for statistics
Use 'no blanks' uniformly.

Also remove separator in zoom menu.
2022-09-13 12:42:28 +02:00
Daniel Ramoeller
974534f28a Disentangle status bar and zoom menu
- Moves the zoom menu to the zoom value
2022-09-13 11:49:41 +02:00
Jean-Marc Lasgouttes
337cc97174 Use auto const & when possible to avoid copies
In several range-based for loops, implicit copies are made. Remove
that when possible, and try to shut converity up otherwise.

Fixes issues found by coverity.
2022-08-30 17:31:37 +02:00
Juergen Spitzmueller
0515bfa989 Update stats display if a stat is (un)selected 2022-08-18 19:09:15 +02:00
Juergen Spitzmueller
96d9e748cf Polish status bar statistics 2022-08-17 14:59:50 +02:00
Stephan Witt
f426470a54 Improved synctex support
- Add check for converter with active synctex support to check for synchronized output for activate forward search.
2022-08-13 14:20:03 +02:00
Stephan Witt
9686fe0c79 Improved synctex support
- Check the state of the synchronize TeX output option of the document to enable or disable the LFUN for forward-search.
- write synctex macro to TeX source not only for PdfLaTeX
2022-08-11 22:45:51 +02:00
Pavel Sanda
5b50a97fd7 Add document statistics to statusbar.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg217810.html
2022-08-09 23:48:55 +02:00
Juergen Spitzmueller
9214f92599 Mode [un]locLengthString() methods to support/qstring_helpers 2022-08-09 17:27:53 +02:00
Juergen Spitzmueller
079bc8ca40 Localize display of glue lengths in dialogs 2022-08-09 09:44:12 +02:00
Juergen Spitzmueller
60b539e544 Rename function 2022-08-09 09:31:46 +02:00
Juergen Spitzmueller
1487b19803 Allow entering localized lengths with unit (#11852) 2022-08-08 18:35:48 +02:00
Juergen Spitzmueller
a8947aaad8 Amend 9e645a5cfc
Only show "System Default" if auto-open is available for the current
format.
2022-08-08 09:49:51 +02:00
Daniel Ramoeller
9e645a5cfc "System Default" viewer/editor option
Fix for bug #12571. More user friendly way to set the system default application aka "auto" option.
2022-08-08 09:18:39 +02:00
Juergen Spitzmueller
14d63f5be8 GuiGraphic: delimit "Scale in LyX" (1--1000%)
Larger values will eventually crash LyX (see #12353), 0 or negative
values make the image disappear in the workarea and impossible to edit.
2022-08-07 16:40:12 +02:00
Jean-Marc Lasgouttes
1dedd39864 Allow to unbind without specifying the lfun
When unbinding a shortcut, it may happen that the exact definition of
the request is not known. A typical example it Tab, which is bound to
a complex command sequence.

In this case it is convenient to use the syntax
\unbind "Tab" "*"

To make this word, the special "*" value is translated to the
FuncRequest::unknown lfun and this value is considered specially in
several places.
2022-07-27 18:57:03 +02:00
Jean-Marc Lasgouttes
2203078111 Fix flicker due to changing metrics while selecting with the mouse
This patch has been backported from the lyx-unstable branch
https://gitlab.com/gadmm/lyx-unstable/-/commit/9d7ed42389ba

Actual author is Guillaume Munch.

Fixes bug #8951.
2022-07-25 23:04:08 +02:00
Jean-Marc Lasgouttes
61d68d05bd Add proper extension as needed in Save as and Export
Introduce the new FileName method ensureExtension, which does the following:
* if the extension is already correct (in a case-insensitive way), do nothing.
* if it is not correct, add the extension to the file name.

This is different from changeExtension that will fail in a case where
the file contains dots, but not a real extension, like newfile2.1.

Use this new method in renameBuffer() and exportBufferAs().

Fixes bug #11008.
2022-07-25 22:52:07 +02:00
Jean-Marc Lasgouttes
7823d3b01b Fix display of bindings for StaticMenuButton
This requires to add a parameter to GuiToolbar::addItem so that it is
possble to make a difference between toolbar buttons and menu items.

The long-term solution is to rely on the menu backend for such things.

Fixes bug #12004.
2022-07-19 20:58:06 +02:00
Jean-Marc Lasgouttes
23a27e90ba Revert "Fix display of bindings for View-other-formats dynamic toolbar menu"
This reverts commit e2e7794c7e.
2022-07-19 13:36:12 +02:00
Jean-Marc Lasgouttes
e2e7794c7e Fix display of bindings for View-other-formats dynamic toolbar menu
Do it the same way as in menus. Also remove the tooltip, which is not used.

Fixes bug #12004.
2022-07-19 13:30:31 +02:00
Jean-Marc Lasgouttes
2b24c03e8b Do not override (Back)Tab in Adv F&R when it is useful
In Advanced Find and Replace, Tab can be used to move the focus from
Search field to the replace field. This is inconvenient when Tab has
another use, like completion.

To fix this, check that the function bound to Tab is disabled before switching focus.

The same is done for BackTab.

Fixes bug #11114.
2022-07-18 12:02:28 +02:00
Jean-Marc Lasgouttes
045aff3d9f Avoid duplicates in minibuffer history
The removal of duplicates is done in LastCommandsSection::add and uses
the erase-remove idiom for performance.

Most of the patch is a cleanup of GuiCommandBuffer:

* remove history_ member, that was a copy of the session lastcommands
  vector. Use instead a wrapper history() around it and a addHistory
  wrapper for adding new entries.

* Make sure that there is only one place where commands are added to
  history. The code used to maintain a list for interactive editing,
  and a list for saving the session. They could be different in terms
  of leading/trailing spaces.

* [unrelated] remove command_ member, which is just a copy of
  LyXAction list of commmands. Use directly lyxaction instead.
2022-07-13 19:53:08 +02:00
Jean-Marc Lasgouttes
f71a11f693 Fixup 95da2707: document getAlias. 2022-07-13 13:10:57 +02:00
Scott Kostyshak
c63e9d4caa Style 2022-07-12 17:55:04 -04:00
Daniel Ramoeller
95da270711 Check for icon aliases
The aliases are defined by a file in the (system or user) image
directory. The format is pretty simple: each line is like
  <str1> <str2>
Where every instance of <str1> will be replaced with <str2>.

Fixes bug #12509.
2022-07-12 23:35:48 +02:00
Scott Kostyshak
21eb2c4f74 Allow negative values for counters
enumi, for example, can be negative.
2022-07-09 16:40:22 -04:00
Jean-Marc Lasgouttes
2104ae8068 Fixup c30b0aac: protect against bad recursion
Adding this particular line created bad redraw interactions. See
thread on lyx-devel here:
https://marc.info/?l=lyx-devel&m=165648365808777&w=2

The code is reorganized a bit:

- the part of updateGUI() that (en|dis)abled elements is not moved to
  updateBottons ; the rest is renamed updateWorkAreas()

- only updateButtons is called now in eventFilter

- finally the recursion curse is fixed now in updateWorkAreas() by
  setting the old_buffer value _before_ calling copy_params. This
  avoid recursion if some bad update were to happen again.
2022-07-02 13:10:16 +02:00
Jean-Marc Lasgouttes
ae528715d3 Fix ToC action when cursor is in adv. F&R pane
This important part is the last point, the rest is what is needed to
make it happen.

* implement (FindAndReplace|FindAndReplaceWidget)::hasWorkArea, that
  tell whether a work area is own by the advanced find & replace
  widget.

* factor out method find() from GuiView::findOrBuild.

* implement GuiView::hasVisibleWorkArea, that tells whether a workarea
  is visible in the view (current tab in a split or adv. f&r
  workarea).

* Finally, in TocWidget::sendDispatch, change the current workarea
  temporarily to the document workarea before dispatching the
  function. The code tries to be as careful as possible to handle all
  cases. The future will tell whether it is good enough.
2022-06-29 11:09:14 +02:00
Jean-Marc Lasgouttes
2283440e77 whitespace 2022-06-28 23:51:09 +02:00
Jean-Marc Lasgouttes
f2f0b30222 Fix line breaking thinko with Qt4
The test on whether to keep trailing spaces was inverted.
2022-06-27 16:12:02 +02:00
Jean-Marc Lasgouttes
ab54158447 Honor key bindings for commit string
When the commit string from the inputMethodEvent can be interpreted as
characters bound to some action, dispatch this action instead of
inserting the string.

This is useful on an international keyboard, when diaresis+space gives
a plain double quote. It is better in this case to enter a smart
quote.

Adapted from a patch from Daniel Ramoeller <d.lyx@web.de>.

Fixes bug #10377.
2022-06-13 11:22:50 +02:00
Daniel Ramoeller
b2a7b715a2 Make space names more standard
Fix for bug #12547.

- "Interword" becomes "Normal"
- "Protected" becomes "Non-Breaking"

Plus a minor fixes to the "Horizontal Space Settings" dialog:
- Indicate that when "Non-Breaking" is disabled, the space will be non-breaking
2022-06-12 13:35:29 +02:00
Daniel Ramoeller
d9f51be6ed Show size of named spaces in dialog
Fix for bug #12467.
2022-06-03 12:37:39 +02:00
Jean-Marc Lasgouttes
c6725df2db Fixup d723b903: Fix slow display of large paragraphs
When implementing multi-row string breaking, an extra createLine()
statement, which made sense in the original code, was kept by mistake.
This basically made the mechanism ineffective, because it created one
row with the correct length, plus a second one with all the remaining
text, which would have to be itself broken. This went undetected
because the display is still correct.

Additionally, this issue polluted the break cache to the extent that
the hit rate could be 0%.

Together, these two effects created a major slowdown with a document
containing a single ~30000 characters paragraph.

Fixes bug #12534.
2022-05-19 16:18:24 +02:00
Juergen Spitzmueller
047004cb0f Merge branch 'master' into features/indexmacros 2022-05-14 16:29:46 +02:00
Daniel Ramoeller
4dd1fbbce0 Use "Auto" value on cursor width spinbox
Fix for bug #12515.
2022-05-11 18:05:47 +02:00
Juergen Spitzmueller
8bf45dd3ea Shuffle and add some shortcuts 2022-05-10 13:29:51 +02:00
Juergen Spitzmueller
c0a3d654ff Add GUI for search-ignore 2022-04-30 14:23:54 +02:00
Juergen Spitzmueller
f86c7994a5 Merge branch 'master' into features/indexmacros 2022-04-25 08:12:12 +02:00
Juergen Spitzmueller
64ec812da5 Amend d8f540f51
Properly handle aliases
2022-04-24 16:51:16 +02:00
Juergen Spitzmueller
d8f540f51b Properly ignore debug levels in the GUI
Not only none and any, but also the aliases.
2022-04-24 14:21:56 +02:00
Kornel Benko
98cc6acd0b Amend 3b7a79f1: Use Debug::base_type instead of 'unsigned long long' where possible 2022-04-24 13:52:46 +02:00
Kornel Benko
3b7a79f137 FindAdv: Amend d09f5ce1: Added new debug level :findverbose
Fix the GUI handling for the new value using now 'unsigned long long' instead of 'int'
2022-04-24 13:27:36 +02:00
Juergen Spitzmueller
8917319924 Merge branch 'master' into features/indexmacros 2022-04-20 08:38:12 +02:00
Kornel Benko
d09f5ce1d0 FindAdv, Debug: Added new debug level :findverbose
With the debug-level 'find' there are now less output.
The original output can be received now with debig-level 'findverbose'

Also constructions like
 LYXERR(Debug::FIND|Debug::FINDVERBOSE, "...");
are now possible.
2022-04-19 13:41:38 +02:00
Juergen Spitzmueller
7d7b21ec3e Introduce InsetIndexMacros
This adds native macros for subindexes (!level), |see and |seealso
as well as native support for ranges |( |) and pagination format
-- e.g., |textbf -- via the index dialog

Resolves #12478, #7232 and #5014

The feature is complete (incl. tex2lyx) except for

* file format change and lyx2lyx
* docbook/xhtml
* documentation
2022-04-19 11:46:08 +02:00
Jean-Marc Lasgouttes
7cb700bf67 Fix crash with countExpanders in Qt6
It is not a good idea to contruct a QChar from a char_type that is
really 32bits.

Use lyx::isSpace, which already catters for this case.

Since this code does not depend on qt anymore, move it to
support::countExpanders.

Get rid of Row::countSeparators, which is not used anymore.

Fixes bug #12519.
2022-04-08 12:14:41 +02:00
Juergen Spitzmueller
b9ca608c2f Properly color red checkbox labels in validation (part of #12508) 2022-03-17 08:47:43 +01:00
Juergen Spitzmueller
a89ff030cf Amend 0f80de308c 2022-03-17 08:16:54 +01:00
Juergen Spitzmueller
0f80de308c 0 is a plausible intermediate length in positive context (#12508) 2022-03-17 08:15:09 +01:00
Juergen Spitzmueller
a88f67ac60 Fix signal (#12506) 2022-03-13 10:26:26 +01:00
Thibaut Cuvelier
997f0621c5 Rename LATEX debug level to OUTFILE and use it for DocBook, HTML, and XML messages. 2022-03-01 16:05:42 +01:00
Stephan Witt
6b0cd451fb #9287 query Standard User Defaults on mac and adjust cursor flash time accordingly 2022-02-20 13:06:54 +01:00
Daniel Ramöller
df59649a18 Properly show labels from broken references in Cross-references dialog
Fix for bug #12456.

The labels are transmitted from Buffer to GuiRef by reference of refs_
in the getLabelList function. Previously, only one string was
transmitted. But I needed both the formatted string, e.g. "x enu:test"
or "Missing: enu:test", as well as the plain label, e.g. "enu:test".
The former is for the list of labels to choose from in GuiRef and the
latter for the label as shown in the line edit that contains the plain
label in order to create a new reference from it. Transmitting both is
what the pair achieves.
2022-02-19 18:14:47 +01:00
Juergen Spitzmueller
8fa7e27e7e child documents: allow inheritance of bibliography file list (#4427) 2022-02-19 14:09:59 +01:00
Juergen Spitzmueller
2ab548b6f6 Fix tooltip and layout 2022-02-12 17:42:13 +01:00
Juergen Spitzmueller
1da80d4d8f Add basic support for \DeclareMetadata
File format change
2022-02-12 17:10:34 +01:00
Juergen Spitzmueller
027545a2e6 Whitespace 2022-02-12 15:10:14 +01:00
Stephan Witt
cd995a2bc6 Avoid static members zoom_min_ and zoom_max_
Some compilers cannot use static class members by reference. std::min() and std::max() are passing parameters by const reference.
2022-02-09 10:59:18 +01:00
Jean-Marc Lasgouttes
5259b6ba62 Set a maximum value to zoom level
The minimal vamue is set to 10%, let's set the max to 1000%. This
avoids crashes when characters are too large.

The code is refactored to be more compact and the tests are more precise.

Fixes bug #12452.
2022-02-08 19:42:17 +01:00
Daniel Ramoeller
122b452b20 Display manually set itemize symbols
Display manually set itemize symbols and their size in the work area.

Fix for bug #2277.

Also fixes a problem with document settings changed() not correctly emitted.
2022-02-06 17:58:50 +01:00
Jean-Marc Lasgouttes
b6010badfa Oops ! fixup 8c047143ef 2022-01-28 20:16:38 +01:00
Jean-Marc Lasgouttes
8c047143ef Code cleanup in GuiCompleter
processUpdateFlags does nothing if the update flags are None==0.
2022-01-28 19:49:53 +01:00
Jean-Marc Lasgouttes
f400a2cfa9 Force redraw after completion
Inside a math inset when completing macro names, it could lead to crashes.

Note that this processUpdateFlags is present when outside of this if() branch.
2022-01-28 17:13:30 +01:00
Jean-Marc Lasgouttes
ec3a44fef5 brkstr2str_pos: avoid case where length is negative
The string that Qt sees is not the original string, since we add
zero-width nonbreaking spaces around it, plus an override character to
force rendering direction. This means that translating positions
between these two representation can be a bit tricky.

We use a max(foo, 0) here to make sure that our intermediate
computation is postive.

Fixes part of bug #12452.
2022-01-23 19:34:11 +01:00
Jean-Marc Lasgouttes
c638caddd8 Compilation fix for Qt4 2022-01-13 19:35:12 +01:00
Jean-Marc Lasgouttes
854fbc5262 Revert "Add UI for selecting backing store drawing strategy"
The need for this variable is too rare to deserve being exposed in UI.

This reverts commit a3fd3a09f1.
2022-01-13 17:09:42 +01:00
Jean-Marc Lasgouttes
61d062633c Better handling of trailing spaces in rows.
When a string is broken at the margin by the Qt algorithm, the space
at which breaking occurred is automatically skipped in width
computation. However, the ending space of the string is taken into
account and is visible for example at paragraph end.

When the trailing space is followed by a displayed inset, then the
space should be skipped too, which means that the width of the last
row element has to be recomputed. For the sake of performance, the
width of the element without trailing spaces is computed in advance in
FontMetrics::breakString.

This "no space" width will be used when trimming a row element of its trailing
spaces instead of the original one.

Additionally, do not trim trailing spaces when the row is flushed.

Fixes bug #12449.
2022-01-13 16:49:59 +01:00
Stephan Witt
678ab325c0 #12423 fix a focus change problem
The search widget triggers a showEvent() in updateTitle() leading to setting the focus to the default push button.
The check in updateTitle() for the need to restore the title avoids superfluous show events and avoids the unwanted focus change.
2022-01-09 22:33:43 +01:00
Stephan Witt
22045e455a #12434 add GUI debug messages for pinch-to-zoom gesture 2022-01-09 12:29:23 +01:00
Daniel Ramoeller
7134ebd793 Pinch to zoom fix
Amendment to fix for #12434.
2022-01-09 12:29:23 +01:00
Stephan Witt
d9b9307d14 #12451 Adjust color cache on change of dark/light mode 2022-01-05 08:26:45 +01:00
Scott Kostyshak
13a7269b9d Change LFUN arg from "zoom" to "zoomlevel"
This change is just to be more specific, to help when grepping and
reading.

The idea is from Daniel
(https://www.lyx.org/trac/ticket/12420?replyto=11#comment:11).

Amends cc787967 (and thus 49a17aaa).
2022-01-03 15:57:35 -05:00
Stephan Witt
11d42ac3df Remove temporary code comment. 2022-01-03 10:44:02 +01:00
Stephan Witt
d432403430 #12434 add event handler for pinch-to-zoom gesture 2022-01-03 07:37:03 +01:00
Enrico Forestieri
d4cfa5204c Fix bug #12447
Due to a thinko at 1fe75ae7 the code was not using the correct index.
2022-01-02 18:49:44 +01:00
Stephan Witt
47c92834df Correct white space. 2022-01-01 16:37:07 +01:00
Stephan Witt
2125863874 Qt6 QFontDatabase is a pure static class. Call the member functions directly. 2022-01-01 10:06:07 +01:00
Juergen Spitzmueller
64a60c72ea GuiGraphics: disable "Read from file" button if the values do not differ 2021-12-31 14:32:59 +01:00
Juergen Spitzmueller
8f3fdafd9e GuiGraphics: check more carefully whether we have a changed BB 2021-12-31 14:32:13 +01:00
Juergen Spitzmueller
ec722f3a48 GuiGraphics: read the BB values also for new graphics
that aren't in the cache yet.
2021-12-31 14:30:09 +01:00
Stephan Witt
f22c5c3c3f Remove unused local variable 2021-12-29 15:33:44 +01:00
Juergen Spitzmueller
0f2d711f34 Fix TOC filtering with slashes (#12359)
Seems the * wildcard does not match these.
2021-12-29 14:43:52 +01:00
Scott Kostyshak
9ffca92930 Allow toggling of Zoom elements without buffer
The elements are shown without a buffer so it's nice to be able to
toggle without one as well.
2021-12-27 13:43:19 -05:00
Daniel Ramoeller
eae56b1194 Hide the zoom in the status bar from the status bar context menu
Fix for #12420.
2021-12-27 13:43:19 -05:00
Jean-Marc Lasgouttes
7ab3c59f00 Typo 2021-12-27 19:38:10 +01:00
Jean-Marc Lasgouttes
a3fd3a09f1 Add UI for selecting backing store drawing strategy
The checkbox is hidden when backing store is enforced (wayland,
macOS). In practice, only X11 and Windows users will see it ; I only
have evidence of X11 people needing it, I can hide it for Windows
users too if necessary.

Fixes bug #12119.
2021-12-17 15:16:35 +01:00
Jean-Marc Lasgouttes
c213eb7f75 Add lyxrc option to force the use of backing store
LyX relies on a a backing store to draw when running under macOS or
Wayland, because Qt arbitrarily overwrites parts of the workarea
before we paint (and we paint only the parts that need to be painted).
However it seems that this is also necessary on X11 when the WM theme
is translucid. Since there is no way that I know of to detect this
situation, this patch adds a LyXRC setting to manually select this
drawing strategy.

Note that using a backing store is not always a good solution, since
this disables subpixel aliasing.

At this point there is no UI for the variable.

Fixes bug #12119
2021-12-17 10:38:28 +01:00
Scott Kostyshak
056ab33f48 Amend bea7ef04e (find's auto-wrap by default)
The default in the .ui is not considered in
GuiSearchWidget::restoreSession(), which sets a hard-coded default
if the stored setting is not found in the session file.

I'll start an ML discussion for whether the code in restoreSession()
should use the ui's default if the setting is not found in the
session.
2021-12-15 20:51:50 -05:00
Stephan Witt
4665baac46 Fix an overloaded-virtual warning for type mismatch of event parameter (Qt6) 2021-12-09 21:59:23 +01:00
Stephan Witt
0e0b76a76e Restore correct version check for AA_UseHighDpiPixmaps - amend change ae56fb6171 2021-12-07 23:01:47 +01:00
Jean-Marc Lasgouttes
572b06d640 Increase metrics cache maximal size
Increase the maximal size of the breakString cache (to compute where
to break lines) from 512kB to 10MB. This has a big impact of cache
hits on large file like the example in #12297, which is now 99%. On
this example the time taken by breakString decreases from 33.5us to
2.4us.

The string width cache has been increased fro 512kB to 1MB, but this
does not make such a big difference.

Additionally, comments and variable names have been improved.

Related to bug #12297.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
d723b90344 Break multi-row strings in one pass
Replace FontMetrics::breakAt, which returned the next break point,
with FontMetrics::breakString, which returns a vector of break points.
To this end, an additional parameter gives the available width for
next rows.

Rename various variables and methods accordingly. Factor the code in
breakString_helper to be more manageable.

Adapt Row::Element::splitAt to return a bool on sucess and provide
remaining row elements in a vector. The width noted above has been
added as parameters.

Rename the helper function splitFrom to moveElements and rewrite the
code to be more efficient.

Remove type of row element INVALID, which is not needed anymore.

The code in TextMetrics::breakParagraph is now much simpler.

In Row::finalize, remove the code that computed inconditionnally the
current element size, and make sure that this width will be computed
in all code paths of Row::Element::splitAt.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
6e6976fbc5 Handle the case where breakAt cuts after trailing space
In this case, the extra element returned should empty but valid. The
row flag BreakAfter is set to indicate that we have a break there
(this principle will be used more generally in a forthcoming commit).

To detect that we cut at the trailing space, it is necessary to rely
on the difference between QTextLine::horizontalAdvance() and
QTextLine::naturalTextWidth() when the flag
QTextOption::IncludeTrailingSpaces is used: the trailing space is
taken into account in the later, but not in the former.

Somme comments have been added to make code intent clearer.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
6bc50fea3a Workaround for Qt 4
At least with Qt 4.8.7 on Ubuntu 16.04, QTextLine::lineWidth() can
return a bogus value, at least with Courier font. One hypothesis is
that the invisible characters that we use in breakAt_helper are given
a non-null width.

Work around it, although the exact bug has not been pinpointed.
2021-12-07 17:04:47 +01:00
Jean-Marc Lasgouttes
1831f6caac Change FontMetrics::breakAt to return a position
Since we intend to break the row element in two, it is not good to
truncate the string too early.

Moreover, the row element width is now set at this point, even if no
breaking occurs.
2021-12-07 17:04:46 +01:00
Stephan Witt
ae56fb6171 Qt6 pixmaps are always HiDPI - avoid deprecate warning for setAttribute 2021-12-07 10:02:05 +01:00
Juergen Spitzmueller
31146ae8d3 Prevent Outliner crash due to emptied toc value
This might need a more profound fix in the long term, see
https://marc.info/?l=lyx-devel&m=163588729224679&w=2
2021-12-04 17:53:03 +01:00
Daniel Ramoeller
e522c5444e InsertTableWidget support for dark mode and improved resizing
Fix for bug #12438.
2021-11-26 09:51:21 +01:00
Jean-Marc Lasgouttes
2311f42f41 Make primary-selection unknown when not supported
This lfun will not appear in menus anymore in macOS and Windows.

Part of bug #12436.
2021-11-22 10:30:43 +01:00
Juergen Spitzmueller
16ce82d4f9 Fix Bullets panel (#12429) 2021-11-12 16:40:46 +01:00
Juergen Spitzmueller
a90c5f202e Fix crash when closing LyX with open Search pane 2021-11-05 14:50:39 +01:00
Juergen Spitzmueller
1e711f902a Address Qt6 deprecation warnings 2021-11-03 17:41:41 +01:00
Juergen Spitzmueller
b60853ff0d Fix most stupid thinko of mine 2021-11-03 12:35:38 +01:00
Juergen Spitzmueller
de637cdbcb Amend 59b8c209c4
QFontMetrics::width() is no longer valid in Qt6
2021-11-02 16:28:40 +01:00
Daniel Ramoeller
59b8c209c4 Use labels for zoom slider buttons
Fix for bug #12301.

Also: fixes the width and alignment of the zoom value label.
2021-11-02 08:43:59 +01:00
Juergen Spitzmueller
bca1b63d89 Update toolbar and properly reset focus when find widget is closed (#12396) 2021-11-01 14:21:34 +01:00
Juergen Spitzmueller
455ff6fee7 More indentation correction 2021-11-01 14:15:05 +01:00
Juergen Spitzmueller
b9a9234cf6 Amend ce8b4e3a21 2021-11-01 13:08:16 +01:00
Juergen Spitzmueller
76ac4d8f8d Fix indentation 2021-11-01 13:02:05 +01:00
Juergen Spitzmueller
4888414f27 Attempt to fix #12226 for good 2021-11-01 08:30:41 +01:00
Juergen Spitzmueller
f3d5a95bb2 Redraw all work areas while zooming (#12334) 2021-10-31 13:43:27 +01:00
Juergen Spitzmueller
4c0caf9dd4 Polishing 2021-10-31 13:16:20 +01:00