fix result table display in dark mode
This commit is contained in:
parent
199abb9980
commit
a6c53ff651
@ -556,7 +556,8 @@ python/samples/recollqsd.py \
|
|||||||
\
|
\
|
||||||
sampleconf/fields sampleconf/fragbuts.xml sampleconf/mimeconf \
|
sampleconf/fields sampleconf/fragbuts.xml sampleconf/mimeconf \
|
||||||
sampleconf/mimemap sampleconf/mimeview sampleconf/mimeview.mac \
|
sampleconf/mimemap sampleconf/mimeview sampleconf/mimeview.mac \
|
||||||
sampleconf/recoll.conf sampleconf/recoll.qss sampleconf/recoll-dark.qss \
|
sampleconf/recoll.conf sampleconf/recoll.qss \
|
||||||
|
sampleconf/recoll-dark.qss sampleconf/recoll-dark.css \
|
||||||
\
|
\
|
||||||
testmains/Makefile.am \
|
testmains/Makefile.am \
|
||||||
\
|
\
|
||||||
@ -645,6 +646,8 @@ sampleconf/fields \
|
|||||||
sampleconf/recoll.conf \
|
sampleconf/recoll.conf \
|
||||||
sampleconf/mimeconf \
|
sampleconf/mimeconf \
|
||||||
sampleconf/recoll.qss \
|
sampleconf/recoll.qss \
|
||||||
|
sampleconf/recoll-dark.qss \
|
||||||
|
sampleconf/recoll-dark.css \
|
||||||
sampleconf/mimemap \
|
sampleconf/mimemap \
|
||||||
sampleconf/mimeview
|
sampleconf/mimeview
|
||||||
|
|
||||||
@ -754,7 +757,7 @@ dist_man5_MANS = doc/man/recoll.conf.5
|
|||||||
dist-hook:
|
dist-hook:
|
||||||
(cd $(top_srcdir); find . \
|
(cd $(top_srcdir); find . \
|
||||||
\( -name '*.pyc' -o -name '#*' -o -name '*~' \) -delete)
|
\( -name '*.pyc' -o -name '#*' -o -name '*~' \) -delete)
|
||||||
if test -z "$(NOTAG)";then \
|
if test -z "$(NOTAG)";then \
|
||||||
test -z "`git status -s|grep -v recoll-$(VERSION)`"||exit 1; \
|
test -z "`git status -s|grep -v recoll-$(VERSION)`"||exit 1; \
|
||||||
vers=`echo $(VERSION) | sed -e 's/~/_/g'`;\
|
vers=`echo $(VERSION) | sed -e 's/~/_/g'`;\
|
||||||
git tag -a RECOLL-$$vers -m "Release $$vers tagged"; \
|
git tag -a RECOLL-$$vers -m "Release $$vers tagged"; \
|
||||||
|
|||||||
@ -483,8 +483,7 @@ public:
|
|||||||
// difficult. Anyway, the display seems fast enough as is.
|
// difficult. Anyway, the display seems fast enough as is.
|
||||||
void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
void paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index) const {
|
const QModelIndex &index) const {
|
||||||
QStyleOptionViewItem opt = option;
|
|
||||||
initStyleOption(&opt, index);
|
|
||||||
QVariant value = index.data(Qt::DisplayRole);
|
QVariant value = index.data(Qt::DisplayRole);
|
||||||
QString text;
|
QString text;
|
||||||
if (value.isValid() && !value.isNull()) {
|
if (value.isValid() && !value.isNull()) {
|
||||||
@ -495,39 +494,29 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStyleOptionViewItem opt = option;
|
||||||
|
initStyleOption(&opt, index);
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
QTextDocument document;
|
QTextDocument document;
|
||||||
|
QString color = opt.palette.color(QPalette::Text).name();
|
||||||
|
QString selcolor = opt.palette.color(QPalette::BrightText).name();
|
||||||
QString fstyle;
|
QString fstyle;
|
||||||
if (prefs.reslistfontsize > 0) {
|
if (prefs.reslistfontsize > 0) {
|
||||||
int fs = prefs.reslistfontsize <= fsadjusttable ?
|
int fs = prefs.reslistfontsize <= fsadjusttable ?
|
||||||
prefs.reslistfontsize :
|
prefs.reslistfontsize : prefs.reslistfontsize - fsadjusttable;
|
||||||
prefs.reslistfontsize - fsadjusttable;
|
|
||||||
fstyle = QString("font-size: %1pt").arg(fs);
|
fstyle = QString("font-size: %1pt").arg(fs);
|
||||||
}
|
}
|
||||||
if (opt.state & QStyle::State_Selected) {
|
QString ntxt("<div style='");
|
||||||
painter->fillRect(opt.rect, opt.palette.highlight());
|
ntxt += " color:";
|
||||||
// Set the foreground color. Tried with pen
|
ntxt += (opt.state & QStyle::State_Selected)? selcolor:color;
|
||||||
// approach did not seem to work, probably it's
|
ntxt += ";";
|
||||||
// reset by the textdocument. Couldn't use
|
ntxt += fstyle;
|
||||||
// setdefaultstylesheet() either. the div thing is
|
ntxt += QString("'>") + text + QString("</div>");
|
||||||
// an ugly hack. Works for now
|
text.swap(ntxt);
|
||||||
QString ntxt("<div style='color: white");
|
|
||||||
if (!fstyle.isEmpty()) {
|
painter->setClipRect(opt.rect);
|
||||||
ntxt += QString(";") + fstyle;
|
|
||||||
}
|
|
||||||
ntxt += "'>";
|
|
||||||
ntxt += text + QString::fromUtf8("</div>");
|
|
||||||
text.swap(ntxt);
|
|
||||||
} else {
|
|
||||||
if (!fstyle.isEmpty()) {
|
|
||||||
QString ntxt("<div style='");
|
|
||||||
ntxt += fstyle;
|
|
||||||
ntxt += QString("'>") + text + QString("</div>");
|
|
||||||
text.swap(ntxt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
painter->setClipRect(option.rect);
|
|
||||||
QPoint where = option.rect.topLeft();
|
QPoint where = option.rect.topLeft();
|
||||||
where.ry() += TEXTINCELLVTRANS;
|
where.ry() += TEXTINCELLVTRANS;
|
||||||
painter->translate(where);
|
painter->translate(where);
|
||||||
|
|||||||
14
src/sampleconf/recoll-dark.css
Normal file
14
src/sampleconf/recoll-dark.css
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
/* Result list HTML Header insert */
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #F0FFFF;
|
||||||
|
}
|
||||||
|
body, table {
|
||||||
|
background: #373737;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -15,16 +15,7 @@
|
|||||||
result list:
|
result list:
|
||||||
Preferences->GUI configuration->Result list->
|
Preferences->GUI configuration->Result list->
|
||||||
Edit result page html header insert
|
Edit result page html header insert
|
||||||
For example:
|
See recoll-dark.css in src/sampleconf of share/examples
|
||||||
|
|
||||||
<style type="text/css">
|
|
||||||
html {
|
|
||||||
background-color: #505050;
|
|
||||||
color: #D8D8D8;
|
|
||||||
selection-background-color: #424e72;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Light on dark text everywhere*/
|
/* Light on dark text everywhere*/
|
||||||
@ -57,13 +48,9 @@ QTabWidget QTabBar::tab:selected {
|
|||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Slightly *darker* background for text entry areas. */
|
||||||
* Slightly *darker* background for text entry areas, and brighter
|
QComboBox[editable="true"], QTextEdit[editable="true"], QLineEdit,
|
||||||
* (lighter) foreground.
|
QPlainTextEdit {
|
||||||
* QTableView excluded until we fix the font color...
|
|
||||||
*/
|
|
||||||
QComboBox[editable="true"], QTextEdit, QLineEdit,
|
|
||||||
QTextBrowser, QWebView, QPlainTextEdit {
|
|
||||||
background-color: #101010;
|
background-color: #101010;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user