From 3932a25aa2571f2ca1fa4e35bca8d357d2493716 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Mon, 8 Jun 2015 08:43:00 +0200 Subject: [PATCH] Also include the result list header fragment in the snippets window header. Add "class" attributes "respar" and "snippets" to the tables to enable selection if needed. --- src/doc/user/usermanual.xml | 58 +++++++++++++++++++++++-------------- src/qtgui/guiutils.cpp | 11 ++++--- src/qtgui/snippets_w.cpp | 3 +- src/qtgui/uiprefs.ui | 3 ++ 4 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/doc/user/usermanual.xml b/src/doc/user/usermanual.xml index fc61a548..0dbb276b 100644 --- a/src/doc/user/usermanual.xml +++ b/src/doc/user/usermanual.xml @@ -1464,7 +1464,7 @@ fs.inotify.max_user_watches=32768 current result. I can't remember a single instance where this function was actually useful to me... - The Open Snippets Window entry will only + The Open Snippets Window entry will only appear for documents which support page breaks (typically PDF, Postscript, DVI). The snippets window lists extracts from the document, taken around search terms occurrences, along with the @@ -2615,29 +2615,39 @@ MimeType=*/* The result list format - The result list presentation can be exhaustively customized - by adjusting two elements: - - The paragraph format - HTML code inside the header - section - - - These can be edited from the Result list - tab of the GUI configuration. - - Newer versions of Recoll (from 1.17) use a WebKit HTML - object by default (this may be disabled at build time), and - total customisation is possible with full support for CSS and + Newer versions of Recoll (from 1.17) normally use WebKit HTML + widgets for the result list and the + + snippets window (this may be disabled at build time). + Total customisation is possible with full support for CSS and Javascript. Conversely, there are limits to what you can do with the older Qt QTextBrowser, but still, it is possible to decide what data each result will contain, and how it will be displayed. - No more detail will be given about the header part (only - useful with the WebKit build), if there are restrictions to - what you can do, they are beyond this author's HTML/CSS/Javascript - abilities... There are a few examples on the + The result list presentation can be exhaustively customized + by adjusting two elements: + + + The paragraph format + HTML code inside the header section. For + versions 1.21 and later, this is also used for the + + snippets window + + The paragraph format and the header fragment can be edited + from the Result list tab of the + GUI configuration. + + + The header fragment is used both for the result list and + the snippets window. The snippets list is a table and has a + snippets class attribute. Each paragraph in + the result list is a table, with class + respar, but this can be changed by editing + the paragraph format. + + There are a few examples on the page about customising the result list on the &RCL; web site. @@ -2733,9 +2743,13 @@ MimeType=*/* The default value for the paragraph format string is: %R %S %L   %T
-%M %D   %U %i
-%A %K + "\n" + "\n" + "\n" + "\n" + "
%L  %S   %T
\n" + "%M %D    %U %i
\n" + "%A %K
\n" ]]>
You may, for example, try the following for a more web-like diff --git a/src/qtgui/guiutils.cpp b/src/qtgui/guiutils.cpp index b18a2948..79493ded 100644 --- a/src/qtgui/guiutils.cpp +++ b/src/qtgui/guiutils.cpp @@ -40,10 +40,13 @@ RclConfig *theconfig; // qt 4.6 qtextedit to clear the margins after the float img without // introducing blank space. const char *PrefsPack::dfltResListFormat = - "" - "
%L  %S   %T
" - "%M %D    %U %i
" - "%A %K
" + "\n" + "\n" + "\n" + "\n" + "
%L  %S   %T
\n" + "%M %D    %U %i
\n" + "%A %K
\n" ; // The global preferences structure diff --git a/src/qtgui/snippets_w.cpp b/src/qtgui/snippets_w.cpp index 53e070f1..4672fef8 100644 --- a/src/qtgui/snippets_w.cpp +++ b/src/qtgui/snippets_w.cpp @@ -151,11 +151,12 @@ void SnippetsW::init() oss << "\n"; + oss << qs2utf8s(prefs.reslistheadertext); oss << "" "" - "" + "
" ; g_hiliter.set_inputhtml(false); diff --git a/src/qtgui/uiprefs.ui b/src/qtgui/uiprefs.ui index cb580bff..122649aa 100644 --- a/src/qtgui/uiprefs.ui +++ b/src/qtgui/uiprefs.ui @@ -461,6 +461,9 @@ + + User style to apply to the snippets window.<br> Note: the result page header insert is also included in the snippets window header. + Snippets window CSS file