For $100, would you change a default font?

2016-10-21 Thread Paul Johnson
I use LyX all the time. I love it and encourage everybody to try it.

I usually get great results.Except when I am in a hurry and forget to
change default fonts. In particular, I've been stung by the combination of
the listings class and default typewriter font.  Last week,  I threw in a
lot of R code with "<-" printed to pdf as "< ". There were invisible
dashes. I did not notice and printed handouts for a group. Other symbols
have gone missing, sometimes ~ in verbatim class is invisible.

It is easy to fix by setting typewriter to Latin modern or other font, but
in an emergency, I always forget.

You would make my life more fun if you would make the default something
not-yet-known to give bad results. I'm not talking about fuzzy font edges.
Invisible characters without warning are super bad. Awful.

So I offer $100 US if you will change the default font to Latin modern or
any other one. I know that's not much, but I am sincere.

I note your FAQ already admits that default LyX fonts make bad PDF. I will
leave to others to discuss that. But the default typewriter font has to go.


Paul Johnson



-- 
Paul E. Johnson   http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu

I only use this account for email list memberships. To write directly,
address me at pauljohn at ku.edu.


Add Assumption to Theorems.inc

2016-10-21 Thread Andrew Parsloe

Dear LyX developers,

I find myself needing an Assumption environment every now and again and 
think it should be added to Theorems.inc and its relatives. (As far as I 
can tell it isn't defined in any of the Theorems-.inc 
included in the Resources/layouts folder.) I've added it to a personal 
version of Theorems.inc, inserting it after Fact in the list of 
environments provided there.


A use case is when one has an extended argument (a chapter perhaps) in 
which this assumption is part of the background to the argument and 
attention should be drawn to that fact, but either (a) it would be 
tiresome and get in the way of understanding if one had to bloat every 
assertion (theorem, proposition, lemma, etc.) with its explicit 
inclusion, or (b) the argument isn't presented in theorem/proof form but 
more informally as a discussion which is to be understood against the 
background of the assumption.


Although I can't find an Assumption environment defined in any 
Theorems-.inc file, Theorems-refprefix.inc does define the 
prefix: assu.


Andrew

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



Re: [LyX/master] Fix Ticket #9741 misleading name for font-encoding setting "default".

2016-10-21 Thread Guenter Milde
On 2016-10-21, Enrico Forestieri wrote:
> On Fri, Oct 21, 2016 at 07:05:29PM +, Guenter Milde wrote:
>> On 2016-10-21, Enrico Forestieri wrote:

>> > I think that the old "None (no fontenc)" was more than adequate.
>> > This tells that *LyX* is not going to select any encoding.

>> However, it was inconsistent. The same font dialog uses [Default] when
>> LyX is not going to select any font. Also the internal name is
>> "default".

> It is because the default encoding has been T1 since ever. I also think
> that it is unfortunate that selecting everything to be default, instead
> one finds that lyx is not producing a pristine latex file such as
> \documentclass{article}
> \begin{document}
> \end{document}
> but this is historical. Each program has his quirks, and this one has
> been there since the beginning. 

Until 2008, "default" meant unequivocally "pristine latex". 
LyX provided only a LyX-wide setting
Tools>Preferences>Output>LaTeX>Use_LaTeX_font_encoding. Allowed values
were a comma-separted list of font encodings or the special value
"default" for "don't load fontenc".

Confusion started, when per-document fontenc setting was added in
[df329341a/lyxgit] to fix bug #5730. As the LyX-wide setting was kept, we
ended up with two defaults: the LyX-wide setting and the LaTeX (or
documentclass) default.

Unfortunatly, the GUI name "Default" was chosen for the LyX-wide default.
Since then, selecting "Default" in the font encoding GUI inserts
additional code and usually leads to a font encoding differing from the
document class default.
  
> This is something that one gets accustomed to. Expert users know how to
> deal with it, 

Even experts and developers get this wrong:

E.g. Ticket #7334 "bitmapped fonts are still default" was closed as "wontfix"
with the comment

   we have the policy to not alter the class defaults (by default).

However, the problem is actually caused by the font encoding deviating from
the class default. Sticking to the policy would have solved it (but
created others).

> while novices don't mind and only want something that
> works and looks good.

Documents with LyX's default settings still use bitmap fonts and don't
look good (unless you installed CM-Super).

...

> Given what said above, having "LyX Default" instead of simply
> "Default" may be Ok (to differentiate from a consistency point of
> view), but another default (Class default) without any classification
> can be confusing. 

> So, it would be better to add "(no fontenc)", but then I still think
> that "None (no fontenc)" is better and doesn't need to be deciphered
> because it has always been like that. 

I prefer keeping "Default" in both GUI names, because the first ensures
compatiblity with the current naming and the second with the "Default"s
in the lines below. In a complex situation, confused is better than
misled.

> Hence, old users know what it means, 

My experience is that many old users got it wrong all the time...

> while new users will learn its meaning. For them, having "Class
> default" is not any clear and more confusing, IMHO.

This was Jürgens choice, my preference is "LaTeX Default" with a tooltip: 

  Use the documentclass' default encoding, don't load the fontspec package

Jürgen pointed out, that "no fontenc" may be misleading, as fontenc
could be loaded by a package or the document class. I could live with 
"LaTeX Default (no fontenc)" as a pragmatic way to tell users where to
click to avoid fontenc loading by LyX.

Thanks,
Günter



Re: Inverted colors for cursor

2016-10-21 Thread racoon

On 21.10.2016 21:47, Joel Kulesza wrote:

Instead of this, I would rather see a customizable cursor color in the
Preferences -> Colors dialog.  I would not want to have my cursor a
different color than my text (black on the default page background, by
necessity).


This is already implemented in

Tools > Preferences... > Look & Feel > Colors > cursor

However, on my suggestion if you work on a rather light background, like 
the default sepia, it will look black. At least I could not tell the 
difference. So not having it "perfect" black might be a price worth paying.


Daniel



Re: [LyX/master] Fix Ticket #9741 misleading name for font-encoding setting "default".

2016-10-21 Thread Enrico Forestieri
On Fri, Oct 21, 2016 at 07:05:29PM +, Guenter Milde wrote:
> On 2016-10-21, Enrico Forestieri wrote:
> 
> > I think that the old "None (no fontenc)" was more than adequate.
> > This tells that *LyX* is not going to select any encoding.
> 
> However, it was inconsistent. The same fibt dialog uses [Default] when LyX is
> not going to select any font. Also the internal name is "default".

It is because the default encoding has been T1 since ever. I also think
that it is unfortunate that selecting everything to be default, instead
one finds that lyx is not producing a pristine latex file such as
\documentclass{article}
\begin{document}
\end{document}
but this is historical. Each program has his quirks, and this one has
been there since the beginning. This is something that one gets
accustomed to. Expert users know how to deal with it, while novices
don't mind and only want something that works and looks good.
So, given that the "Default" has been stolen, having a "None (no fontenc)"
is helpful to experts to understand what is going on, while novices grasp
that something is not being selected. Probably, they don't even understand
what "TeX default" means, given that there is also another default
entry. I think they would be even more confused than now.

> > For that goal, I would have suggested to simply change "Default"
> > to "LyX Default". I don't have any idea of what is meant for
> > "Global Default".
> 
> Global Default is just a merge of the internal name and the previous GUI
> name for consistency with the previous name and with the other names
> of this dialogue. "LyX Default" would be OK, too.
> Also, there is a suggestion to remove the global setting alltogether (see
> Jean-Marcs comment).

Note that menus should be comprehensible to users rather than developers.
I was not even thinking that global refers to an internal classification
which is not visible.

> > Such controversial changes should not be performed without discussion.
> 
> I did not expect controversy after 14 months without any response to the bug
> report.

I think that you should not expect to have a discussion in the bug tracker
about topics such as this one. I don't even think it can be classified as
a bug. The fact that in 14 months nobody cared to comment may simply
mean that nobody feels that is an essential thing that should be corrected.

> So my updated proposal is
> 
> value  new GUI name
> == =
> global LyX Default   # eventually remove this value and lyxrc.fontenc
> ¹ Custom
> defaultClass Default # or LaTeX Default
> 
> with a short explanation in the tooltip and full description in
> the Guide.

Given what said above, having "LyX Default" instead of simply
"Default" may be Ok (to differentiate from a consistency point of
view), but another default (Class default) without any classification
can be confusing. So, it would be better to add "(no fontenc)", buth
then I still think that "None (no fontenc)" is better and doesn't need
to be deciphered because it has always been like that. Hence, old users
know what it means, while new users will learn its meaning. For them,
having "Class default" is not any clear and more confusing, IMHO.

-- 
Enrico


Re: Inverted colors for cursor

2016-10-21 Thread Kornel Benko
Am Freitag, 21. Oktober 2016 um 13:47:40, schrieb Joel Kulesza 

> Instead of this, I would rather see a customizable cursor color in the
> Preferences -> Colors dialog.  I would not want to have my cursor a
> different color than my text (black on the default page background, by
> necessity).
> 
> - Joel
> 
> P.S. It would be excellent if the Preference -> Colors dialog was made to
> work on OSX. https://www.lyx.org/trac/ticket/10420
> 
> On Fri, Oct 21, 2016 at 1:29 PM, racoon  wrote:
> 
> > The cursor is actually hard to see when its color matches the color of its
> > background. Maybe the idea of setting the cursor color fixed should be
> > abandoned and inverted colors should be used instead. All writer apps I
> > know of do so (like Libre and MS). Attached is a quick patch that seems to
> > achieve this.
> >
> > Daniel

Tried, and I like it.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: Inverted colors for cursor

2016-10-21 Thread Joel Kulesza
Instead of this, I would rather see a customizable cursor color in the
Preferences -> Colors dialog.  I would not want to have my cursor a
different color than my text (black on the default page background, by
necessity).

- Joel

P.S. It would be excellent if the Preference -> Colors dialog was made to
work on OSX. https://www.lyx.org/trac/ticket/10420

On Fri, Oct 21, 2016 at 1:29 PM, racoon  wrote:

> The cursor is actually hard to see when its color matches the color of its
> background. Maybe the idea of setting the cursor color fixed should be
> abandoned and inverted colors should be used instead. All writer apps I
> know of do so (like Libre and MS). Attached is a quick patch that seems to
> achieve this.
>
> Daniel
>


Inverted colors for cursor

2016-10-21 Thread racoon
The cursor is actually hard to see when its color matches the color of 
its background. Maybe the idea of setting the cursor color fixed should 
be abandoned and inverted colors should be used instead. All writer apps 
I know of do so (like Libre and MS). Attached is a quick patch that 
seems to achieve this.


Daniel
From 8f7334e9978458285a73a4ba25b37d6761569b3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Ram=C3=83=3F=3F=C3=83=3F=C3=82=C2=B6ller?=
 
Date: Mon, 17 Oct 2016 01:21:01 +0200
Subject: [PATCH] Use inverted color for cursor.

---
 src/frontends/qt4/GuiWorkArea.cpp | 4 
 1 file changed, 4 insertions(+)

diff --git a/src/frontends/qt4/GuiWorkArea.cpp 
b/src/frontends/qt4/GuiWorkArea.cpp
index 31df06b..7116989 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -149,6 +149,10 @@ public:
int r = rect_.right() - x_;
int bot = rect_.bottom();
 
+   // set inverted color
+   color_ = QColor(0xff, 0xff, 0xff);
+   
painter.setCompositionMode(QPainter::RasterOp_SourceXorDestination);
+
// draw vertical line
painter.fillRect(x_, y, cursor_width_, rect_.height(), color_);
 
-- 
2.9.0.windows.1



Re: Candidates for stable

2016-10-21 Thread Richard Heck
On 10/21/2016 01:27 PM, Jürgen Spitzmüller wrote:
> Am Samstag, den 15.10.2016, 11:11 +0200 schrieb Jürgen Spitzmüller:
>> * Refs dialog redesign:
>> http://www.lyx.org/trac/changeset/774becf6/lyxgit
>> http://www.lyx.org/trac/changeset/47ea77a8/lyxgit
> Patch for this attached.

Also good. Thanks for all of this work.

Richard



Re: Candidates for stable

2016-10-21 Thread Richard Heck
On 10/21/2016 01:24 PM, Jürgen Spitzmüller wrote:
> Am Samstag, den 15.10.2016, 11:11 +0200 schrieb Jürgen Spitzmüller:
>> * Citation dialog redesign:
>> http://www.lyx.org/trac/changeset/824e24ca/lyxgit
>> http://www.lyx.org/trac/changeset/5225418d/lyxgit
>> http://www.lyx.org/trac/changeset/0c1a023c/lyxgit
>>
>> * Keep citation style settings both within and between sessions
>> (#10256): 
>> http://www.lyx.org/trac/changeset/3294b16b/lyxgit
> Combined patch for these fixes attached.

Good.

rh



Re: [LyX/master] Fix Ticket #9741 misleading name for font-encoding setting "default".

2016-10-21 Thread Guenter Milde
On 2016-10-21, Enrico Forestieri wrote:
> On Fri, Oct 21, 2016 at 12:05:00PM +0200, Jürgen Spitzmüller wrote:
>> 2016-10-21 11:43 GMT+02:00 Guenter Milde :


>> I'd prefer something such as "Class Defaults"

> I think that the old "None (no fontenc)" was more than adequate.
> This tells that *LyX* is not going to select any encoding.

However, it was inconsistent. The same fibt dialog uses [Default] when LyX is
not going to select any font. Also the internal name is "default".



We have the variable "fontenc" (in the *.lyx file called "\fontencoding")
with:

value  old GUI name  Action
== = 
global Default   depends on lyxrc.fontenc
 (default is equal to custom with  T1)
¹ Custominsert \usepackage[]{fontenc}
 in document-preamble
defaultNone (no fontenc) insert macro definitions missing in OT1
 in document preamble to get working quotes

¹ is a comma separated list of TeX font encodings (cf `texdoc
 encguide.pdf`)

...

> For that goal, I would have suggested to simply change "Default"
> to "LyX Default". I don't have any idea of what is meant for
> "Global Default".

Global Default is just a merge of the internal name and the previous GUI
name for consistency with the previous name and with the other names
of this dialogue. "LyX Default" would be OK, too.
Also, there is a suggestion to remove the global setting alltogether (see
Jean-Marcs comment).

> Such controversial changes should not be performed without discussion.

I did not expect controversy after 14 months without any response to the bug
report.


So my updated proposal is

value  new GUI name
== =
global LyX Default   # eventually remove this value and lyxrc.fontenc
¹ Custom
defaultClass Default # or LaTeX Default

with a short explanation in the tooltip and full description in
the Guide.

Günter



Re: Candidates for stable

2016-10-21 Thread Jürgen Spitzmüller
Am Samstag, den 15.10.2016, 11:11 +0200 schrieb Jürgen Spitzmüller:
> * Refs dialog redesign:
> http://www.lyx.org/trac/changeset/774becf6/lyxgit
> http://www.lyx.org/trac/changeset/47ea77a8/lyxgit

Patch for this attached.

Jürgendiff --git a/src/frontends/qt4/GuiRef.cpp b/src/frontends/qt4/GuiRef.cpp
index 0d21387..3bb8988 100644
--- a/src/frontends/qt4/GuiRef.cpp
+++ b/src/frontends/qt4/GuiRef.cpp
@@ -13,6 +13,8 @@
 
 #include "GuiRef.h"
 
+#include "GuiApplication.h"
+
 #include "Buffer.h"
 #include "BufferList.h"
 #include "FuncRequest.h"
@@ -48,6 +50,26 @@ GuiRef::GuiRef(GuiView & lv)
 
 	at_ref_ = false;
 
+	// The filter bar
+	filter_ = new FancyLineEdit(this);
+#if QT_VERSION >= 0x040600
+	filter_->setButtonPixmap(FancyLineEdit::Right, getPixmap("images/", "editclear", "svgz,png"));
+	filter_->setButtonVisible(FancyLineEdit::Right, true);
+	filter_->setButtonToolTip(FancyLineEdit::Right, qt_("Clear text"));
+	filter_->setAutoHideButton(FancyLineEdit::Right, true);
+#endif
+#if QT_VERSION >= 0x040700
+	filter_->setPlaceholderText(qt_("All available labels"));
+#endif
+	filter_->setToolTip(qt_("Enter string to filter the list of available labels"));
+
+	filterBarL->addWidget(filter_, 0);
+	findKeysLA->setBuddy(filter_);
+
+	sortingCO->addItem(qt_("By Occurrence"), "unsorted");
+	sortingCO->addItem(qt_("Alphabetically (Case-Insensitive)"), "nocase");
+	sortingCO->addItem(qt_("Alphabetically (Case-Sensitive)"), "case");
+
 	refsTW->setColumnCount(1);
 	refsTW->header()->setVisible(false);
 
@@ -60,9 +82,13 @@ GuiRef::GuiRef(GuiView & lv)
 	connect(typeCO, SIGNAL(activated(int)),
 		this, SLOT(changed_adaptor()));
 	connect(referenceED, SIGNAL(textChanged(QString)),
+		this, SLOT(refTextChanged(QString)));
+	connect(referenceED, SIGNAL(textChanged(QString)),
 		this, SLOT(changed_adaptor()));
-	connect(findLE, SIGNAL(textEdited(QString)),
+	connect(filter_, SIGNAL(textEdited(QString)),
 		this, SLOT(filterLabels()));
+	connect(filter_, SIGNAL(rightButtonClicked()),
+		this, SLOT(resetFilter()));
 	connect(csFindCB, SIGNAL(clicked()),
 		this, SLOT(filterLabels()));
 	connect(nameED, SIGNAL(textChanged(QString)),
@@ -73,10 +99,8 @@ GuiRef::GuiRef(GuiView & lv)
 		this, SLOT(selectionChanged()));
 	connect(refsTW, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),
 		this, SLOT(refSelected(QTreeWidgetItem *)));
-	connect(sortCB, SIGNAL(clicked()),
+	connect(sortingCO, SIGNAL(activated(int)),
 		this, SLOT(sortToggled()));
-	connect(caseSensitiveCB, SIGNAL(clicked()),
-		this, SLOT(caseSensitiveToggled()));
 	connect(groupCB, SIGNAL(clicked()),
 		this, SLOT(groupToggled()));
 	connect(gotoPB, SIGNAL(clicked()),
@@ -167,6 +191,14 @@ void GuiRef::refHighlighted(QTreeWidgetItem * sel)
 }
 
 
+void GuiRef::refTextChanged(QString const & str)
+{
+	gotoPB->setEnabled(!str.isEmpty());
+	typeCO->setEnabled(!str.isEmpty());
+	typeLA->setEnabled(!str.isEmpty());
+}
+
+
 void GuiRef::refSelected(QTreeWidgetItem * sel)
 {
 	if (isBufferReadonly())
@@ -191,13 +223,6 @@ void GuiRef::refSelected(QTreeWidgetItem * sel)
 
 void GuiRef::sortToggled()
 {
-	caseSensitiveCB->setEnabled(sortCB->isChecked());
-	redoRefs();
-}
-
-
-void GuiRef::caseSensitiveToggled()
-{
 	redoRefs();
 }
 
@@ -270,7 +295,7 @@ void GuiRef::updateContents()
 
 	int const thebuffer = theBufferList().bufferNum(buffer().fileName());
 	// restore the buffer combo setting for new insets
-	if (params_["reference"].empty() && restored_buffer_ != -1
+	if (new_inset && restored_buffer_ != -1
 	&& restored_buffer_ < bufferCO->count() && thebuffer == active_buffer_)
 		bufferCO->setCurrentIndex(restored_buffer_);
 	else {
@@ -316,16 +341,14 @@ bool GuiRef::typeAllowed()
 void GuiRef::setGoBack()
 {
 	gotoPB->setText(qt_(" Back"));
-	gotoPB->setToolTip("");
-	gotoPB->setToolTip(qt_("Jump back"));
+	gotoPB->setToolTip(qt_("Jump back to the original cursor location"));
 }
 
 
 void GuiRef::setGotoRef()
 {
 	gotoPB->setText(qt_(" to Label"));
-	gotoPB->setToolTip("");
-	gotoPB->setToolTip(qt_("Jump to label"));
+	gotoPB->setToolTip(qt_("Jump to the selected label"));
 }
 
 
@@ -392,13 +415,14 @@ void GuiRef::redoRefs()
 	if (noprefix)
 		refsCategories.insert(0, qt_(""));
 
-	if (sortCB->isEnabled() && sortCB->isChecked()) {
-		if(caseSensitiveCB->isEnabled() && caseSensitiveCB->isChecked())
-			qSort(refsStrings.begin(), refsStrings.end());
-		else
-			qSort(refsStrings.begin(), refsStrings.end(),
-			  caseInsensitiveLessThan /*defined above*/);
-	}
+	QString const sort = sortingCO->isEnabled() ?
+sortingCO->itemData(sortingCO->currentIndex()).toString()
+: QString();
+	if (sort == "nocase")
+		qSort(refsStrings.begin(), refsStrings.end(),
+		  caseInsensitiveLessThan /*defined above*/);
+	else if (sort == "case")
+		qSort(refsStrings.begin(), refsStrings.end());
 
 	if (groupCB->isChecked()) {
 		QList refsCats;
@@ -459,6 +483,10 @@ void GuiRef::redoRefs()
 	// Re-activate the emission of signals by these widgets.
 	

Re: Candidates for stable

2016-10-21 Thread Jürgen Spitzmüller
Am Samstag, den 15.10.2016, 11:11 +0200 schrieb Jürgen Spitzmüller:
> * Citation dialog redesign:
> http://www.lyx.org/trac/changeset/824e24ca/lyxgit
> http://www.lyx.org/trac/changeset/5225418d/lyxgit
> http://www.lyx.org/trac/changeset/0c1a023c/lyxgit
> 
> * Keep citation style settings both within and between sessions
> (#10256): 
> http://www.lyx.org/trac/changeset/3294b16b/lyxgit

Combined patch for these fixes attached.

Jürgendiff --git a/src/frontends/qt4/GuiCitation.cpp b/src/frontends/qt4/GuiCitation.cpp
index 44118c7..872d304 100644
--- a/src/frontends/qt4/GuiCitation.cpp
+++ b/src/frontends/qt4/GuiCitation.cpp
@@ -16,6 +16,7 @@
 
 #include "GuiCitation.h"
 
+#include "GuiApplication.h"
 #include "GuiSelectionManager.h"
 #include "LyXToolBox.h"
 #include "qt_helpers.h"
@@ -34,6 +35,7 @@
 #include "support/lstrings.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -93,6 +95,36 @@ GuiCitation::GuiCitation(GuiView & lv)
 {
 	setupUi(this);
 
+	// The filter bar
+	filter_ = new FancyLineEdit(this);
+#if QT_VERSION >= 0x040600
+	filter_->setButtonPixmap(FancyLineEdit::Right, getPixmap("images/", "editclear", "svgz,png"));
+	filter_->setButtonVisible(FancyLineEdit::Right, true);
+	filter_->setButtonToolTip(FancyLineEdit::Right, qt_("Clear text"));
+	filter_->setAutoHideButton(FancyLineEdit::Right, true);
+#endif
+#if QT_VERSION >= 0x040700
+	filter_->setPlaceholderText(qt_("All avail. citations"));
+#endif
+
+	filterBarL->addWidget(filter_, 0);
+	findKeysLA->setBuddy(filter_);
+
+	// Add search options as button menu
+	regexp_ = new QAction(qt_("Regular e"), this);
+	regexp_->setCheckable(true);
+	casesense_ = new QAction(qt_("Case se"), this);
+	casesense_->setCheckable(true);
+	instant_ = new QAction(qt_("Search as you "), this);
+	instant_->setCheckable(true);
+	instant_->setChecked(true);
+
+	QMenu * searchOpts = new QMenu(this);
+	searchOpts->addAction(regexp_);
+	searchOpts->addAction(casesense_);
+	searchOpts->addAction(instant_);
+	searchOptionsPB->setMenu(searchOpts);
+
 	connect(citationStyleCO, SIGNAL(activated(int)),
 		this, SLOT(on_citationStyleCO_currentIndexChanged(int)));
 	connect(fulllistCB, SIGNAL(clicked()),
@@ -103,8 +135,6 @@ GuiCitation::GuiCitation(GuiView & lv)
 		this, SLOT(updateStyles()));
 	connect(textAfterED, SIGNAL(textChanged(QString)),
 		this, SLOT(updateStyles()));
-	connect(findLE, SIGNAL(returnPressed()),
-		this, SLOT(on_searchPB_clicked()));
 	connect(textBeforeED, SIGNAL(returnPressed()),
 		this, SLOT(on_okPB_clicked()));
 	connect(textAfterED, SIGNAL(returnPressed()),
@@ -119,7 +149,20 @@ GuiCitation::GuiCitation(GuiView & lv)
 	connect(selectionManager, SIGNAL(okHook()),
 		this, SLOT(on_okPB_clicked()));
 
-	setFocusProxy(availableLV);
+	connect(filter_, SIGNAL(rightButtonClicked()),
+		this, SLOT(resetFilter()));
+	connect(filter_, SIGNAL(textEdited(QString)),
+		this, SLOT(filterChanged(QString)));
+	connect(filter_, SIGNAL(returnPressed()),
+		this, SLOT(filterPressed()));
+	connect(regexp_, SIGNAL(triggered()),
+		this, SLOT(regexChanged()));
+	connect(casesense_, SIGNAL(triggered()),
+		this, SLOT(caseChanged()));
+	connect(instant_, SIGNAL(triggered(bool)),
+		this, SLOT(instantChanged(bool)));
+
+	setFocusProxy(filter_);
 }
 
 
@@ -152,42 +195,12 @@ void GuiCitation::applyView()
 
 void GuiCitation::showEvent(QShowEvent * e)
 {
-	findLE->clear();
+	filter_->clear();
 	availableLV->setFocus();
-
-	// Set the minimal size of the QToolbox. Without this, the size of the
-	// QToolbox is only determined by values in the ui file (e.g. computed by
-	// qtcreator) and therefore causes portability and localisation issues. Note
-	// that the page widgets must have a layout with layoutSizeContraint =
-	// SetMinimumSize or similar.  KNOWN ISSUE: the calculations are incorrect
-	// the first time the dialog is shown. This problem is mitigated by the fact
-	// that LyX remembers the dialog sizes between sessions.
-	QSize minimum_size = QSize(0,0);
-	// Compute the max of the minimal sizes of the pages
-	QWidget * page;
-	for (int i = 0; (page = citationTB->widget(i)); ++i)
-		minimum_size = minimum_size.expandedTo(page->minimumSizeHint());
-	// Add the height of the tabs
-	if (citationTB->currentWidget())
-		minimum_size.rheight() += citationTB->height() -
-			citationTB->currentWidget()->height();
-	citationTB->setMinimumSize(minimum_size);
-
 	DialogView::showEvent(e);
 }
 
 
-void GuiCitation::on_citationTB_currentChanged(int i)
-{
-	if (i == 0)
-		findLE->setFocus();
-	else if (citationStyleCO->isEnabled())
-		citationStyleCO->setFocus();
-	else
-		textAfterED->setFocus();
-}
-
-
 void GuiCitation::on_okPB_clicked()
 {
 	applyView();
@@ -212,6 +225,7 @@ void GuiCitation::on_applyPB_clicked()
 void GuiCitation::on_restorePB_clicked()
 {
 	init();
+	updateFilterHint();
 }
 
 
@@ -355,9 +369,11 @@ void GuiCitation::updateInfo(BiblioInfo const & bi, QModelIndex const & idx)
 {
 	if (!idx.isValid() || bi.empty()) {
 		infoML->document()->clear();
+		

Re: Candidates for stable

2016-10-21 Thread Richard Heck
On 10/21/2016 12:47 PM, Jürgen Spitzmüller wrote:
> Am Samstag, den 15.10.2016, 11:11 +0200 schrieb Jürgen Spitzmüller:
>> * Fix label display in linguistic examples: 
>> http://www.lyx.org/trac/changeset/91f5d909/lyxgit
> Attached a patch for this one.

OK.

rh




Re: Candidates for stable

2016-10-21 Thread Jürgen Spitzmüller
Am Samstag, den 15.10.2016, 11:11 +0200 schrieb Jürgen Spitzmüller:
> * Fix label display in linguistic examples: 
> http://www.lyx.org/trac/changeset/91f5d909/lyxgit

Attached a patch for this one.

Jürgendiff --git a/lib/layouts/linguistics.module b/lib/layouts/linguistics.module
index c2f3df1..5c72882 100644
--- a/lib/layouts/linguistics.module
+++ b/lib/layouts/linguistics.module
@@ -9,6 +9,29 @@
 
 Format 60
 
+# These are no real counters, but they are needed
+# to get proper labels for the enumerate-like
+# example styles.
+Counter example
+	Within   chapter
+	LabelString  "Examples:"
+End
+
+Counter examplei
+	Within   chapter
+	LabelString  "Examples:"
+End
+
+Counter subexample
+	Within   examplei
+	LabelString  "Subexample:"
+End
+
+Counter subexamplei
+	Within   examplei
+	LabelString  "Subexample:"
+End
+
 # single numbered example with covington.sty
 Style Numbered_Example_(multiline)
 	LatexType Environment
@@ -46,7 +69,8 @@ Style Numbered_Examples_(consecutive)
 	CopyStyle	  Numbered_Example_(multiline)
 	LatexType Item_Environment
 	LatexName covexamples
-	LabelString   "Examples:"
+	LabelType Enumerate
+	LabelCounter  "example"
 	Argument item:1
 		LabelString   "Custom Numbering|s"
 		Tooltip   "Customize the numeration"
@@ -65,7 +89,7 @@ End
 Style Subexample
 	CopyStyle	  Numbered_Examples_(consecutive)
 	LatexName subexample
-	LabelString   "Subexample:"
+	LabelCounter  "subexample"
 	Requires	  covington,enumitem
 	Preamble
 		\newenvironment{subexample}{%


signature.asc
Description: This is a digitally signed message part


Re: [LyX/master] Update local boost version to version 1.62

2016-10-21 Thread Richard Heck
On 10/21/2016 09:41 AM, Jean-Marc Lasgouttes wrote:
> Le 19/10/2016 à 17:37, Jean-Marc Lasgouttes a écrit :
>> commit 46c6f4de670ac1f930542ca2bd967e5bb6fba940
>> Author: Jean-Marc Lasgouttes 
>> Date:   Wed Oct 19 17:31:54 2016 +0200
>>
>> Update local boost version to version 1.62
>>
>> This avoids some warnings with gcc6.
>
> Hello Richard,
>
> What shall we do about 2.2.x? The warnings with gcc 6 are annoying, so
> I guess we will eventually have to update for branch.

They are indeed annoying. This seems a good time to do it for stable,
since we just did a release and have lots of time for testing.

Richard



Re: Some inset offset fine tuning

2016-10-21 Thread racoon

On 21.10.2016 16:29, Jean-Marc Lasgouttes wrote:

Le 21/10/2016 à 16:18, racoon a écrit :

Just an update of the fix. No work done on the scaling yet or other
insets yet. But I realised that the cursor takes the space of the first
pixels of the character. So the space between insets has at least to be
two rather than one pixel wide. I have also attached my test file. I
have tested an measured now without anti-aliasing.


A question: I still see some 1 pixel explicit offset. What is it?
Cursor? Note that cursor width can be tuned in the preferences.


No it is not the cursor with. The cursor just takes the space of the 
first pixels of the character.


Here are some independent considerations.

One choice that has to be made is whether the insets should be treated 
exactly like characters, i.e. the cursor starts directly at the edge 
(not before) the inset when you put the cursor at the inset so that 
typing would insert characters before the inset. If this is done then 
the cursor is hard to see when the frame of an inset is darkish. That is 
why I opted for putting it one pixel before the inset. But if the insets 
should be treated as characters this seems not exactly right. So 
alternatively, one could go for an inverted cursor rather than a black one.



Even if scaling is not  in scope yet, it would be nice to understand
what each pixel value is and how it should scale. For example, I tend to
think that al borders (default width) should have a scalable width.
Maybe cursor too.


Yes, I don't understand the connections extra pixels yet. But I'll make 
sure to either comment in the source when I do or replace them with 
proper variables.


Daniel


Re: Some inset offset fine tuning

2016-10-21 Thread Jean-Marc Lasgouttes

Le 21/10/2016 à 16:18, racoon a écrit :

Just an update of the fix. No work done on the scaling yet or other
insets yet. But I realised that the cursor takes the space of the first
pixels of the character. So the space between insets has at least to be
two rather than one pixel wide. I have also attached my test file. I
have tested an measured now without anti-aliasing.


A question: I still see some 1 pixel explicit offset. What is it? 
Cursor? Note that cursor width can be tuned in the preferences.


Even if scaling is not  in scope yet, it would be nice to understand 
what each pixel value is and how it should scale. For example, I tend to 
think that al borders (default width) should have a scalable width. 
Maybe cursor too.


JMarc


Re: Some inset offset fine tuning

2016-10-21 Thread racoon
Just an update of the fix. No work done on the scaling yet or other 
insets yet. But I realised that the cursor takes the space of the first 
pixels of the character. So the space between insets has at least to be 
two rather than one pixel wide. I have also attached my test file. I 
have tested an measured now without anti-aliasing.
From 06e40ada85c13ea22c4ea484f338fdf7cefef57e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Ram=C3=83=3F=C3=82=C2=B6ller?= 
Date: Mon, 17 Oct 2016 01:21:01 +0200
Subject: [PATCH] Some inset offset fine tuning: - Make outer inset offset
 independent of inner. - Reduced the outer offset.

---
 src/frontends/qt4/GuiFontMetrics.cpp |  4 ++--
 src/frontends/qt4/GuiPainter.cpp |  6 +++---
 src/insets/Inset.h   |  6 +-
 src/insets/InsetText.cpp | 13 -
 4 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/src/frontends/qt4/GuiFontMetrics.cpp 
b/src/frontends/qt4/GuiFontMetrics.cpp
index eade8cc..43cf0d1 100644
--- a/src/frontends/qt4/GuiFontMetrics.cpp
+++ b/src/frontends/qt4/GuiFontMetrics.cpp
@@ -254,7 +254,7 @@ void GuiFontMetrics::rectText(docstring const & str,
 {
static int const d = Inset::TEXT_TO_INSET_OFFSET / 2;
 
-   w = width(str) + Inset::TEXT_TO_INSET_OFFSET;
+   w = Inset::TEXT_TO_INSET_OFFSET_INSIDE + width(str) + 
Inset::TEXT_TO_INSET_OFFSET_INSIDE;
ascent = metrics_.ascent() + d;
descent = metrics_.descent() + d;
 }
@@ -265,7 +265,7 @@ void GuiFontMetrics::buttonText(docstring const & str,
int & w, int & ascent, int & descent) const
 {
rectText(str, w, ascent, descent);
-   w += Inset::TEXT_TO_INSET_OFFSET;
+   w += 2 * Inset::TEXT_TO_INSET_OFFSET_OUTSIDE;
 }
 
 
diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp
index e613f3f..1774939 100644
--- a/src/frontends/qt4/GuiPainter.cpp
+++ b/src/frontends/qt4/GuiPainter.cpp
@@ -593,10 +593,10 @@ void GuiPainter::buttonText(int x, int y, docstring const 
& str,
FontMetrics const & fm = theFontMetrics(font);
fm.buttonText(str, width, ascent, descent);
 
-   static int const d = Inset::TEXT_TO_INSET_OFFSET / 2;
+   static int const d = Inset::TEXT_TO_INSET_OFFSET_OUTSIDE;
 
-   button(x + d, y - ascent, width - Inset::TEXT_TO_INSET_OFFSET, descent 
+ ascent, mouseHover);
-   text(x + Inset::TEXT_TO_INSET_OFFSET, y, str, font);
+   button(x + d, y - ascent, width - 2 * d, descent + ascent, mouseHover);
+   text(x + Inset::TEXT_TO_INSET_OFFSET_INSIDE + 
Inset::TEXT_TO_INSET_OFFSET_OUTSIDE, y, str, font);
 }
 
 
diff --git a/src/insets/Inset.h b/src/insets/Inset.h
index 48ad7be..34ba4e9 100644
--- a/src/insets/Inset.h
+++ b/src/insets/Inset.h
@@ -574,7 +574,11 @@ public:
///
virtual ColorCode labelColor() const;
//
-   enum { TEXT_TO_INSET_OFFSET = 4 };
+   enum {
+   TEXT_TO_INSET_OFFSET = 4,
+   TEXT_TO_INSET_OFFSET_INSIDE = 2,
+   TEXT_TO_INSET_OFFSET_OUTSIDE = 1
+   };
 
 protected:
/// Constructors
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index df4f6e2..e3a18f1 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -208,7 +208,8 @@ void InsetText::metrics(MetricsInfo & mi, Dimension & dim) 
const
mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
dim.asc += TEXT_TO_INSET_OFFSET;
dim.des += TEXT_TO_INSET_OFFSET;
-   dim.wid += 2 * TEXT_TO_INSET_OFFSET;
+   // cursor position after inset
+   dim.wid += 2 * (TEXT_TO_INSET_OFFSET_INSIDE + 
TEXT_TO_INSET_OFFSET_OUTSIDE + 1);
 }
 
 
@@ -216,10 +217,10 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
 {
TextMetrics & tm = pi.base.bv->textMetrics(_);
 
-   int const w = tm.width() + TEXT_TO_INSET_OFFSET;
+   int const w = tm.width() + 2 * TEXT_TO_INSET_OFFSET_INSIDE + 1;
int const yframe = y - TEXT_TO_INSET_OFFSET - tm.ascent();
int const h = tm.height() + 2 * TEXT_TO_INSET_OFFSET;
-   int const xframe = x + TEXT_TO_INSET_OFFSET / 2;
+   int const xframe = x + TEXT_TO_INSET_OFFSET_OUTSIDE;
bool change_drawn = false;
if (drawFrame_ || pi.full_repaint) {
if (pi.full_repaint)
@@ -251,7 +252,8 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
pi.backgroundColor(this, false));
// The change tracking cue must not be inherited
Changer dummy2 = make_change(pi.change_, Change());
-   tm.draw(pi, x + TEXT_TO_INSET_OFFSET, y);
+   // text position within inset
+   tm.draw(pi, x + TEXT_TO_INSET_OFFSET_INSIDE + 
TEXT_TO_INSET_OFFSET_OUTSIDE + 1, y);
}
if (canPaintChange(*pi.base.bv) && (!change_drawn || 
pi.change_.deleted()))
// Do not draw the change tracking cue if already done by 
RowPainter and
@@ 

Re: [LyX/master] Fix Ticket #9741 misleading name for font-encoding setting "default".

2016-10-21 Thread Enrico Forestieri
On Fri, Oct 21, 2016 at 12:05:00PM +0200, Jürgen Spitzmüller wrote:
> 2016-10-21 11:43 GMT+02:00 Guenter Milde :
> 
> > Would it help to remove just the "OT1" leaving "TeX default, no fontenc"?
> > * texperts know the TeX default is OT1
> > * texpert know the default can be changed and fontenc (as any package) can
> >   be loaded by a package or class
> > * tex-ignorants will not be helped with "OT1".
> >
> 
> I'd prefer something such as "Class Defaults"

I think that the old "None (no fontenc)" was more than adequate.
This tells that *LyX* is not going to select any encoding.

> > My incentive was to clear the confusion with
> > != 
> > in a GUI dialog where otherwise "Default" stands for .
> >
> 
> 
> I understand your rationale, and agree.

For that goal, I would have suggested to simply change "Default"
to "LyX Default". I don't have any idea of what is meant for
"Global Default". Such controversial changes should not be performed
without discussion.

-- 
Enrico


Re: [LyX/master] Fix Ticket #9741 misleading name for font-encoding setting "default".

2016-10-21 Thread Jürgen Spitzmüller
2016-10-21 11:43 GMT+02:00 Guenter Milde :

> Would it help to remove just the "OT1" leaving "TeX default, no fontenc"?
> * texperts know the TeX default is OT1
> * texpert know the default can be changed and fontenc (as any package) can
>   be loaded by a package or class
> * tex-ignorants will not be helped with "OT1".
>

I'd prefer something such as "Class Defaults"

(note that we are using title casing in this context)


>
> My incentive was to clear the confusion with
> != 
> in a GUI dialog where otherwise "Default" stands for .
>


I understand your rationale, and agree.

Jürgen


>
> Maybe there is a better suggestion...
>
> Thanks,
> Günter
>
>


Re: [LyX/master] Fix Ticket #9741 misleading name for font-encoding setting "default".

2016-10-21 Thread Guenter Milde
Dear Jürgen, dear LyX developers,

On 2016-10-21, Jürgen Spitzmüller wrote:

> [-- Type: text/plain, Encoding: quoted-printable --]

> Am Freitag, den 21.10.2016, 09:12 +0200 schrieb Günter Milde:
>> +   fontModule->fontencCO->addItem(qt_("TeX default (OT1, no
>> fontenc)"), QString("default"));

> That's not necessarily true. It just means "don't load fontenc
> explicitly". The class (or a package) might load fontenc with something
> else than OT1.

> So the old string was more adequate.

We are in a predicament here:

a) fontenc=="default" ensures that LyX does not load fontenc.sty, even if
   LGR or T2A font encodings are required for Greek or Cyrillic letters.
   
b) you are right, the user preamble, a class or module may change the font
   encoding (with or without loading fontenc).

The situation is equivalent to "Default" font settings - LyX does not load a
font package or modify \rmdefault etc. Unfortunately, the old strings used
"Default" for "global Default" (which defaults to T1 and not the LaTeX
default).

Would it help to remove just the "OT1" leaving "TeX default, no fontenc"?
* texperts know the TeX default is OT1
* texpert know the default can be changed and fontenc (as any package) can
  be loaded by a package or class
* tex-ignorants will not be helped with "OT1".

My incentive was to clear the confusion with 
!=  
in a GUI dialog where otherwise "Default" stands for .

Maybe there is a better suggestion...

Thanks,
Günter



Re: [patch] Fix color when branch name has a space

2016-10-21 Thread Jean-Marc Lasgouttes

Le 21/10/2016 à 04:47, Scott Kostyshak a écrit :

Makes sense. I'll work on a better patch.


Is the attached what you meant? If so I would audit the other calls to
LFUN_SET_COLOR.


Yes, I think so. Note that the double quotes are not really part of the 
syntax, they can be omitted as before. They are just useful as they are 
in bash scripting.


As for the annoying code to build the command line, I'd say it would be 
nice to have some helpers like FuncRequuest::addArg(std::string) or 
something like that. Maybe using operator<<.


The idea would be to tend to some API where the actual syntax of the 
lfun does not matter that much.


I do not know where I am going with these remarks, but the idea is that, 
if we had a proper syntax, we would be in a position to do some better 
scripting, for example. Or just change syntax.


JMarc



Re: [LyX/master] Fix Ticket #9741 misleading name for font-encoding setting "default".

2016-10-21 Thread Jürgen Spitzmüller
Am Freitag, den 21.10.2016, 09:12 +0200 schrieb Günter Milde:
> +   fontModule->fontencCO->addItem(qt_("TeX default (OT1, no
> fontenc)"), QString("default"));

That's not necessarily true. It just means "don't load fontenc
explicitly". The class (or a package) might load fontenc with something
else than OT1.

So the old string was more adequate.

Jürgen

signature.asc
Description: This is a digitally signed message part


please change subject line (was: [PATCH] Re: Return + Return in nested environments)

2016-10-21 Thread Guenter Milde
As a courtesy to the list members interested in Return + Return but not
mailbox problems, could you please use a more telling subject line?

Thanks,

Günter