Commit Graph

4915 Commits

Author SHA1 Message Date
Stephan Witt
da548dbe30 #1720 disable document buffer related LFUNs in GUI view if the work area has no focus 2015-05-08 19:09:00 +02:00
Juergen Spitzmueller
4ba17c90a0 Do not insert non-rpintable characters (such as ASCII control characters)
Fixes: #5704.
2015-05-05 14:23:24 +02:00
Enrico Forestieri
6e6abe1edd Fix #5760 also on Windows.
The problem was due to the use of the wrong symbol for the slash.
The zero-width symbol for the \not operator was being used.
Using TeX fonts for all symbols gives now a better uniform look.
It is not possible using the alternative code even with Qt 5.4.1
because some glyphs are still missing.
2015-05-05 01:38:50 +02:00
Juergen Spitzmueller
1aea9864f3 TabularCreate.ui: Fix zorder. 2015-05-04 17:38:15 +02:00
Juergen Spitzmueller
ee771408e4 Fix display of math delimiters in delimiter dialog (#5760)
Exclude win32 from the fix due to #9428.
2015-05-03 13:23:27 +02:00
Juergen Spitzmueller
f07830bb5c Remove unused header 2015-05-02 14:37:23 +02:00
Juergen Spitzmueller
b53773232a sign. 2015-05-02 11:38:46 +02:00
Juergen Spitzmueller
6be393a4f1 Use EmptyTable widget in TabularCreate dialog.
Fixes #3155.
2015-05-01 18:11:57 +02:00
Juergen Spitzmueller
17a4acf857 Fix usability of EmptyTable widget.
Fixes #3919 (math matrix dialog UX issues).
2015-05-01 18:10:36 +02:00
Scott Kostyshak
ae14d8fe34 Update previews when going to a bookmark (#6173)
Note that I move the definition of cur up because we need to check if
it changed before the return. I also removed the const because
notifyCursorLeavesOrEnters() requires that.

This commit probably fixes other issues for any inset that defines
notifyCursorLeaves().

This fixes only part of #6173.
2015-04-25 20:01:39 -04:00
Scott Kostyshak
390ae05444 Update previews on preference change (#9507)
Normally the theBufferList().updatePreviews(); statement would go inside
of PrefDisplay::applyRC. However, that would not work well because
Buffer::updatePreviews() calls loader() which conditions on
(lyxrc.preview == LyXRC::PREVIEW_OFF) but the new RC has not been set at
this point.
2015-04-21 02:40:18 -04:00
Juergen Spitzmueller
bf93b9756e Do not show obsoleted flex insets in the menu. 2015-04-20 18:10:25 +02:00
Jean-Marc Lasgouttes
d592ec06b9 Avoid requiring messages with empty language.
This is a follow-up to commit 8aa2d6b1.
2015-04-15 15:31:41 +02:00
Juergen Spitzmueller
3bb588f4aa Remove problematic accelerator (#9495)
Seems there is no free accelerator left for the source view pane.
2015-04-10 10:13:12 +02:00
Scott Kostyshak
6cf81782dd Implement and bind buffer-move-{next,previous}
Control + Shift + PgDn now moves a tab to the right.
Control + Shift + PgUp now moves a tab to the left.

These keybindings are consistent with Chromium, Firefox,
Nautilus, and gnome-terminal.

Note that I allow for wrapping. This is consistent with
allowing wrapping for buffer-{next,previous}, but there
might be reasons to disable it in the future.
2015-04-08 14:12:52 -04:00
Scott Kostyshak
a64a2d0ab7 Set enable for both cases
Thanks to Jürgen.
2015-04-08 12:59:06 -04:00
Scott Kostyshak
2b77b2e8ad Correct typo from last commit 2015-04-07 23:00:51 -04:00
Scott Kostyshak
dabb534a36 Simplify previous commit
The brackets are not necessary.
2015-04-07 22:59:34 -04:00
Scott Kostyshak
e26ac5c550 Add getStatus check that >1 tab for switching
buffer-next and buffer-previous are now only enabled
if there is more than one tab. Note that it does not
matter whether we are at the first or last tab because
we cycle.
2015-04-07 22:55:20 -04:00
Enrico Forestieri
52fee3556e Fix external middle-mouse pasting with Qt5/X11.
Closes #9216. Patch by Jürgen and me.
2015-04-07 12:59:41 +02:00
Juergen Spitzmueller
7970b84049 Do not close LyX in the commitData process (#9277)
Since the logout process still can be canceled here, we should only
check that all dirty buffers are saved and that the session state is
recorded.

Please test, particularly on Windows and OSX, that logging out with LyX
running (both with and without dirty buffers) proceeds sensibly and that
the LyX session is correctly restored when you re-login.
2015-04-06 13:50:32 +02:00
Juergen Spitzmueller
80f992fc29 Show Anyway button needs to be enabled/disabled in paramsToDialog.
Else, the state set on first launch persists, notwithstanding the change of function state.
2015-04-05 10:50:30 +02:00
Scott Kostyshak
09700d5b71 Button for showing PDF if compilation error
Building on cd8be655, we still allow viewing a produced PDF even if
there were compilation errors. However, now the user must click the
"Show Output Anyway" button in the LaTeX Errors dialog. The reason
is that before, there was a chance that the user would not realize
there was an error (because the PDF would be shown over the error
dialog). The approach in this commit makes it more clear that there
is an error.

A new LFUN is introduced, LFUN_BUFFER_VIEW_CACHE. It is useful not
just for the implementation of the "Show Output Anyway" button, but
also to show the last compiled version of a document, which can save
time if a document takes a long time to compile (e.g. heavy use of
knitr).
2015-04-04 13:13:19 -04:00
Juergen Spitzmueller
b309fa5d2b Implement checkWidgets in the remaining InsetParamsWidget derived dialogs. 2015-04-02 17:03:08 +02:00
Juergen Spitzmueller
5aee9e6d63 No need for default argument 2015-04-02 16:32:04 +02:00
Juergen Spitzmueller
82b392eb0d GuiInfo: implement checkWidgets. 2015-04-01 10:07:20 +02:00
Jean-Marc Lasgouttes
a9baa5380c Fix warning 2015-03-31 17:08:04 +02:00
Juergen Spitzmueller
99f7b916e6 Improve read-only mode of InsetParams derived dialogs
* Disable "New Inset" button
* Do not disable line edits, but use setReadOnly instead (this allows copying contents)

Fixes: #9408

Note that some dialogs still need some care.
2015-03-30 14:44:11 +02:00
Enrico Forestieri
cb899b3fa2 Provide icons for the outline-* lfuns.
- Accordingly rename "promote" and "demote" icons.
- Add "outline-down" and "outline-up" icons.
2015-03-28 23:22:21 +01:00
Jean-Marc Lasgouttes
e4fe294bdc Make builds reproducible
We do not really need to use __TIME__ and __DATE__, which prevent from making LyX builds reproducible.

Fixes bug #9415.
2015-03-26 18:14:45 +01:00
Jean-Marc Lasgouttes
66fa801e74 Improve support for on screen length calculation
The computation of length on screen depend in particular of the computation of the size of an em. Many places of the code used to rely on the width of the M character, which is not really correct:
http://en.wikipedia.org/wiki/Em_%28typography%29

In digital typography, the best value to use is the point size of the font.

* Implement FontMetrics::em(), which returns the value in pixels of the EM unit.
 Convert code to use it.

* Introduce Length::inPixel(MetricsBase const &), which takes the textwidth and em information from the MetricsBase object. Convert code to use it.

* Fix several places where Length::inPixel is used without a proper em value.

* add mathed_font_em() helper function. It should eventually be removed like some other functions in MathSupport.

* Add dummy implementation of FontMetrics to tex2lyx for linking purposes.
2015-03-26 17:10:15 +01:00
Jean-Marc Lasgouttes
8aa2d6b184 Fix setting Interlingua as GUI language
The problem came from the fact that Qt associates Interlingua to locale C.
Now, we do not rely anymore on the Qt locale to set the language. I suspect that the problem will still exist if the system locale is ia_IA.

Fixes bug #9267.
2015-03-17 12:37:24 +01:00
Juergen Spitzmueller
187c5f0ef5 Use QLocale::toDouble instead of QString::toDouble in the length validator
Fixes: #9214
2015-03-15 11:48:36 +01:00
Enrico Forestieri
7be2a5d815 Prefer svg icons.
If a compressed svg icon is present, load it instead of a png one.
Also introduce two more sizes (huge and giant icons) that should be
useful when using hires displays, as svg icons automatically scale
to the desired size without loss of quality.
2015-03-13 00:47:21 +01:00
Jean-Marc Lasgouttes
143c136a7f Do not read array before checking the bounds
Fixes coverity issue 23377
2015-02-20 16:51:20 +01:00
Georg Baum
7adc6125f7 Fix missing symbols in math completer
The math icons for the symbol image in the math completer were hardcoded to the
command names. This is wrong for some icons for various reasons, e.g. the case
insensitivity of windows file systems. Therefore we have to use the replacement
list which is also used for the toolbar icons. Bug #3538 is not closed because
of this problem, but IMHO it has nothing to do with this bug, it is a more
general one.
2015-02-14 20:32:25 +01:00
Scott Kostyshak
36c3495a3a Correct the spelling of "occured" to "occurred" 2015-02-09 18:44:02 -05:00
Juergen Spitzmueller
d48e5330be Add pref option to disable middle-mouse-button paste
Fixes: #9399
2015-02-08 17:41:28 +01:00
Enrico Forestieri
e3960ffd0b Fix bug #9392: Matrix widget keyboard navigation broken 2015-01-27 22:59:33 +01:00
Uwe Stöhr
95bf60b52b ParagraphUi.ui: update file to QT's xml format 2015-01-22 01:07:40 +01:00
Enrico Forestieri
f496ec373b Solve the "soft-hyphen" (0x00ad) symbol problem.
After the str-metrics merge, the kludge for displaying symbols whose
code point corresponds to a soft-hyphen was not working anymore.
The solution is replicating the offending glyphs with index 0x00ad
at a different index. They were replicated at 0x00ac, whose glyph
was missing in all affected fonts.

However, this would not work by alone because, if a system font with
same family name exists, it would be picked up instead of the right one
(at least on non-Windows platforms). For this reason, the style of the
fonts has been changed from "Regular" to "Lyx", so that we can discriminate
the right font. However, this requires using at least Qt 4.8. If an
older Qt is used *and* a system font with same family name is already
available, the affected glyphs will all turn out on screen as the
"logical not" symbol.

I have also set the executable flag on the font files, because on Windows
they are loaded only in this case.

This solves #9229.
2015-01-21 14:12:42 +01:00
Jean-Marc Lasgouttes
3830ce46db Squash warnings reported by gcc 4.9
Most of these are just about conversion from double to int.

Of note also the replacement of an horrible reinterpret_cast by a proper solution.
2015-01-14 11:52:14 +01:00
Enrico Forestieri
35357c1225 Fix preferences panel.
This commit fixes a thinko in [8bab2338/lyxgit] causing the warning:
QObject::connect: No such slot lyx::frontend::GuiPreferences::slotApplyRC() in ../../../../src/frontends/qt4/GuiPrefs.cpp:3308
QObject::connect:  (sender name:   'applyPB')
QObject::connect:  (receiver name: 'PrefsUi')
2015-01-11 20:11:40 +01:00
Enrico Forestieri
d4428ceb81 Adjust preprocessor guards for Qt5/X11.
This fixes the -geometry command line option and restores the
"Use icons from system's theme" checkbox in the preferences.

There is still code addressing Qt4 and xlib that has to be
audited. This code cannot be compiled with Qt5 because the
default backend is now xcb and not xlib. I have marked such
code with a "FIXME QT5" comment.
2015-01-11 19:44:35 +01:00
Jean-Marc Lasgouttes
9c55af4a22 Merge remote-tracking branch 'features/scroll-reloaded'
This implement horizontal scrolling of rows to allow editing insets
(math, tabular...) that are larger then the screen. The scrolling happens
as the cursor moves, in order to make sure that the cursor is always visible.
This effectively closes an 11 years old bug.

This feature is the result of the work of Hashini Senaratne as part of
Google Summer of Code 2013. The code has been cleaned-up for inclusion
and remaining bugs have been fixed.

Fixes bug: #1083.
2015-01-10 18:39:09 +01:00
Hashini Senaratne
5a361b35cf Keyboard based horizontal scrolling for wide insets
[This commit is the output of the "horizontal scrolling" GSoC 2013
 project, by Hashini Senaratne. The code has been cleaned up, some
 variables have been renamed and moved from the Cursor class to
 BufferView::Private. This is the base from which I (jmarc) will polish
 the feature for landing on master.

 Below is the original commit log of Hashini, updated to reflect the
 changes that have been done.]

This feature also applicable for other insets; graphics and labels.

This implementation is capable of scrolling a single row when reaching
its content which is beyond the screen limits, using left and right
arrow keys.

The attribute 'horiz_scroll_offset_' introduced in the
BufferView::Private class plays a main role in horizontal scrolling of
the wide rows that grow beyond the screen limits. This attribute
represents by how much pixels the current row that the text cursor
lies in should be get scrolled.

The main logic that is responsible for drawing the scrolled rows is
within the BufferView class, BufferView::checkCursorScrollOffset.

 * The main logic is called via BufferView::draw.

 * What this does is set the horiz_scroll_offset_ attribute in in order to
 show the position that the text cursor lies in.

 * To make sure that BufferView::draw gets involved when Update flag is
 FitCursor, necessary changes are made in BufferView::processUpdateFlags.

Basically what the logic that used to set the horiz_scroll_offset_
does is,

 * The row which the text cursor lies in is identified by a
 CursorSlice that points to the beginning of the row. This is the
 'rowSlice' variable used in BufferView::checkCursorScrollOffset. Acessors
 are added to obtain this variable. Here row objects were not used to
 identify the current row, because it appears that row objects can
 disappear when doing a decoration update for example. This means that
 comparing row pointers is not a good idea, because they can change
 without notice.

 * Stop calculations of horiz_scroll_offset_ variable, if metrics have not been
 computed yet. Otherwise the calls to TextMetrics::parMetrics, calls
 redoParagraph and may change the row heigths. Therefore vertical scrolling
 feature may get disturbed. This is avoided.

 * Using BufferView::::setCurrentRowSlice resets horiz_scroll_offset_
 when changing cursor row. This is done in order to prevent unwanted
 scrolling that happens when changing the selected row using up and
 down arrow keys.

 * Recompute inset positions before checking scoll offset of the row, by
 painting the row insets with drawing disabled. This is done because the
 position of insets is computed within the drawing procedure.

 * Current x position of the text cursor is compared with the
 horiz_scroll_offset_ value and the other variables like row.width(),
 bv.workWidth(). Compute the new horiz_scroll_offset_ value in order
 to show where the text cursor lies in. The basics conditions that we
 check before recomputing it are, if the text cursor lies rightward to
 the current right screen boundary, if the text cursor lies leftward
 to the current left screen boundary, if the text cursor lies within
 screen boundaries but the length of the row is less than the left
 boundary of the screen (this happens when we delete some content of
 the row using delete key or backspace key).

 * Change update strategy when scrooll offset has changed. This allows to
 redraw the row when no drawing was scheduled. By doing so, it was
 possible to redraw a wide row when moving to the leftmost position of the
 wide row, from the leftmost position of the row below, using the left
 arrow key.

In TextMetrics::drawParagraph it is checked whether the current row is
what is drawing now. If it is so, the value used to the x value of the row
for drawing is adapted according to BufferView::horizScrollOffset.

The method used to pass boundary() was fixed to get row when cursor was in
a nested inset. This matter is considered in Cursor::textRow and it is
modified accordingly.

GuiWorkArea::Private::showCursor() is modified to show the cursor position
in a scrolled row.
2015-01-07 22:55:11 +01:00
Vincent van Ravesteijn
c313b1c8eb str_metrics: Prevent clipping of chars with negative bearing
This happens when part of the word is selected.

To reproduce:
1. Start a new document
2. Type "af"
3. Select 'a'
4. Observe that the right part of the 'f' is clipped away.

This patch uses QRegion to set a clip region that is everything except
the part that is drawn in another color.

Fixes: #9223.
2015-01-06 22:02:07 +01:00
Juergen Spitzmueller
27a8abf768 Some casing fixes
English UI uses Title Casing for headers and sentence casing for normal widgets
2015-01-04 10:53:36 +01:00
Juergen Spitzmueller
3cd1d396ff Fix aspectratio UI
Fixes: #9357
2015-01-04 10:05:42 +01:00
Georg Baum
b0361fb3c5 tex2lyx: Run configure.py if needed (bug #8539)
Since tex2lyx reads some LyX config files it needs to run configure.py if
they do not exist or are out of date.
2014-12-29 23:46:25 +01:00