Commit Graph

9229 Commits

Author SHA1 Message Date
Juergen Spitzmueller
6c2a0c6b37 Correct visual/logic cursor description 2019-07-23 07:36:53 +02:00
Jean-Marc Lasgouttes
2898c335be Add mechanism to change icons in RTL mode
When the cursor in RTL text, icons for "depth-increment" or
"layout-toggle Enumerate" look wrong.

To fix this, the lfun "bidi" is introduced. "bidi ltr func" behaves
like "func" in LTR text, but is unknown in RTL text. "bidi rtl" does
the opposite. This allows to add two icons, but only have one icon
available. When no document is available, only LTR is assumed.

To make this work, the handling of unknown functions in toolbar has
been changed so this these functions can change dynamically their
existence.

The icon themes `default', `oxygen' and `classic' have been updated
accordingly.

Fixes bug #4451.
2019-07-22 15:20:38 +02:00
Juergen Spitzmueller
24d72468c0 use validator rather than inputMask for line edit validation (part 2) 2019-07-22 11:31:56 +02:00
Juergen Spitzmueller
13df8f9a21 use validator rather than inputMask for line edit validation
inputMask gives an odd cursor, see #7204
2019-07-22 09:36:09 +02:00
Juergen Spitzmueller
b852df91bc Localize the default decimal separator
Do not blindly use (English) "." as default, but the locale default of
the current context language.

Fixes: #7204
2019-07-22 08:05:28 +02:00
Juergen Spitzmueller
3ca2b42389 Fix another tooltip 2019-07-21 16:43:41 +02:00
Juergen Spitzmueller
6fd2f7769f Hide custom_language_package if custom is not selected
Otherwise people might read it as if babel was automatically selected
2019-07-21 16:27:12 +02:00
Juergen Spitzmueller
6e7ef06dbc Further tooltips fix 2019-07-21 16:19:01 +02:00
Juergen Spitzmueller
ae9768da93 Fix tooltip 2019-07-21 14:41:23 +02:00
Juergen Spitzmueller
73146e757d Add tooltips
The function itself seems broken.
2019-07-21 14:37:14 +02:00
Juergen Spitzmueller
fb8ef40d12 Show language switch item in menu also in monolingual documents. 2019-07-21 11:49:33 +02:00
Juergen Spitzmueller
bbeee6bbef Improve prefs language UI 2019-07-21 11:37:54 +02:00
Kornel Benko
5c4c3b301a Amend c293be56: Cmake part of 'Rename frontend qt4 to qt' 2019-07-21 00:44:17 +02:00
Jean-Marc Lasgouttes
c293be56bd Rename frontend qt4 to qt
In particular, the directory frontends/qt4 is renamed to frontends/qt.

Many configurations file have to be updated. All mentions of qt4 in
the source have been audited, and changed to qt if necessary.

The only part that has not been updated is the CMake build system.
2019-07-20 23:39:40 +02:00
Jean-Marc Lasgouttes
c476c3766c Add a pref to disable OS keyboard language support
By default, the behavior is the same as before, except that the
language of new document is not unconditionally en_US anymore.

The new checkbox "Respect OS keyboard language" (off by default)
governs this behavior.

Update prefs format to 30.
2019-07-20 12:57:16 +02:00
Jean-Marc Lasgouttes
6f8298b165 Set language to OS input language when moving cursor
Instead of setting language from context when moving the cursor, set
it to the OS input language. This behavior will probably need to be
controlled by a preference, since not everybody changes keyboard
mapping when changing language.

This required to move BufferView::setCursorLanguage to
Cursor::setLanguageFromInput().
2019-07-19 11:52:03 +02:00
Jean-Marc Lasgouttes
049aed8e08 Respect OS-level keyboard language
This bug provides two features:

1/ when a new document is created the language is set to the current
  keyboard language.

2/ when keyboard is switched at OS level, the input language of
   current window is changed. The language is set preferably to one of
   those of the document. Ex. if the keyboard changes to en_GB but one
   is typing a document in US English and Hebrew, then US English will
   be selected rather that adding UK English to the list.

The implementation depends a lot on Qt. The platform status is :

* working on Windows 10

* not working with Linux (although 1/ works with Qt4); it seems that
  Qt5 supports switching through ibus, but I do not know what this
  means.

* not yet tested on macOS.

This addresses bugs #6450, #6247 and somehow #10514.
2019-07-17 23:23:13 +02:00
Jean-Marc Lasgouttes
732395ef1e Add support for amsmath's smallmatrix
This is a tight matrix in script size that is suitable for using inline.

Patch from our own Martin Vermeer and myself.
2019-07-15 13:38:07 +02:00
Jean-Marc Lasgouttes
e6b54ea4d2 Fix assertion in caret display code
It is not a good idea to call caretPosAndHeight when the caret is in a
paragraph that is not in cached metrics. This can happen when not
using "cursor follows scrollbar".

This commit refactor things a bit so that testing is done in
BufferView.

This bug is not in 2.3.x.
2019-07-14 23:27:44 +02:00
Juergen Spitzmueller
dc4a015fba Remove debug code 2019-07-14 12:04:53 +02:00
Juergen Spitzmueller
dcf06fdb22 Split osf options to families
Nowadays we support sf and tt fonts with osf options, so this needs to
be selectable separately.

File format change.
2019-07-14 11:41:36 +02:00
Jean-Marc Lasgouttes
575761c665 Use backing store also with wayland platform
Like with macOS, the Wayland compositor seems to require a
backingstore when doing partial updates like we do.

This extends the mechanism that has been introduced for macOS. This
has to be done at run time, not compile time.
2019-07-13 16:23:57 +02:00
Juergen Spitzmueller
0738ff08ba Consider CompleteFont with MoreOptions 2019-07-13 14:55:07 +02:00
Juergen Spitzmueller
c3c2815092 Implement support for font options
This revives a patch by Uwe and extends it. Additional options to font
packages/fontspec can now be entered in Document Settings.
This is principally also true for TeX fonts, if the new TeXFont tag
MoreOptions is set. For the time being, I have only done this for
MinionPro, as a model and prove of concept.

Note that adding more TeXFonts requires a file format change,
respectively, and changes to tex2lyx (in the same way as I've done for
MinionPro).

This addresses #8226
2019-07-11 20:28:34 +02:00
Juergen Spitzmueller
b6f0c1de3d Fix right and left layout alignment (in workarea) with RTL
Fixes: #11606
2019-07-10 14:50:08 +02:00
Juergen Spitzmueller
52fffee7f2 Preserve star on citation style change via menu
Fixes: #11439
2019-07-09 10:47:18 +02:00
Juergen Spitzmueller
13b6632228 Add TextClass option BibInToc
Fixes #1889
2019-07-08 15:40:17 +02:00
Jean-Marc Lasgouttes
455f10eae7 Revert "backing store"
This is not ready yet.

This reverts commit 1a2b1a3bfa.
2019-07-01 10:38:16 +02:00
Juergen Spitzmueller
cd5c406d9a More localization fixes 2019-06-26 12:25:53 +02:00
Juergen Spitzmueller
c703f76fe1 legacy > traditional 2019-06-26 11:14:59 +02:00
Juergen Spitzmueller
a62c4252ab Flag GUI strings for translation
Still room for improvement
2019-06-26 11:04:56 +02:00
Juergen Spitzmueller
0a8294d426 Improve encoding GUI string 2019-06-26 08:57:05 +02:00
Jean-Marc Lasgouttes
1a2b1a3bfa backing store 2019-06-25 12:39:32 +02:00
Juergen Spitzmueller
57788b8719 Fix tooltip 2019-06-22 08:35:14 +02:00
Günter Milde
71a57e0f4d Preserve \inputencoding value when switching to non-TeX fonts.
With non-TeX fonts, the \inputencoding setting is overridden
by "utf8-plain" (pass-through). Keeping the old value allows
switching back to TeX fonts without the need to (re)set
the input encoding.

Also change back the GUI name of the "auto-legacy" setting
(cf. #11115).
2019-06-21 12:40:41 +02:00
Jean-Marc Lasgouttes
938463b5d6 Fixup 3dc54d4a: fix string encoding issues with Qt4
The culprit here is the constructor QString(QByteArray const &): in
Qt4, it would interpret the byte array as latin1, and in Qt5 as utf8.

Therefore it is safer to use explicitly QString::fromUtf8 instead of
this constructor.

Several places where additionally simplified, in order to avoid some
extra conversions.
2019-06-20 11:27:15 +02:00
Jean-Marc Lasgouttes
3a7142d9bf Fix compilation with Qt4 2019-06-20 10:48:59 +02:00
Günter Milde
5fe6bc616c Fix order of Unicode encodings in Settings combobox.
Ensure the default encoding "utf8" comes always first,
followed by other common variants.
The encodings were sorted based on the GUI name which leads to
the default setting moving from the top position in some localizations.
2019-06-19 21:09:16 +02:00
Günter Milde
53500242f9 Harmonize input encoding selection widgets.
See #11115.
2019-06-18 15:43:34 +02:00
Jean-Marc Lasgouttes
5249eaaa60 Use <cstdint> instead of <boost/cstdint.hpp>
This is mandated by C++11.
2019-06-17 16:19:31 +02:00
Jean-Marc Lasgouttes
2b1515a936 Rename LM_ST_* to *_STYLE and FONT_SIZE_* to *_SIZE
This makes code more uniform. This is typically something that is done
at end of cycle to limit backport issues later.
2019-06-14 17:05:49 +02:00
Jean-Marc Lasgouttes
f12e796999 Revert "Rename LM_TC_* to FONT_STYLE_*"
Got it wrong, revert for now.

This reverts commit 67215833a1.
2019-06-14 17:05:00 +02:00
Jean-Marc Lasgouttes
67215833a1 Rename LM_TC_* to FONT_STYLE_*
This makes code more uniform. This is typically something that is done
at end of cycle to limit backport issues later.
2019-06-14 16:42:02 +02:00
Günter Milde
c627507b3f Revert 051de65db and implement alternative fix for remainder of #11115. 2019-06-12 11:48:47 +02:00
Richard Kimberly Heck
acd0f2fc78 Do not show both 'hide' and 'close' options on tabs for child buffers.
We can only close it (as opposed to hide it) if it's not a child.
Part of #11331.
2019-06-10 16:47:16 -04:00
Günter Milde
051de65db9 Fix remainder of #11115.
Implement GUI suggestions from
https://www.lyx.org/trac/ticket/11115#comment:26
2019-06-05 11:18:36 +02:00
Richard Kimberly Heck
0d54d3b762 Allow click on the 'spinner' to cancel export. 2019-05-27 23:21:07 -04:00
Günter Milde
c83765163f CJK package is never used with non-TeX fonts.
Prepare for languages that use CJK with TeX fonts and Polyglossia
with non-TeX fonts.

Korean is already supported by Polyglossia,
LyX support will follow (file version change).
2019-05-26 01:45:35 +02:00
Juergen Spitzmueller
1cafea7cf7 Read line edit label
Otherwise it is not clear what this means.
2019-05-24 17:51:42 +02:00
Juergen Spitzmueller
b6cb557c7d size tweak 2019-05-24 17:39:22 +02:00
Pavel Sanda
88f4718996 lineno: convert ui GB to CB per Juergen's request 2019-05-24 15:40:09 +02:00
Juergen Spitzmueller
03d9fe3a80 Some grammar and casing fixes and tooltip improvements 2019-05-24 10:59:00 +02:00
Pavel Sanda
7f125f62d2 Introduce doc preference for line numbering.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg208781.html
2019-05-23 15:13:27 +02:00
Pavel Sanda
e3707f1331 Resave NumberingUi.ui in qt5 designer 2019-05-23 15:11:39 +02:00
Richard Kimberly Heck
596b3c4522 Include all parent branches in the menu.
Previously, we only included branches from the master document. This
includes those from the parent, grandparent, etc, and does so in a way
that won't crash on recursive includes.
2019-05-22 22:00:31 -04:00
Richard Kimberly Heck
1842a11b3b Change how branches are displayed on the menus.
Show this document's branches first in the menu, and then show the
master document's branches on a sub-menu.
2019-05-22 21:41:22 -04:00
Richard Kimberly Heck
24fefaf23d Use ranges. 2019-05-22 21:41:22 -04:00
Richard Kimberly Heck
5fa493aa4a Re-organize and comment code a bit. 2019-05-22 20:58:00 -04:00
Juergen Spitzmueller
3da25187a9 Prevent assert due to some odd role in older qt versions. 2019-05-14 14:05:46 +02:00
Jean-Marc Lasgouttes
6df593049c Revert "Try to compute row height like it should be done"
This is not done right at all. The best is to revert for now and
think about how to do it properly.

This reverts commit 66a3d64346.
2019-05-13 10:47:47 +02:00
Richard Kimberly Heck
051a1a56a9 Revert "GMO for BG"
This reverts commit 5b84f11f80.
2019-05-12 23:30:49 -04:00
Richard Kimberly Heck
5b84f11f80 GMO for BG 2019-05-12 23:30:13 -04:00
Richard Kimberly Heck
15b90e4cc1 Rename for clarity. 2019-05-12 23:16:25 -04:00
Juergen Spitzmueller
682eabbe8e GuiDocument: Further encoding GUI improvement
Move the odd "(no inputenc)" option out of the encoding list.
2019-05-12 09:10:24 +02:00
Juergen Spitzmueller
e94239e973 Correct entry string 2019-05-11 19:04:36 +02:00
Juergen Spitzmueller
83a62a6d74 Further encoding GUI improvements 2019-05-11 12:16:52 +02:00
Juergen Spitzmueller
a6116428c0 GuiDocument: Adapt to new encoding default
Also simplify the code.
2019-05-11 11:28:21 +02:00
Jean-Marc Lasgouttes
c3f10df95d Move the stateText code for FontInfo to FontInfo class.
The first parameter of Font::stateText is now optional.
2019-05-10 10:45:40 +02:00
Günter Milde
337e3ff9a6 Fix Font selector GUI (font encoding) broken in 27ba6f282d. 2019-04-30 09:34:51 +02:00
Juergen Spitzmueller
e325c7cc6a GuiIdListModel: ignore DecorationRole (icons of available list) 2019-04-20 17:50:21 +02:00
Juergen Spitzmueller
b60259fbe1 Add system/local icon to available modules list
Also markup modules with missing requirements (like we do for layouts)
2019-04-20 09:28:46 +02:00
Juergen Spitzmueller
c0f734bcef Fix some listings/minted incompatibilities
The basic problem here is that rather than using an abstract syntax,
backend-specific param strings are produced in the listings dialog,
depending on whether listings or minted is used.

Of course this breaks if a user switches backends inbetween (s/he would
have to open and re-apply each and every listings inset!)

Do at least the most basic translations in InsetListings::latex().
A sane solution would imply the use of only one param syntax with
respective interpretation for each backend. But this would be a file
format change.
2019-04-19 19:03:29 +02:00
Juergen Spitzmueller
499167b2c5 Another quotation mark fix. 2019-04-19 14:27:27 +02:00
Juergen Spitzmueller
ac84510453 Fix quotation marks in GUI string. 2019-04-19 13:43:33 +02:00
Juergen Spitzmueller
2fa68abd00 Layout tweaking 2019-04-19 11:27:54 +02:00
Juergen Spitzmueller
7cadacb19b The Author(Year) label format is also mandatory for numeric natbib! 2019-04-19 09:53:42 +02:00
Juergen Spitzmueller
bebc184054 Display full author list with Natbib (non-BibTeX) if requested 2019-04-19 09:33:31 +02:00
Juergen Spitzmueller
8ecef0fcbc Available modules should not be editable. 2019-04-18 17:33:37 +02:00
Juergen Spitzmueller
8ee2ffaa52 Amend 3615a6a75b
Natbib provides separation of abbreviated and full author list also
beyond BibTeX
2019-04-18 16:27:22 +02:00
Juergen Spitzmueller
aec50eec49 Fix doxygen comment 2019-04-18 14:51:10 +02:00
Juergen Spitzmueller
3615a6a75b Make usage of natbib without BibTeX more obvious
Fixes: #5549
2019-04-18 14:48:01 +02:00
Juergen Spitzmueller
ed44bbddee Add MenuString to InsetLayout
Fixes: #8818
2019-04-18 10:27:19 +02:00
Günter Milde
27ba6f282d Rename legacy input encoding settings.
Format incremented to 573
2019-04-16 20:17:32 +02:00
Juergen Spitzmueller
7ec81c651e Listings: language updates
Patch by Sergei Winitzki
2019-04-15 11:55:46 +02:00
Jean-Marc Lasgouttes
f9da28428a Fix bold-like characters when selecting bidi text
In painter, restrting paining regions does not really work when region is empty.

Fixes bug #11198.
2019-04-09 11:32:22 +02:00
Juergen Spitzmueller
dfde45a01a Do not attempt to show module info for category headers 2019-04-07 13:57:41 +02:00
Juergen Spitzmueller
823263904f GuiDocument: Sort available modules by category
Also improve display of module information
2019-04-07 11:23:19 +02:00
Juergen Spitzmueller
6fef1cec1f Fix crash in GuiBibtex 2019-04-05 17:53:41 +02:00
Juergen Spitzmueller
38fbbf07cd GuiDocument: Add filter to modules selection
Sorting by category is needs more work, since the GuiIdListModel is
not suitable for trees.
2019-04-05 11:54:44 +02:00
Juergen Spitzmueller
fa79ff2db2 Resolve some implicit conversion warnings. 2019-04-05 11:54:44 +02:00
Juergen Spitzmueller
b5af05b4a7 Make module categories (almost) great again
The category tag was rarely used and thus not very useful. This adds
categorization to most modules (the rest will follow) and uses the
\DeclareCategory tag we use in layouts rather than the extra syntax
we used in modules. Categories are now added to the po files and
translated.

Note that this is work in progress: the current categories are still
subject to change.

The ultimate goal of this is to sort the modules in the GUI by category
as we do with layouts, examples and templates (and add a filter to search
for specific modules)

As it is now (with the many modules we accumulated), the module selector
is not really usable anymore. If you don't happen to know how exactly a
module is named, selecting a module is really a PITA.
2019-04-04 18:43:29 +02:00
Juergen Spitzmueller
2709c5fb58 Initialize TabularCreate dialog enabled.
As pointed out in #10105.
2019-04-04 08:23:27 +02:00
Juergen Spitzmueller
f60bda37a6 booktabs trimming: fix some thinkos 2019-04-03 17:18:21 +02:00
Juergen Spitzmueller
8085fc21f8 booktabs: support for \cmidrule trimming
This has probably still some rough edges, so please test thoroughly.

Fixes: #3072
2019-04-03 07:59:52 +02:00
Juergen Spitzmueller
9d384c3c12 Fix tooltip.
Thanks, Kornel.
2019-04-01 11:28:54 +02:00
Juergen Spitzmueller
00de6c4be7 Fix left/right border UI when toggling formal
Fixes: #9835
2019-04-01 09:26:09 +02:00
Juergen Spitzmueller
b0f9d98d6e Remove Qt 5.12-only colorrole
Designer inserts those automatically. So we have again backwards-incompatible
designer behavior :-(
2019-04-01 09:18:16 +02:00
Juergen Spitzmueller
3bbcfda3db Add option to reset to default booktabs lines
Addresses: #10106
2019-04-01 07:08:13 +02:00
Juergen Spitzmueller
c12190b5e5 GuiBibtex: add button to edit individual databases externally
This complements the inset context menu function, which only allows for
editing all databases externally
2019-03-30 11:37:28 +01:00
Juergen Spitzmueller
02974ff2a9 GuiSelectionManager: properly handle de-selecting items
When an item is de-selected with the mouse, and thus no item selected
anymore, disable add, up, down and delete buttons.
2019-03-30 11:36:47 +01:00
Juergen Spitzmueller
4d54d3afca Fix some implicit conversion issues. 2019-03-30 09:33:09 +01:00
Juergen Spitzmueller
f75b081551 Add support for mixed-encoded biblatex files
Biblatex 3.12 allows to specifiy individual encodings per bib file
via \addbibresource[bibencoding=<encoding>].

This is now supported via GuiBibtex.
2019-03-29 15:45:55 +01:00
Juergen Spitzmueller
0042fb34d0 Fix some group boxes. 2019-03-29 13:01:47 +01:00
Juergen Spitzmueller
ecb2427f41 Add tablestyle buffer param
Fixes: #9901
2019-03-26 16:24:27 +01:00
Juergen Spitzmueller
683b3a05e2 Introducing table templates
The idea is simple: we insert a pre-formatted table (with a given border
style currently, but other attributes are possible as well) via file-insert
and scale it then to the requested size.

We need three sizes (1x1, 1x2 and 1x3) to generate all sizes properly (due
to border specifications).

Currently, these styles can only be accessed via lfun tabular-style-insert
and the Tabular Create dialog.

My plan is to add a buffer param to set a default style (#9901) which then
also is respected by the toolbar button and probably a layout tag to let
classes specify a default style (#8360).
2019-03-26 13:43:33 +01:00
Juergen Spitzmueller
2ed3b22a06 Add ignorelang option to file-insert
This is useful for inserted files with no real text content
2019-03-26 10:13:33 +01:00
Juergen Spitzmueller
6852e35b1d GuiLyXFiles: handle defaults.lyx 2019-03-23 17:41:42 +01:00
Juergen Spitzmueller
3dc54d4aac Display URL-encoded chars decoded in display path 2019-03-23 15:15:08 +01:00
Juergen Spitzmueller
b8842a1584 Add l10n mark 2019-03-23 12:45:28 +01:00
Juergen Spitzmueller
c02ed04127 Save as Template: Also consider document language
Attempt to save the template in the appropriate language subfolder of
the user template directory (and propose to create it if it doesn't exist
yet).

That way, user-generated templates (1.) get the correct language attribution
in the lyxfiles dialog and (2.) users can easily generate different
language versions of a template.
2019-03-23 11:00:13 +01:00
Juergen Spitzmueller
ebc4092649 Add LFUN_BUFFER_WRITE_AS_TEMPLATE
Convenience function to easier save a file as template in the appropriate
templates folder.
2019-03-23 10:17:33 +01:00
Pavel Sanda
066a164ba6 Forgotten accelerators. 2019-03-22 22:14:21 +01:00
Jean-Marc Lasgouttes
b79a694c56 Compilation fix 2019-03-22 14:56:33 +01:00
Juergen Spitzmueller
6efdd1c399 Cosmetics 2019-03-22 14:18:17 +01:00
Juergen Spitzmueller
58c4c11c4c Use GuiLyXFiles also for ui, kbd and bind files in prefs 2019-03-22 14:14:33 +01:00
Juergen Spitzmueller
9a2c5b515a Disable language combo if there is nothing to select 2019-03-22 14:14:33 +01:00
Juergen Spitzmueller
b7f6c16a48 Fix duplicate language entry 2019-03-22 14:14:32 +01:00
Juergen Spitzmueller
55012674c8 Add forgotten replacement 2019-03-22 11:25:20 +01:00
Juergen Spitzmueller
ca024383e0 Fix problematic characters in example/template file names
For (, ) and & we use URL encoding now.
2019-03-22 11:10:49 +01:00
Juergen Spitzmueller
9a473a4954 Fix header case 2019-03-21 19:31:46 +01:00
Juergen Spitzmueller
7403fd2f88 Replace Type combo, which was considered irritating, with a Type filter
The new one allows to display only user or system files.
2019-03-21 19:25:10 +01:00
Jean-Marc Lasgouttes
e170051909 typo 2019-03-21 18:45:46 +01:00
Juergen Spitzmueller
4b2cce9e0f Consider files only in lang subtrees 2019-03-21 14:39:33 +01:00
Juergen Spitzmueller
cd9f52da89 GuiLyXFiles: fix icons and tooltips 2019-03-21 14:18:03 +01:00
Juergen Spitzmueller
7f39be8664 GuiLyXFiles: prefill language combo 2019-03-21 13:40:11 +01:00
Jean-Marc Lasgouttes
5d30f790dd Compilation fix
For some reason I need this (maybe a Qt4/5 discrepancy).
2019-03-21 10:28:16 +01:00
Juergen Spitzmueller
7be8307768 GuiLyXFiles: rework language selector
Now only the languages available for the selected file are displayed.
By default, LyX pre-selects the GUI language (and falls back to English
if this is not available). Once another language has been selected by
the user, this one is preferred before the GUI language (and the English
fallback).
2019-03-21 09:13:09 +01:00
Juergen Spitzmueller
ca67b8aa2c GuiLyXFiles: add icons that indicate whether a file is from user or system 2019-03-20 18:38:07 +01:00
Juergen Spitzmueller
1222ce3bfe Add Qt-internal string for translation 2019-03-20 18:37:34 +01:00
Juergen Spitzmueller
f3ee82fb87 Do not close LyXFiles dialog on double-clicking header 2019-03-20 12:37:55 +01:00
Juergen Spitzmueller
07e20fbb2f Amend 0c8eea0fe5 2019-03-20 12:36:39 +01:00
Jean-Marc Lasgouttes
0c8eea0fe5 Compilation fix for Qt < 5.2. 2019-03-20 11:45:29 +01:00
Jean-Marc Lasgouttes
d3979e798c Cache the value of GuiFontMetrics::lbearing().
This seems to be necessary on windows, where math editing can get very
slow. Note that other methods like rbearing already use a cache.

In the future all these caches for single characters shall be unified.
2019-03-20 11:14:43 +01:00
Juergen Spitzmueller
b52cb87e9a GuiLyXFiles: add language selector. 2019-03-19 17:55:19 +01:00
Juergen Spitzmueller
52d2ba16ed GuiLyXFiles: A bit more work towards generalization
Bind and Ui files can be displayed in this dialog now (via lfun
dialog-show lyxfiles ui|bind), although it is not yet usable in prefs.
2019-03-19 17:00:01 +01:00
Juergen Spitzmueller
adbe5121fe cosmetics 2019-03-19 13:36:05 +01:00
Juergen Spitzmueller
e141781aad GuiLyXFiles: minor generalization 2019-03-19 13:29:32 +01:00
Juergen Spitzmueller
7271325ba7 Fix strings 2019-03-19 07:42:11 +01:00
Juergen Spitzmueller
9faae1284b Add new dialog for templates and examples
This lists all respective files from user, build and system directory
in a structured way and thus allows for easier access to them.

Fixes: #2396, #6861
2019-03-19 06:59:24 +01:00
Günter Milde
406b1e7fcf Small formatting and comments update. 2019-03-16 12:59:34 +01:00
Kornel Benko
7ac04a2b75 Fix #11505. Count and display number of replaced strings in FindAdv 2019-03-13 14:06:18 +01:00
Juergen Spitzmueller
55c9bc218a Do not use GUI language for shortcut info inset if no translation is available
Fixes: #11508

Now there is the opposite case which needs to be addressed:
If no translation is available for a shortcut in a non-latin-scripted
document, we need to switch the language to English.
2019-03-09 12:00:40 +01:00
Jean-Marc Lasgouttes
954531f247 Update screen as needed when preferences are changed
This commit removes the adhoc code in GuiPrefs and moves it to LyXRC,
so that it triggers in every preference change.

The code has also been updated to trigger on more variables, e.g.
font_*_foundry.

Note that the actual function that are called have not been changed
(addPreviews and LFUN_SCREEN_FONT_UPDATE), although there are doubts
that they behave as needed (see FIXMEs).

Fixes bug #11498.
2019-02-26 16:53:14 +01:00
Jean-Marc Lasgouttes
91fc45ed35 Do not use trailing underscore for local variable 2019-02-18 16:04:15 +01:00
Jean-Marc Lasgouttes
66a3d64346 Try to compute row height like it should be done
Currently, our computation of row height is not completely standard:
* we ignore completely the QFontMetrics::leading() parameter

* we add arbitrarily 2 hardcoded pixels to the height.

This patch reverses these two choices, which leads to
* slightly larger spacing for MinionPro (which has a big leading).

* an additional spacing of 20% font height that depends on dpi and zoom.

Visual inspection with LibreOffice seems to imply that it disregards
the font leading but uses a interline which is 20% larger than the
font height.
2019-01-16 11:04:53 +01:00
Richard Kimberly Heck
6848dbfd2b Remove empty file discovered by Kornel.
Looks like an accidental commit.

> git log GuiGraphicsUi.h
commit a1cec91afa
Author: André Pönitz <poenitz@gmx.net>
Date:   Fri Aug 31 05:53:55 2007 +0000

    move our stuff off the Q* namespace

    git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19935 a592a061-630c-0410-9148-cb99ea01b6c8

That's all a rename, basically. The original file, QGraphicsUi.h, was commited at 12e5a52b92, and it was empty then, too.
2019-01-10 13:23:33 -05:00
Richard Kimberly Heck
c4fdab6993 Use combo box data rather than looking up info from InsetRef. 2019-01-06 17:46:40 -05:00
Richard Kimberly Heck
b35d90014e Add comment. 2019-01-06 13:02:40 -05:00
Richard Kimberly Heck
b91e2b9998 Remove debugging code. 2019-01-06 13:00:21 -05:00
Richard Kimberly Heck
9b3f9cc687 Fix problem caused by re-ordering of menu at 5f6332bf4.
This broke the activation and de-activation of plural, capitalize,
etc. I guess that tells us how much those get used....
2019-01-06 12:52:44 -05:00
Jean-Marc Lasgouttes
d8498d4785 Fix vertical offset of fonts like MinionPro
For some reason, adding a LTR/RTL Override unicode character before a
MinionPro string increases the ascent of the line.

This creates vertical offset issues when painting if the ascent used
as reference is the one of the font. Use the QTextLine ascent instead
for better results.

This is a followup to 1bed76e2a.

Fixes (reopened) ticket #11284.
2019-01-03 12:19:47 +01:00
Jean-Marc Lasgouttes
c8f4b68423 Add override statements to please clang
Eventually, all overridden virtual methods should be marked properly.
Currently, clang only warns about those in classes that already use
override in at least one place (which was the case dor GuiApplication).
2019-01-02 18:49:23 +01:00
Jean-Marc Lasgouttes
fba9f5b9e8 Remove premature (and bad) optimization
When blinking the caret, it looks like a cool idea to only update the
small rectangle containing the caret. Actually it is an awful idea, since
the paint event will paint some rows, and these rows will not be
properly painted outside of the small rectangle. Unfortunately, the
painter will skip those "painted" rows on next paint events.

This leads to painting errors that depend on the ordering of "real"
and "caret" paint events. This is the reason why they only appeared
with split screens.

Quote of the day: ``The real problem is that programmers have spent far
too much time worrying about efficiency in the wrong places and at the
wrong times; premature optimization is the root of all evil (or at
least most of it) in programming.''
-- Donald Knuth, The Art of Computer Programming.

Fixes bug #11354.
2019-01-02 18:36:02 +01:00
Juergen Spitzmueller
8f332f4429 Fix Include dialog UI
#11443
2019-01-02 09:19:45 +01:00
Pavel Sanda
33284ee5c8 Completion popup menu did not respond to Esc.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207346.html
2018-12-29 14:36:38 +01:00
Juergen Spitzmueller
a67c541d6b Fixup LocalLayout ui after [3847e0ef/lyxgit] 2018-12-29 11:47:37 +01:00
Richard Kimberly Heck
ac3693c04f Fix bug #11422.
We need to load the master document before applying the params, since
otherwise the TOC reset (and other things) happen before the master
has been loaded (and set as parent).
2018-12-29 00:23:26 -05:00
Juergen Spitzmueller
254affa0b9 Fix regression introduced in a65f1e54dc 2018-12-28 17:25:53 +01:00
Juergen Spitzmueller
a65f1e54dc Properly set up paste and textstyle-apply MenuButtons when no buffer is open. 2018-12-28 14:34:14 +01:00
Juergen Spitzmueller
4d010d97fa style 2018-12-28 12:44:55 +01:00
Juergen Spitzmueller
d50e02d07c Always set main Icon Button to the QMenuButton 2018-12-28 12:41:19 +01:00
Juergen Spitzmueller
e704cc6e82 Add "Reset to Default" item to textstyle-apply button menu
Fixes: #5922.
2018-12-27 14:16:38 +01:00
Juergen Spitzmueller
c57d04908f No need for an extra icon 2018-12-27 11:18:13 +01:00
Juergen Spitzmueller
eb1b88aba7 Use more convenient MenuButtonPopup 2018-12-27 11:09:52 +01:00
Juergen Spitzmueller
01872b4dd5 Remove unused variable 2018-12-27 08:51:17 +01:00
Juergen Spitzmueller
9495ff665d Make "paste recent" accessible from toolbar
via button menu
2018-12-26 17:11:24 +01:00
Juergen Spitzmueller
154b4fdece Give textstyle-apply a history
The last 20 applications are saved now and accessible both via the lfun
(textstyle-apply n) and the toolbar (via button menu)

Fixes: #7133

This also changes the default icon and toolbar position of the action,
as requested in #11427
2018-12-26 15:46:14 +01:00
Juergen Spitzmueller
0492239be0 Fix qt4 build 2018-12-25 18:35:52 +01:00
Juergen Spitzmueller
7610179bc7 More alignment fixes 2018-12-25 18:20:02 +01:00
Juergen Spitzmueller
47ecd75d7f Unify group box style across dialogs. 2018-12-25 17:02:18 +01:00
Juergen Spitzmueller
7674a83ce9 Prefs dialog: some layout fixes. 2018-12-24 18:38:23 +01:00
Juergen Spitzmueller
e52bd7bb00 Advanced F&R layout fixed
Patch by Daniel Ramöller (racoon)
2018-12-24 17:02:11 +01:00
Juergen Spitzmueller
5258cee93e Fix height of paragraph dialog
Patch by Daniel Ramöller (racoon)
2018-12-24 16:48:22 +01:00
Juergen Spitzmueller
fa5703196f Fix Text Properties dialog height
Patch by Daniel Ramöller (racoon)
2018-12-24 16:18:54 +01:00
Juergen Spitzmueller
9ee4a914da Tabular Create layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 16:13:29 +01:00
Juergen Spitzmueller
499871d141 Messages panes layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 16:08:39 +01:00
Juergen Spitzmueller
30d527895e Layout fixes for compare dialog
Based on a patch by racoon.
2018-12-24 16:00:43 +01:00
Juergen Spitzmueller
4c7b3fc109 Theasurus dialog layout fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 15:24:03 +01:00
Juergen Spitzmueller
5936edfe24 Spellchecker dialog alignment fixes
Patch by Daniel Ramöller (racoon)
2018-12-24 15:16:28 +01:00
Juergen Spitzmueller
d2527038a3 Polishment of the simple Search dialog
Based on a patch by racoon.
2018-12-24 14:47:48 +01:00
Juergen Spitzmueller
4d51206585 When cancelling saving of a children, cancel the whole process.
Fixes remainder of #11405
2018-12-24 13:02:41 +01:00
Juergen Spitzmueller
4f67cf2344 Fix prefs color layout
the list widget is too narrow with some localizations.
2018-12-23 12:08:54 +01:00
Juergen Spitzmueller
81e4f8dfb6 Allow to restore default UI colors in prefs
Patch by Daniel Ramöller (racoon), with slight modifications of mine.

Fixes: #10062
2018-12-22 18:44:58 +01:00
Juergen Spitzmueller
7c31bfa423 Compile fix for Qt < 5.7
Only after that version, the QAction argument is optional.
2018-12-21 13:37:07 +01:00
Juergen Spitzmueller
4ea64ca89a GuiThesaurus: maintain default state of Replace button
Rest of #11417
2018-12-21 12:56:02 +01:00
Juergen Spitzmueller
ac8aac5b36 GuiCharacter: Add menu to Restore button
and allow for resetting all widgets to "No Change" besides "Default"
2018-12-21 12:31:25 +01:00
Juergen Spitzmueller
e6b562d027 Rename ambiguous enum 2018-12-21 12:14:11 +01:00
Juergen Spitzmueller
7fae26c9a7 Handle GuiParagraph for OK default button issue as well 2018-12-20 15:12:53 +01:00
Juergen Spitzmueller
44a0748ba3 Add forgotten initialization 2018-12-20 13:46:41 +01:00
Juergen Spitzmueller
e087722900 Maintain default status for all dialogs using ButtonController
Should fix rest of #11417
2018-12-20 12:56:30 +01:00
Juergen Spitzmueller
33344c6015 Also check for dirty children on QUIT
Fixes rest of #11405
2018-12-20 11:37:19 +01:00
Pavel Sanda
99bfe20120 Properly clean cache which binds inset and dialog.
We fill up edited insets into cache when editing inset is triggered, but
this cache is never cleared up for dialogs unassociated with some inset
- thus when e.g. graphics dialog is open for completely new image the
old cache is (wrongly) used.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg207192.html
2018-12-19 21:31:26 +01:00
Juergen Spitzmueller
af5909beac Maintain default status for InsetParams dialogs
Part of #11417
2018-12-19 11:39:04 +01:00
Juergen Spitzmueller
6dce63496d Maintain default status for ref dialog
Part of #11417
2018-12-19 11:09:32 +01:00
Juergen Spitzmueller
6d4a63d86b Add Qt-internal GUI string 2018-12-17 13:39:45 +01:00
Juergen Spitzmueller
5f03889609 GuiCharacter: Add "Reset" and "Restore Defaults" buttons
Addresses #11415
2018-12-17 12:59:40 +01:00
Juergen Spitzmueller
1b6ce0e827 GuiCharacter: INHERIT is OFF for the tristate buttons. 2018-12-17 10:38:05 +01:00
Juergen Spitzmueller
bf2bf2eaed GuiCharacter: Consider default settings for underline, strikeout and language 2018-12-17 10:12:02 +01:00
Juergen Spitzmueller
f87218bbb5 Check for hidden dirty child on close
Fixes: #11405
2018-12-17 09:11:34 +01:00
Juergen Spitzmueller
ab5c08b3f0 Amend 9705b88251 2018-12-17 09:03:46 +01:00
Juergen Spitzmueller
9705b88251 Use current_font, not real_current_font, in character dialog
The latter has the workarea font settings, which are not of interest
here.

Fixes: #11385
2018-12-16 12:29:15 +01:00
Jean-Marc Lasgouttes
57feb0fed0 Fix undo after breaking a nested paragraph
We have to take into account that Buffer::updateBuffer can modify the document.

Fix bug #11292.
2018-11-23 16:53:53 +01:00
Enrico Forestieri
7822d11361 Fix reloading of local layout file (bug #11120) 2018-11-16 21:47:24 +01:00
Jean-Marc Lasgouttes
7db99672e6 Avoid extra space in tooltips
When using QTextDocument to check the natutal size of a text, one has
to remove the text margin, which is not useful here.

Fixes bug #11353.
2018-11-04 14:02:42 -10:00
Jean-Marc Lasgouttes
1bed76e2a1 Fix selection of unmarked RtL text
With Qt 5.11 at least, RtL text will be drawn RtL even when the
(undocumented) flag Qt::TextForceLeftToRight is applied to the
QTextLayout object. This creates selection issues for Hebrew text
marked as English.

The solution is to do the same as in breakAt_helper, that is prepend
the string with a direction override unicode character.

Doing this requires to introduce a TEXTLAYOUT_OFFSET constant that has
to be used wisely to account for this extra character.

Fixes bug #11284.
2018-11-04 08:23:49 +00:00
Juergen Spitzmueller
b8932afed5 Dispay pre- and posttext widgets if non-empty also if unapplied
Fixes: #11352
2018-10-30 17:23:08 +01:00
Scott Kostyshak
73b1c658a2 Use underline in (+ bold) for char match in layout
When showing the match characters in, e.g., the layout box, we now
underline (in addition to bold) the matched characters. This makes
the matched characters stand out even more.

See 4b716dd6 and the following ML thread:

  https://www.mail-archive.com/search?l=mid&q=20181019155649.dqqk6u25wdcdimrj%40barna
2018-10-22 21:16:56 -04:00
Richard Kimberly Heck
4b716dd63d Use bold instead of underlining to mark the characters we're matching. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
1410eeb10e Simplify the code that adds underlining to the layout combo. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
1cc859d713 Refactor 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
35fac4ab51 Re-organize and simplify now. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
ae65fb2c98 Whitespace. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
d7f4346a19 Fix bug #6096.
We used to need a hack to set the size of the layout combo, but
the code was changed in Qt 4.5 or so. Hence the appearance of this
bug in 2009. We can now just remove this hack, and all seems to
work correctly.
2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
938ef60258 Filter on consecutive sequences of characters.
The filters for the layout combo and document class combo share a
problem: If you type "beam", e.g, in the latter case, then we will
show any document class that contains those letters, in that order,
but not necessarily consecutively. This is extremely confusing and,
as José put it, just weird. So let's fix it.

I'd call this a bug so would be happy to see this in stable, too.
2018-10-18 21:49:31 -04:00
Jean-Marc Lasgouttes
17e2ad927e Followup to 9fe101e8: remove unused method. 2018-10-08 16:04:32 +02:00
Jean-Marc Lasgouttes
9fe101e890 Remove support for pixmap cache
This code has issues and there is no evidence that it improves performance.

Remove LyXRC variable \use_pixmap_cache and update rc format to 29.

Now the global pixmap cache is only used by GuiCompleter. Therefore
there is no need to reset it when fonts change.
2018-10-07 14:56:55 +02:00
Richard Kimberly Heck
4f0ccae399 Fix bug #9004.
I'm not entirely happy with this way of doing it. It seems messy.
But there is not another clear option right now.
2018-10-04 20:37:03 -04:00
Richard Kimberly Heck
944b0ae55d Update the Advanced F&R document class when switching buffers. 2018-10-04 20:30:01 -04:00
Richard Kimberly Heck
5064c09e9f Copy modules into the Advanced F&R pane as well. 2018-10-04 20:30:01 -04:00
Guillaume Munch
1979496399 Make tab movement visible (#10733)
The nice hand-made solution for moving tabs has made its time. Use Qt's feature
instead from now on.
2018-10-04 19:52:21 -04:00
Richard Heck
5f6332bf46 Fix bug 9798.
Nameref support for math references.
2018-10-04 14:04:48 -04:00
Richard Kimberly Heck
2553b0073f Fix bug #11275.
Show module name with description.
2018-10-04 14:02:01 -04:00
Jean-Marc Lasgouttes
2617a4dd50 Fixup 38f09c177b: limit to paint rectangle 2018-10-04 14:27:43 +02:00
Jean-Marc Lasgouttes
38f09c177b When ignoring an update, request one for later
If we were not ready to paint the screen, this does not mean that we
should give up on repainting, just potpone it.

I thought that it was bad to call update() in the paint event, but I
cannot find reference to this anymore and everything seems to work as
intended.
2018-10-03 15:57:11 +02:00
Juergen Spitzmueller
f973855bde Amend cab46ff9d1 2018-09-29 10:29:02 +02:00
Juergen Spitzmueller
cab46ff9d1 GuiCitation: Add some tooltips for the sake of keyboard users
Addresses #11317
2018-09-29 09:18:26 +02:00
Juergen Spitzmueller
90b1345203 Do not store empty posttext for qualified citations
Fixes: #11308
2018-09-25 13:13:56 +02:00
Juergen Spitzmueller
33d6499bbc GuiCitation: don't reset filter on show
Addresses #11291
2018-09-22 10:37:22 +02:00
Jean-Marc Lasgouttes
2cfbc5ecf6 Ignore horizontal wheel scrolling in workarea
We do not know what to do with horizontal scrolling events, so we ignore them.

Note that the code has to be different between Qt4 and Qt5.

Fixes bug #11257.
2018-09-20 23:25:42 +02:00
Jean-Marc Lasgouttes
819cf53c22 Handle branches with space in their name
1/ Handle space in color name in set-color (with quoting)

2/ read properly branch inset when name has a space

Fixes bug #11108.
2018-09-08 13:07:07 +02:00
Jean-Marc Lasgouttes
dd8fd3d90a Get rid of monolithic build support for autoconf
It is not useful anymore on modern machines with several cores.
2018-08-30 11:35:37 +02:00
Juergen Spitzmueller
ed61ce74b7 So long, date-insert!
This function is superseded by info-insert date, which is much mightier
and more flexible.
2018-08-20 09:25:22 +02:00
Juergen Spitzmueller
e9b187af08 New info-inset type l7n
This returns a localized version of a string (in the GUI language)
if available, removing trailing colons and accelerator marks.

This can be used to refer to dialog items in the docs in a portable way.
2018-08-13 17:18:44 +02:00
Juergen Spitzmueller
c12fe77c94 Remove inclusion of obsolete header 2018-08-12 08:29:16 +02:00
Juergen Spitzmueller
07d760ef30 Rework BibTeX dialog
Fixes concerns reported in #11239
2018-08-11 12:17:42 +02:00
Juergen Spitzmueller
7c5d243e71 Revert that part
We don't want to lose the shortcuts.
2018-08-08 15:14:26 +02:00
Juergen Spitzmueller
91a5263d68 Extend list of accessible menu info
When searching for and item in the menu, also try to consider those that
require a BufferView (such as View/Update formats).

Also, be explicit for the default format in order to find it.

Fixes: #9851
2018-08-08 15:05:58 +02:00
Juergen Spitzmueller
d1fbbb78a8 Disable Immediate Apply if no inset is modified. 2018-08-08 10:34:57 +02:00
Juergen Spitzmueller
44718e0e8c GuiInfo: Show "Unknown" only if issued from an unknown info. 2018-08-08 09:52:03 +02:00
Richard Kimberly Heck
2896441dbb Update buffer after preferences change.
Fixes missing update after new InsetInfo stuff.
2018-08-07 23:38:55 -04:00
Juergen Spitzmueller
2315bdad41 Fix small UI glitch 2018-08-07 14:48:51 +02:00
Juergen Spitzmueller
2cd7aab7cf Validate (fix) date vs. time specifier 2018-08-07 12:56:43 +02:00
Juergen Spitzmueller
37279f6681 Typos 2018-08-07 12:41:00 +02:00
Juergen Spitzmueller
7efdf98fc8 Further extend Info insets:
* Add time type (time, modtime, fixtime)
* Add "name-noext" buffer type (file name w/o extension)
2018-08-07 12:14:45 +02:00
Juergen Spitzmueller
307319e95e Introduce InsetInfoParams
This allows to open the dialog without having an inset already.
2018-08-06 20:07:15 +02:00
Juergen Spitzmueller
b75f716b73 Capitalization fixes
Fixes: #11237
2018-08-05 10:11:38 +02:00
Juergen Spitzmueller
e730234e57 Add date-related info insets
With this commit, info insets leave the dark backstage room of an opaque
and quite hidden dev-only feature and come frontstage.

In the UI, they present themselves as "Fields" since this is what people
know from word processors. Other user-related fields that could be
implemented next: time, user name (I plan to do that for 2.4).

Since this supersedes date-insert, I removed Insert > Date from
the menu and propose to ditch date-insert and the corresponding rc.

The lyx2lyx reversion routine has lots of room for improvement and
attractive tasks for pythons (file timestamp, switch of localization).
Please feel invited!

This is a file format change.
2018-08-05 10:01:36 +02:00
Juergen Spitzmueller
b286c6d235 Change size policy of buffer combo in refs dialog
Fixes: #9316
2018-08-02 09:08:11 +02:00
Juergen Spitzmueller
87a7f728ca reorder entries 2018-08-01 16:51:38 +02:00
Juergen Spitzmueller
8d45179403 More GuiInfo usability work 2018-08-01 09:28:03 +02:00