Commit Graph

8172 Commits

Author SHA1 Message Date
Georg Baum
699a6db9fa Add some missing member variable initializations
These were all found by cppcheck. Even in constructors that are there "only
because of std containers" the class should be initialized correctly. You can
never know whether such an object does not get used, and then a nice crash
caused by dereferencing a NULL-pointer is better than undefined behaviour.
2015-09-13 19:47:21 +02:00
Guillaume Munch
fd7b13f5ae Improvements to the display of the source.
Fix bugs #6501 and #7359.

* Selection highlighting has been broken since a conflict with
  reverse-search was repaired (at 00a62b7c), is now fixed.

* The selection highlighting was not accurate, for LaTeX formats (in
  full source view), and meaningless, for non LaTeX formats.

* fix regression at cc00b9aa: force_getcontent_ was always true
  therefore the code to detect changes in the generated source was
  dead. The consequence is that the source view would jump to the
  beginning at each updateView() even if no change occurred. Cc00b9aa
  was meant to fix #5600, which I cannot reproduce with the new
  implementation.

* Various improvements:
  *  When the position-to-line conversion is unavailable (LyXHTML, LyX
     source, etc.) we focus on the first difference instead.
  *  Get some space around the cursor
  *  Respect the scrollbars
  *  Highlight with QTextEdit::ExtraSelections instead of cursor
     selection (the latter used to break syntax highlighting of the
     TeX code... which was not so much of an issue before because the
     wrong part was selected)

Known issues:
  * The highlighting is off by one line in very last paragraph of a
    document. This appears to be a bug in TexRow.cpp.
  * The highlighting is off for any kind of inset. This could be
    solved by adapting TexRow so that it accepts CursorSlices as
    and argument for the conversion to line number. (this is bug
    #4725)
2015-09-13 00:45:52 +01:00
Guillaume Munch
120c99ae60 Better session management for the source panel.
We now remember the previous GUI values across sessions.
2015-09-13 00:45:47 +01:00
Guillaume Munch
ba3e6cb2d2 Improve the performance of the source panel by using a QTimer.
Fix bug #9493. The source panel was very slow with auto-update on. Now
we use a timer that ensures that the source is generated only at
rest. The delay is short or long depending on whether we show the
source of a paragraph or the whole source.
2015-09-13 00:45:41 +01:00
Guillaume Munch
4d1ad336db Fix bug #9754
Don't delay the update of the TOC panel on switching documents
2015-09-13 00:45:22 +01:00
Jean-Marc Lasgouttes
cdeb425451 Initialize pointer members
Coverity issue 23387
2015-09-12 22:39:50 +02:00
Jean-Marc
915066f068 Add missing break statement
Coverity issue 23338
2015-09-12 20:02:32 +02:00
Jean-Marc
4e4b2e224e Add missing breaks
Coveity issues 23333, 23334 and 23348.
2015-09-12 19:58:15 +02:00
Jean-Marc
d786d98c36 Remove useless test
Coverity issue 23300.
2015-09-12 19:53:29 +02:00
Jean-Marc
92d5e7c11b Do not pass objects by value
Coverity issue 23372.
2015-09-12 19:22:51 +02:00
Jean-Marc
61f0271031 Add missing braces
Coverity issue 23506.
2015-09-12 18:40:52 +02:00
Jean-Marc Lasgouttes
cf6128caf6 Use QFontMetrics information for underlines (and friends) width and position
The width of the line is now dependent on the font size.

This new computation is applied to: underline, strikeout, double underline.
2015-09-08 10:44:03 +02:00
Guillaume Munch
d88e401589 Fix compilation with qt5 and c++11 combined. 2015-08-24 21:05:48 +02:00
Juergen Spitzmueller
7b1107d7f5 Decrease height of citation dialog by using a QToolBox
Fixes: #9618
2015-07-30 10:09:21 +02:00
Enrico Forestieri
0c093a6264 Fix bug #9684: Update previews after background color change 2015-07-22 00:56:34 +02:00
Jean-Marc
b63421b7dc Merge branch 'rowpainter2' 2015-07-21 23:47:12 +02:00
Jean-Marc Lasgouttes
b68f391232 Re-implement text justification
* GuiFontMetrics::pos2x, x2pos: add support for inter-word spacing.
* GuiPainter::text: idem

* Row::Element::countSeparators:
  Row::countSeparators: new methods that count spaces in strings.
  Row::setSeparatorExtraWidth: new method (code lifted from TextMetrics.cpp).

* TextMetrics::computeRowMetrics: rely on the above methods.

* RowPainter::paintMispelledMarked: pass only a Row::Element object reference
  RowPainter::paintStringAndSel: idem; do not rely on values returned by
      Painter::text (trailing spaces do not honor wordspacing value).
2015-07-20 23:43:05 +02:00
Jean-Marc Lasgouttes
f65f3adbf7 Do not break row elements at spaces
The goal of this commit is to make painting faster by reducing the
number of strings to paint. To this end, it is necessary to include
spaces in row elements.

Also importantly, this commit should fix existing problems with line
breaking in chinese text.

* TextMetrics::breakRow: do not do anything special for word separators.

* Row::add: when adding a character to a row element, keep the string
  width updated. If need be, it is possible to tweak this by updating
  every 10 characters, for example.

* GuiFontMetrics::breakAt (new): use QTextLayout to break text either
  at word boundary or at an arbitrary width.

* Row::Element::breakAt: use the above method.

* Row::shortenIfNeeded: simplify now that because there is no need for
  handling separator elements. This will be taken care of by the
  improved breakAt.

Two things remain to be done:

* remove all traces of separator row element

* re-implement text justification.
2015-07-20 21:22:53 +02:00
Georg Baum
dc6d201f8f Store InsetGraphics bounding box in parsed form
This is like InsetExternal does it, avoids some string parsing, reduces the
amount of code and makes it more robust.
2015-07-18 17:02:54 +02:00
Georg Baum
bf515425e1 Remove relative units from bounding box
When adding units to the external inset bounding box I overlooked that
InsetGraphics supports only bb, cm, mm and in. Therefore I added too many
units for the external insets. We are not as strict as the graphics inset
and allow all absolute units, but no relative ones.
2015-07-18 16:41:52 +02:00
Georg Baum
eaf70913ac LengthCombo does not depend on VSpace
so use the right include
2015-07-18 16:29:04 +02:00
Georg Baum
39c1fcb864 Devirtualize some methods
These do not need to be virtual, since no class inherits from LengthCombo.h,
and they do not exist in the base class either.
2015-07-18 16:23:24 +02:00
Georg Baum
81e592603d Support units in external inset bbox
This brings the external inset on par with the graphics insets as far as the
clipping option is concerned. The graphicxs package supports both: A bounding
box without units (which means that bp ia assumed), and a bounding box with
units, so we can simply output the values including the units.
2015-07-16 22:06:35 +02:00
Georg Baum
0cbcc8a166 Remove InsetGraphics noUnzip parameter
Being able to compile document with zipped .eps files was a useful feature of
the graphicxs package 20 years ago, but the LyX support is no longer relevant:
- The flag is ignored if preview is on
- If pdflatex is used then uncompressing happens during the compilation anyway
- If set, the flag prevents LyX from issuing proper error messages if
something with the image is wrong
- For hard disk capacities from 20 years ago not uncompressing is a useful
feature, but for current hard disk capacities it does not matter
- The external inset does not have it, and if we want to merge both insets
one day we would need to implement it there, which is even more difficult
than in InsetGraphics
2015-07-16 20:44:47 +02:00
Jean-Marc Lasgouttes
f51d7fdd2a Compilation fix for windows
Since commit 7ac70092, lyx::dispatch returns a DispatchResult const &,
which is ignored in the cases below. Nevertheless, the windows
compiler complains that it does not know this type. Gcc and clang can
deal with it without problem.
2015-07-16 09:48:57 +02:00
Jean-Marc Lasgouttes
7ac700920f Auto feature for minibuffer toolbar
Now the minibuffer toolbar is "auto" by default. It is opened by
command-execute (M-x) and closed when the command is executed without error.

* make lyx::dispatch return a DispatchResult struct

* there is a new MINIBUFFER type of toolbar, that can be used for this use.

* remove special handling of M-x in minnibuffer; Escape can be used instead. Fix focus in this case.

* when minibuffer toolbar is "auto", make the toolbar close itself after
  - a command has been executed without error
  - an empty command has been executed
  - the Escape key has been used

[this is actually commit fdcff02a, which was later reverted at dd61d8cf]
2015-07-15 17:41:09 +02:00
Jean-Marc Lasgouttes
a05b8be4bf Always use unicode override characters to enforce direction
There is a second solution in the code which uses some undocumented Qt
stuff, but it does not work in some cases. The best is to rely on the
documented way.
2015-07-14 23:19:26 +02:00
Jean-Marc Lasgouttes
463bd17d75 Use integer line thickness in painter
There is no need for real-valued line width in painters. Actually, this even leads to uneven dashes for continuous spell checker.

The new code is supposed to be equivalent to the old one, just more readable. From this, we can try to see whether some lines need to be made thicker on HiDPI screens.
2015-07-14 17:42:45 +02:00
Jean-Marc Lasgouttes
f41e423b30 Small clean-up to debug support 2015-07-08 11:03:42 +02:00
Stephan Witt
8a772549d7 Fix for #9659 - Qt may send more then one close event to a window. Therefore multiple calls to unregisterView for a GuiView are possible. The first one removes the view from the list of known views, subsequent calls do nothing. 2015-07-04 18:59:29 +02:00
Scott Kostyshak
0d52736061 Remove an incorrect horizontal size policy
This effectively makes the horizontal size policy "minimum", which
makes it clear that there is no advantage for this widget of
increasing the horizontal size past the minimum, allowing other
GUI elements to use the horizontal space if useful.

This change for caseCB is consistent with wordsCB and searchbackCB.
2015-07-02 10:33:38 -04:00
Jean-Marc Lasgouttes
dd61d8cf3f Revert "Auto feature for minibuffer toolbar"
This reverts commit fdcff02a31.

This was pushed too early, we are not ready yet.
2015-06-30 11:09:48 +02:00
Jean-Marc Lasgouttes
fdcff02a31 Auto feature for minibuffer toolbar
Now the minibuffer toolbar is "auto" by default. It is opened by
command-execute (M-x) and closed when the command is executed without error.

* make lyx::dispatch return a DispatchResult struct

* there is a new MINIBUFFER type of toolbar, that can be used for this use.

* remove special handling of M-x in minnibuffer; Escape can be used instead. Fix focus in this case.

* when minibuffer toolbar is "auto", make the toolbar close itself after
  - a command has been executed without error
  - an empty command has been executed
  - the Escape key has been used
2015-06-29 09:21:15 +02:00
Scott Kostyshak
6c3a6ea9bd Give Advanced Find a minimum size
The horizontal size policy is now set to "MinimumExpanding", which
means that sizeHint() is enforced as a minimum, but that the widget
can make use of extra available space.

Before, the size policy was ignored, and often resulted in a
scrunched pane that had to have its size manually increased.
2015-06-28 05:16:49 -04:00
Scott Kostyshak
8f1b7f47fa FindAndReplaceUi: update format 2015-06-28 05:16:14 -04:00
Juergen Spitzmueller
2a8db0a64b HSpace/VSpace: use a _signed_ length validator in the dialogs. 2015-06-26 13:19:12 +02:00
Scott Kostyshak
5e7cbc8f2c Fix setting of pref "hide scrollbar in fullscreen"
The symptom of the bug is that the preference could be incorrectly
displayed (based on the value of the statusbar preference).

This seems to have been a copy/paste mistake introduced in 214f7ed2.
2015-06-25 08:33:11 -04:00
Jean-Marc Lasgouttes
8b36c090b7 Simplify the code for "auto" toolbars handling
Instaead of passing a number of booleans, it make more sense to pass
the relevant visibility values in a single flag.
2015-06-18 15:51:53 +02:00
Juergen Spitzmueller
f0923ebadc GuiParagraph: Fix remaining glitch when entering custom line spread
while immediate apply is activated.
2015-06-13 12:31:03 +02:00
Juergen Spitzmueller
930fef9d8d GuiParagraph: fix thinko (bug #9621) 2015-06-13 12:17:11 +02:00
Jessica Hamilton
7cd2e55d1f Qt4: Prevent crash on Haiku when clicking in a document
Fixes bug #8595.
2015-06-11 18:12:35 +02:00
Juergen Spitzmueller
664ef2c459 Report missing characters on conversion with XeTeX or LuaTeX (bug #9610)
As discussed on trac, we treat this as error, since it severely
corrupts the output (dataloss).
2015-06-11 11:32:17 +02:00
Juergen Spitzmueller
7cce590390 GuiIndices: Improve widget disabling and account for read only status
(bug #9593)
2015-06-03 16:54:54 +02:00
Jean-Marc Lasgouttes
25913aaac6 When the document language is changed, update cursor language too
Actually, the change is done only if the cursor language was the
document language already.

This fixes an trivial but annoying problem: create a new file (in
English), change language to your favourite language, then start to
write. Before this fix, the words come out in English, which does not
make sense.

Fixes bug #9586.
2015-06-03 12:19:07 +02:00
Enrico Forestieri
bb4bef8994 Extend the fix for #5760 to the cygwin xcb backend. 2015-05-30 17:25:36 +02:00
Juergen Spitzmueller
abefdcaf30 Add comment 2015-05-28 13:34:58 +02:00
Stephan Witt
c25e8c50a7 #9574 check for valid focus (see ticket #1720) does not work on Linux and Windows 2015-05-28 13:27:59 +02:00
Stephan Witt
31ebb84486 improved positioning of version text in banner image 2015-05-28 08:01:58 +02:00
Richard Heck
3c2b3e6907 Remove printing support from LyX.
This was bug #6747.
2015-05-27 18:13:08 -04:00
Juergen Spitzmueller
5353172793 If there is an inset at cursor, connect the dialog with that, not the containing one
Fixes: #8716 ("minipage within minipage" Settings bug)

This is a potential candidate for branch, but only after some more testing.
2015-05-26 19:33:07 +02:00
Juergen Spitzmueller
5ceb82d4e4 GuiAbout: Detect and provide links to trac
Text in the form "bug #1234" is transformed to a link that points
to the respective trac entry.
2015-05-24 14:51:47 +02:00
Enrico Forestieri
260a98d295 Save the document directory path only if explicitly allowed.
A new preference is introduced for allowing the record of the document
directory path in the saved file. Without explicit consent, it is not saved.
If the origin tag contains an invalid/wrong path or garbage, LyX behaves
exactly as before, i.e., included files are simply not found.
2015-05-23 17:49:33 +02:00
Stephan Witt
89469a9e55 fix whitespace issue 2015-05-22 22:04:19 +02:00
Stephan Witt
43dd383073 avoid float-conversion warning and simplify size computation 2015-05-22 22:00:22 +02:00
Juergen Spitzmueller
47dd9189eb Add more Float tags to allow to disable wide and sideways feature
Fixes: #9557, #9558

This is amended to yesterday's layout format change.
2015-05-22 18:59:17 +02:00
Jean-Marc Lasgouttes
7760c5ccf2 Create proper undo groups for advanced find and replace
Create new helper class UndoGroupHelper, which simplifies a lot the
handling of undo groups in cases like this one. The class tracks open
undo buffers and allows to switch buffers transparently.

Using the class for advanced search and replace is trivial. THe class
may be useful in some other classes.

Fixes ticket #8658
2015-05-22 16:42:10 +02:00
Juergen Spitzmueller
1d266c8cfa Indicate read-only status in tabs (#6783) 2015-05-22 10:41:12 +02:00
Juergen Spitzmueller
7dc123b790 Add Float tag to determine allowed positioning options (#7752) 2015-05-22 10:37:14 +02:00
Jean-Marc Lasgouttes
88609b3984 Improve list of available languages for UI l10n.
Add a new tag HasGuiSupport to language file. Add it for all l10ns
that we currently ship. The po files that are unused are not currently
tagged as available, but this could be done, since the code later
checks that the translation is actually there.

This new information is used in GuiPrefs when populating the language
combox.

The new scheme implies that adding a new language is now a two-step
process:
* the language code has to be added to po/LINGUAS, as before;
* one of the entries of the lib/language file has to be selected as
  reference and be given the "HasGuiSupport true" property.
2015-05-21 10:48:38 +02:00
Juergen Spitzmueller
9e16608867 Fix problems with immediate apply and length validators
Fixes bugs #7022 and #7599.
2015-05-20 19:13:12 +02:00
Juergen Spitzmueller
8b86af7298 Fix LaTeX length export of big numbers, part 2 (bug #9416)
LaTeX lengths must not use scientific notation, since the + sign has a
different meaning (glue lengths). This is the GUI part of bug 9416,
on top of part 1 [59e4d16ab/lyxgit].
2015-05-20 09:35:57 +02:00
Stephan Witt
2ac45cc4d2 #9130 Text in main work area isn't rendered with high resolution
Try SVG version of banner with Qt4 too.
2015-05-20 08:46:26 +02:00
Stephan Witt
d392df30c0 #9130 Text in main work area isn't rendered with high resolution
Correctly guard Qt5 code introduced by change c053a9394d
2015-05-20 07:52:30 +02:00
Stephan Witt
c053a9394d #9130 Text in main work area isn't rendered with high resolution
Improved icon and pixmap handling with SVG images and high physical resolution displays.
This results in much better looking icons and splash banner.
2015-05-19 22:46:26 +02:00
Stephan Witt
0933df0011 Add Qt's Svg module to the list of used modules. This is required to allow the use of e.g. the QSvgRenderer class. 2015-05-19 22:46:26 +02:00
Enrico Forestieri
82e4dbc48e Use the xcb definition for the primary selection atom. 2015-05-19 21:19:49 +02:00
Juergen Spitzmueller
c162d02915 GuiAbout: enforce a reasonable width (show all tabs) 2015-05-19 15:09:46 +02:00
Juergen Spitzmueller
14557b28d9 Complilation fix.
This time without unwandted po stuff.
2015-05-19 12:56:31 +02:00
Juergen Spitzmueller
01e7a10029 Revert "Complilation fix."
This reverts commit abf8208679.

I'll properly re-commit in a minute.
2015-05-19 12:52:19 +02:00
Juergen Spitzmueller
af42a9d683 GuiAbout: minor ui fix 2015-05-19 12:43:44 +02:00
Juergen Spitzmueller
abf8208679 Complilation fix. 2015-05-19 12:37:45 +02:00
Juergen Spitzmueller
9f55ce9b04 Make RELEASE-NOTES accessible from GUI (#8616)
CMake people, please check if something needs to be done to install
lib/RELEASE-NOTES.
2015-05-19 09:57:52 +02:00
Juergen Spitzmueller
e1b1dd7445 GuiBox: remove unneeded connection and use a more senible signal 2015-05-18 13:13:04 +02:00
Juergen Spitzmueller
7d67e94cd0 GuiBox: do not rely on count (as explained on lyx-devel) 2015-05-18 13:12:26 +02:00
Juergen Spitzmueller
a98cfe1874 GuiBox: sort colors 2015-05-18 13:11:34 +02:00
Juergen Spitzmueller
bca8f5a940 GuiBox: remove none from the static color list
It is not used anyway and it prevents sorting.
2015-05-18 13:10:32 +02:00
Juergen Spitzmueller
47bee41ea3 GuiBox: assure combo boxes are empty before filling 2015-05-18 13:09:07 +02:00
Juergen Spitzmueller
edfdd5139e GuiBox: swap filling of color combos 2015-05-18 13:07:00 +02:00
Juergen Spitzmueller
2548e7fd98 GuiBox: simplification 2015-05-18 13:05:28 +02:00
Juergen Spitzmueller
927136c256 isReadable can only be used after the file has been opened 2015-05-18 11:15:11 +02:00
Juergen Spitzmueller
7f1d33efc1 Re-defactor ColorSorter.
This hopefully cures Richard's compilation woes.
2015-05-18 11:11:45 +02:00
Georg Baum
84cca2dd94 Fix indentation 2015-05-17 17:27:27 +02:00
Juergen Spitzmueller
b7c53b6017 Use view/data separation for GuiCharacter colors, which makes it possible to sort the colors 2015-05-17 17:15:01 +02:00
Juergen Spitzmueller
8fc637103f Factor out ColorSorter to qt_helpers, to make it
available to other dialogs as well.
2015-05-17 16:47:40 +02:00
Uwe Stöhr
8dd217c983 GuiBox.cpp: fix bug introduced by [bec3f7bc/lyxgit]
There were now 2 entries named "none" in backgroundcolorCO

- delete the fixmes; the LateX name is used as parameter to save unnecessary conversions for the LateX output; please ask me before adding fixmes
2015-05-17 01:45:56 +02:00
Uwe Stöhr
51e3b026b2 GuiBox.cpp: a compile fix 2015-05-17 01:28:06 +02:00
Enrico Forestieri
324abefd53 Fix #5575 also on Windows. 2015-05-16 23:36:40 +02:00
Juergen Spitzmueller
853283ca87 Extend comment and remove superfluous parentheses. 2015-05-16 19:18:51 +02:00
Juergen Spitzmueller
9e57f906c2 Refine fix for #5575 and comment it out for windows
See #5575 for details why it does not work on windows.
2015-05-16 17:16:01 +02:00
Juergen Spitzmueller
1738d4e409 Fix tooltip line breaks. 2015-05-16 15:41:22 +02:00
Juergen Spitzmueller
818249f69f Clarify "Save compressed by default" feature (bug 7822) 2015-05-16 15:31:51 +02:00
Juergen Spitzmueller
69fe51f9d8 Fix casing 2015-05-16 13:30:23 +02:00
Juergen Spitzmueller
b5fbd9f2a2 Fix Box UI (buddies and accelerators) 2015-05-16 12:46:08 +02:00
Juergen Spitzmueller
bec3f7bc8c Fix up GuiBox (use proper data/view separation and clean up) 2015-05-16 11:27:13 +02:00
Uwe Stöhr
bd80617cdb GuiBox.cpp: enable color features also for non-English locales
stupid me, I used a translatable string as box parameter. Therefore the feature only worked correctly with English locale. Now it works for every locale.
2015-05-16 05:22:22 +02:00
Uwe Stöhr
0140063c8e GuiBox.cpp: add a comment and a string conversion 2015-05-16 03:54:51 +02:00
Uwe Stöhr
a49f24767a GuiCharacter.cpp: sort all colors, also white
as proposed by Scott
2015-05-16 03:32:45 +02:00
Uwe Stöhr
88593e0ec6 support for colored boxes
adds support to set colors for some box types (support for the LaTeX commands \fcolorbox and \colorbox)

fileformat change
2015-05-16 03:22:37 +02:00
Uwe Stöhr
ffb4146d17 GuiBox.cpp: fix logic
- if pagebreaks are allowed there cannot be defined a width
2015-05-15 06:04:46 +02:00
Uwe Stöhr
6780a30409 GuiBox.cpp: fix logic
- if pagebreaks are allowed there cannot be defined a width
2015-05-15 06:02:41 +02:00
Uwe Stöhr
a5cc5dce3c GuiBox.cpp: assure that the parameters are not empty 2015-05-15 03:51:11 +02:00
Uwe Stöhr
e35bb3126a support for all default colors of the package xcolor
fileformat change
2015-05-14 22:23:44 +02:00
Georg Baum
1586f79499 Shut up compiler warning
We know that ceil() returns an integer, although the type is double.
2015-05-14 12:14:47 +02:00
Enrico Forestieri
306b136cc0 Fix bug #4812 (Layout in local directory lost on Save As, Copying)
The "save-as" part of the bug is fixed by extending the \textclass tag
such that, if a local layout file is used, its path relative to the
document directory is now stored together with the name. If a relative
path cannot be used, an absolute one is used but, in this case, the
document is not usable on a different platform.

The "copy" part is fixed by introducing a new \origin tag, which is
written when the file is saved. This tag stores the absolute path of
the document directory. If the document is manually copied to a
different location, the local layout file is retrivied by using
\origin (which is only updated on save).
This new tag may prove useful also for locating other files when the
document is manually moved to a different directory.

As in the original implementation the files needed for the layout
(for example, a latex class) had to be in the same directory as the
layout file, this directory has also to be added to TEXINPUTS.
2015-05-13 22:02:13 +02:00
Juergen Spitzmueller
301782fad7 Do not blindly insert ubound Alt-<letter> keybindings.
Fixes: #5575
2015-05-13 14:54:52 +02:00
Uwe Stöhr
858c12c6bb GuiBox.cpp: make a logic setting more clear 2015-05-13 01:16:35 +02:00
Uwe Stöhr
34da634451 BoxUi.ui: update tooltips and tab order
- InsetBox.cpp: constify
2015-05-12 00:28:29 +02:00
Uwe Stöhr
335ccee3b5 GuiBox.cpp: re-add lost braces
- FORMAT: add date
2015-05-11 22:16:36 +02:00
Uwe Stöhr
8010b90cb4 add ability to change box line thickness and separation
fileformat change
2015-05-11 21:30:32 +02:00
Juergen Spitzmueller
1d3b7e5085 Fix enabling/disabling in InsetParams derived dialogs (#9541) 2015-05-11 11:35:02 +02:00
Uwe Stöhr
3290d15a15 GuiBox.cpp: add missing braces from previous commit 2015-05-10 21:42:45 +02:00
Uwe Stöhr
4be4d4e1a6 GuiBox.cpp: fix button logic (fixes bug #9543) 2015-05-10 15:54:03 +02:00
Juergen Spitzmueller
49fa913739 GuiBox: Factor out enabling/disabling to checkedWidgets.
Part of: #9541.
2015-05-10 13:02:00 +02:00
Juergen Spitzmueller
4ed8caaf1c Split different indices in the outliner
Fixes: #7012.
2015-05-09 15:30:10 +02:00
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