<div dir="auto"><div class="gmail_extra" dir="auto"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have added the ability for the background color in okular to be changed via the settings, but currently what I have done is set the default background color to the RGB value of QPalette::Dark since I don't think it is a good idea to construct a QPalette in conf/okular.kcfg just to access QPalette::Dark which is what is used for the background color currently in okular .<br>
<br>
Is this okay, what should the background color be?<br>
<br>
diff --git a/conf/dlggeneralbase.ui b/conf/dlggeneralbase.ui<br>
index cf4ebca0..fe373a71 100644<br>
--- a/conf/dlggeneralbase.ui<br>
+++ b/conf/dlggeneralbase.ui<br>
@@ -7,7 +7,7 @@<br>
<x>0</x><br>
<y>0</y><br>
<width>558</width><br>
- <height>575</height><br>
+ <height>632</height><br>
</rect><br>
</property><br>
<layout class="QVBoxLayout"><br>
@@ -120,7 +120,7 @@<br>
<item><br>
<widget class="QRadioButton" name="radioFileName"><br>
<property name="text"><br>
- <string>Display file name only</string><br>
+ <string>Disp&lay file name only</string><br>
</property><br>
<property name="checked"><br>
<bool>true</bool><br>
@@ -130,7 +130,7 @@<br>
<item><br>
<widget class="QRadioButton" name="radioFilePath"><br>
<property name="text"><br>
- <string>Display full file path</string><br>
+ <string>Display full file pa&th</string><br>
</property><br>
<property name="checked"><br>
<bool>false</bool><br>
@@ -141,6 +141,29 @@<br>
</widget><br>
</item><br>
<item><br>
+ <layout class="QGridLayout" name="gridLayout_2"><br>
+ <property name="horizontalSpacing"><br>
+ <number>6</number><br>
+ </property><br>
+ <property name="verticalSpacing"><br>
+ <number>0</number><br>
+ </property><br>
+ <item row="1" column="0"><br>
+ <widget class="QLabel" name="textLabel"><br>
+ <property name="text"><br>
+ <string>Background color:</string><br>
+ </property><br>
+ <property name="alignment"><br>
+ <set>Qt::AlignRight|Qt::<wbr>AlignTrailing|Qt::<wbr>AlignVCenter</set><br>
+ </property><br>
+ </widget><br>
+ </item><br>
+ <item row="1" column="1"><br>
+ <widget class="KColorButton" name="kcfg_BackgroundColor"/><br>
+ </item><br>
+ </layout><br>
+ </item><br>
+ <item><br>
<layout class="QVBoxLayout" name="verticalLayout"><br>
<property name="leftMargin"><br>
<number>4</number><br>
@@ -319,7 +342,7 @@<br>
<item row="0" column="0"><br>
<widget class="QLabel" name="columnLabel"><br>
<property name="text"><br>
- <string>Overview &columns:</string><br>
+ <string>Overview co&lumns:</string><br>
</property><br>
<property name="alignment"><br>
<set>Qt::AlignRight|Qt::<wbr>AlignTrailing|Qt::<wbr>AlignVCenter</set><br>
@@ -345,7 +368,7 @@<br>
<string>Defines how much of the current viewing area will<br>
still be visible when pressing the Page Up/Down keys.</string><br>
</property><br>
<property name="text"><br>
- <string>&Page Up/Down overlap:</string><br>
+ <string>Page &Up/Down overlap:</string><br>
</property><br>
<property name="alignment"><br>
<set>Qt::AlignRight|Qt::<wbr>AlignTrailing|Qt::<wbr>AlignVCenter</set><br>
@@ -439,6 +462,13 @@ For files which were opened before the previous<br>
zoom is applied.</string><br>
</item><br>
</layout><br>
</widget><br>
+ <customwidgets><br>
+ <customwidget><br>
+ <class>KColorButton</class><br>
+ <extends>QPushButton</extends><br>
+ <header>kcolorbutton.h</<wbr>header><br>
+ </customwidget><br>
+ </customwidgets><br>
<includes><br>
<include location="global">kiconloader.<wbr>h</include><br>
</includes><br>
diff --git a/conf/okular.kcfg b/conf/okular.kcfg<br>
index 69ea8cf6..07113f87 100644<br>
--- a/conf/okular.kcfg<br>
+++ b/conf/okular.kcfg<br>
@@ -290,6 +290,9 @@<br>
<entry key="<wbr>ShowSourceLocationsGraphically<wbr>" type="Bool" ><br>
<default>false</default><br>
</entry><br>
+ <entry key="BackgroundColor" type="Color" ><br>
+ <default code="true" >QColor(136, 142, 147)</default><br>
+ </entry><br>
</group><br>
<group name="Search" ><br>
<entry key="SearchCaseSensitive" type="Bool"><br>
diff --git a/ui/pageview.cpp b/ui/pageview.cpp<br>
index 3d935a2e..8c6ac3ca 100644<br>
--- a/ui/pageview.cpp<br>
+++ b/ui/pageview.cpp<br>
@@ -3416,7 +3416,7 @@ QList< Okular::RegularAreaRect * ><br>
PageView::textSelections( const QPoint& start<br>
<br>
void PageView::<wbr>drawDocumentOnPainter( const QRect & contentsRect,<br>
QPainter * p )<br>
{<br>
- QColor backColor = viewport()->palette().color( QPalette::Dark );<br>
+ QColor backColor = Okular::Settings::<wbr>backgroundColor();<br>
<br>
// when checking if an Item is contained in contentsRect, instead of<br>
// growing PageViewItems rects (for keeping outline into account), we<br>
</blockquote></div><br></div></div>