allow setting query term highlight color in prefs
This commit is contained in:
parent
2494ac6b50
commit
9f12b2df5e
@ -24,7 +24,7 @@
|
|||||||
Dockes</holder>
|
Dockes</holder>
|
||||||
</copyright>
|
</copyright>
|
||||||
|
|
||||||
<releaseinfo>$Id: usermanual.sgml,v 1.60 2008-01-17 11:13:47 dockes Exp $</releaseinfo>
|
<releaseinfo>$Id: usermanual.sgml,v 1.61 2008-05-05 20:28:34 dockes Exp $</releaseinfo>
|
||||||
|
|
||||||
<abstract>
|
<abstract>
|
||||||
<para>This document introduces full text search notions
|
<para>This document introduces full text search notions
|
||||||
@ -1337,6 +1337,15 @@ fvwm
|
|||||||
page</guilabel></para>
|
page</guilabel></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem><para><guilabel>Highlight color for query
|
||||||
|
terms</guilabel>
|
||||||
|
Terms from the user query are highlighted in the result
|
||||||
|
list samples and the preview window. The color can be
|
||||||
|
chosen here. Any QT color string should work
|
||||||
|
(ie <literal>red</literal>, <literal>#ff0000</literal>). The
|
||||||
|
default is <literal>blue</literal>.</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem><para><guilabel>Result list font</guilabel>: There
|
<listitem><para><guilabel>Result list font</guilabel>: There
|
||||||
is quite a lot of information shown in the result list, and
|
is quite a lot of information shown in the result list, and
|
||||||
you may want to customize the font and/or font size. The rest
|
you may want to customize the font and/or font size. The rest
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.35 2007-09-08 17:25:49 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
static char rcsid[] = "@(#$Id: guiutils.cpp,v 1.36 2008-05-05 20:24:55 dockes Exp $ (C) 2005 Jean-Francois Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -186,6 +186,10 @@ void rwSettings(bool writing)
|
|||||||
"/Recoll/prefs/ssearchAutoPhrase", Bool, false);
|
"/Recoll/prefs/ssearchAutoPhrase", Bool, false);
|
||||||
SETTING_RW(prefs.respagesize, "/Recoll/prefs/reslist/pagelen", Num, 8);
|
SETTING_RW(prefs.respagesize, "/Recoll/prefs/reslist/pagelen", Num, 8);
|
||||||
SETTING_RW(prefs.maxhltextmbs, "/Recoll/prefs/preview/maxhltextmbs", Num, 3);
|
SETTING_RW(prefs.maxhltextmbs, "/Recoll/prefs/preview/maxhltextmbs", Num, 3);
|
||||||
|
SETTING_RW(prefs.qtermcolor, "/Recoll/prefs/qtermcolor", , "blue");
|
||||||
|
if (!writing && prefs.qtermcolor == "")
|
||||||
|
prefs.qtermcolor = "blue";
|
||||||
|
|
||||||
SETTING_RW(prefs.reslistfontfamily, "/Recoll/prefs/reslist/fontFamily", ,
|
SETTING_RW(prefs.reslistfontfamily, "/Recoll/prefs/reslist/fontFamily", ,
|
||||||
"");
|
"");
|
||||||
SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Num,
|
SETTING_RW(prefs.reslistfontsize, "/Recoll/prefs/reslist/fontSize", Num,
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
#ifndef _GUIUTILS_H_INCLUDED_
|
#ifndef _GUIUTILS_H_INCLUDED_
|
||||||
#define _GUIUTILS_H_INCLUDED_
|
#define _GUIUTILS_H_INCLUDED_
|
||||||
/*
|
/*
|
||||||
* @(#$Id: guiutils.h,v 1.25 2007-09-08 17:25:49 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
* @(#$Id: guiutils.h,v 1.26 2008-05-05 20:24:55 dockes Exp $ (C) 2005 Jean-Francois Dockes
|
||||||
* jean-francois.dockes@wanadoo.fr
|
* jean-francois.dockes@wanadoo.fr
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -65,6 +65,7 @@ class PrefsPack {
|
|||||||
int respagesize;
|
int respagesize;
|
||||||
int maxhltextmbs;
|
int maxhltextmbs;
|
||||||
QString reslistfontfamily;
|
QString reslistfontfamily;
|
||||||
|
QString qtermcolor; // Color for query terms in reslist and preview
|
||||||
int reslistfontsize;
|
int reslistfontsize;
|
||||||
// Result list format string
|
// Result list format string
|
||||||
QString reslistformat;
|
QString reslistformat;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.32 2008-04-18 11:38:56 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: preview_w.cpp,v 1.33 2008-05-05 20:24:55 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -880,7 +880,7 @@ bool Preview::loadFileInCurrentTab(string fn, size_t sz, const Rcl::Doc &idoc,
|
|||||||
if (highlightTerms) {
|
if (highlightTerms) {
|
||||||
QStyleSheetItem *item =
|
QStyleSheetItem *item =
|
||||||
new QStyleSheetItem(editor->styleSheet(), "termtag" );
|
new QStyleSheetItem(editor->styleSheet(), "termtag" );
|
||||||
item->setColor("blue");
|
item->setColor(prefs.qtermcolor);
|
||||||
item->setFontWeight(QFont::Bold);
|
item->setFontWeight(QFont::Bold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.37 2008-05-05 16:38:43 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: reslist.cpp,v 1.38 2008-05-05 20:24:55 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -347,7 +347,7 @@ void ResList::resultPageNext()
|
|||||||
|
|
||||||
// Query term colorization
|
// Query term colorization
|
||||||
QStyleSheetItem *item = new QStyleSheetItem(styleSheet(), "termtag" );
|
QStyleSheetItem *item = new QStyleSheetItem(styleSheet(), "termtag" );
|
||||||
item->setColor("blue");
|
item->setColor(prefs.qtermcolor);
|
||||||
|
|
||||||
// Result paragraph format
|
// Result paragraph format
|
||||||
string sformat = string(prefs.reslistformat.utf8());
|
string sformat = string(prefs.reslistformat.utf8());
|
||||||
|
|||||||
@ -90,6 +90,35 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</hbox>
|
</hbox>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLayoutWidget">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>qtermcolor</cstring>
|
||||||
|
</property>
|
||||||
|
<hbox>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>unnamed</cstring>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>textLabelqtc</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Highlight color for query terms</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>qtermColorLE</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</hbox>
|
||||||
|
</widget>
|
||||||
<widget class="QLayoutWidget">
|
<widget class="QLayoutWidget">
|
||||||
<property name="name">
|
<property name="name">
|
||||||
<cstring>layout24</cstring>
|
<cstring>layout24</cstring>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.23 2007-12-04 10:16:52 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.24 2008-05-05 20:24:55 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -106,6 +106,9 @@ void UIPrefsDialog::setFromPrefs()
|
|||||||
useDesktopOpenCB->setChecked(prefs.useDesktopOpen);
|
useDesktopOpenCB->setChecked(prefs.useDesktopOpen);
|
||||||
keepSortCB->setChecked(prefs.keepSort);
|
keepSortCB->setChecked(prefs.keepSort);
|
||||||
|
|
||||||
|
// Query terms color
|
||||||
|
qtermColorLE->setText(prefs.qtermcolor);
|
||||||
|
|
||||||
// Result list font family and size
|
// Result list font family and size
|
||||||
reslistFontFamily = prefs.reslistfontfamily;
|
reslistFontFamily = prefs.reslistfontfamily;
|
||||||
reslistFontSize = prefs.reslistfontsize;
|
reslistFontSize = prefs.reslistfontsize;
|
||||||
@ -171,6 +174,7 @@ void UIPrefsDialog::accept()
|
|||||||
prefs.respagesize = pageLenSB->value();
|
prefs.respagesize = pageLenSB->value();
|
||||||
prefs.maxhltextmbs = maxHLTSB->value();
|
prefs.maxhltextmbs = maxHLTSB->value();
|
||||||
|
|
||||||
|
prefs.qtermcolor = qtermColorLE->text();
|
||||||
prefs.reslistfontfamily = reslistFontFamily;
|
prefs.reslistfontfamily = reslistFontFamily;
|
||||||
prefs.reslistfontsize = reslistFontSize;
|
prefs.reslistfontsize = reslistFontSize;
|
||||||
prefs.reslistformat = rlfTE->text();
|
prefs.reslistformat = rlfTE->text();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user