okular/conf/okular.kcfg
Albert Freeman 1f6e8a4782 Custom background color
Summary:
BUG: 182994

Adds an option to the config dialog that enables background color (the color around the displayed page) to be changed (while by default preserving the Qt toolkit selection as not to affect existing users).

Reasons for this change:
Accessibility, eye strain, aesthetic reasons, color displayed on monitor can affect power consumption (how: depends on display technology).
Many people want this change occording to Bugzilla and other sources.

Maintenance: Nearly no additional maintenance:
This is no new subsystem but a trivial feature with no complex code dependencies, and we are already showing a colour selection dialog and setting colours in other places in Okular.

{F4257766}

Other less important information:
https://git.reviewboard.kde.org/r/130219/
https://mail.kde.org/pipermail/okular-devel/2017-September/025520.html

Test Plan:
Tested everything, it all works:
Toggled the custom background color, changed custom background color, removed okular settings file (with: "rm ~/.config/okular*") to verify it uses the usual qt theme colour by default (where the settings file remembered the custom color).

Reviewers: #okular, aacid, elvisangelaccio, rkflx, ngraham

Reviewed By: ngraham

Subscribers: aacid, ltoscano, ngraham

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8051
2017-10-01 11:31:59 +02:00

347 lines
10 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<include>kuser.h</include>
<kcfgfile arg="true" />
<group name="Dlg Performance" >
<entry key="EnableCompositing" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="Debugging Options" >
<entry key="DebugDrawBoundaries" type="Bool" >
<default>false</default>
</entry>
<entry key="DebugDrawAnnotationRect" type="Bool" >
<default>false</default>
</entry>
</group>
<group name="Contents" >
<entry key="ContentsSearchCaseSensitive" type="Bool">
<default>false</default>
</entry>
<entry key="ContentsSearchRegularExpression" type="Bool">
<default>false</default>
</entry>
</group>
<group name="Layers" >
<entry key="LayersSearchCaseSensitive" type="Bool">
<default>false</default>
</entry>
<entry key="LayersSearchRegularExpression" type="Bool">
<default>false</default>
</entry>
</group>
<group name="Reviews" >
<entry key="ReviewsSearchCaseSensitive" type="Bool">
<default>false</default>
</entry>
<entry key="ReviewsSearchRegularExpression" type="Bool">
<default>false</default>
</entry>
<entry key="DrawingTools" type="StringList">
<code>
QStringList drawingTools;
// load the default tool list from the 'xml tools definition' file
QFile infoDrawingFile( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/drawingtools.xml") );
if ( infoDrawingFile.exists() &amp;&amp; infoDrawingFile.open( QIODevice::ReadOnly ) )
{
QDomDocument doc;
if ( doc.setContent( &amp;infoDrawingFile ) )
{
const QDomElement toolsDefinition = doc.elementsByTagName("drawingTools").item( 0 ).toElement();
// create the annotationTools list from the XML dom tree
QDomNode toolDescription = toolsDefinition.firstChild();
while ( toolDescription.isElement() )
{
const QDomElement toolElement = toolDescription.toElement();
if ( toolElement.tagName() == "tool" )
{
QDomDocument temp;
temp.appendChild( temp.importNode( toolElement, true) );
// add each &lt;tool&gt;...&lt;/tool&gt; as XML string
drawingTools &lt;&lt; temp.toString(-1);
}
toolDescription = toolDescription.nextSibling();
}
}
else
{
qWarning() &lt;&lt; "DrawingTools XML file seems to be damaged";
}
}
else
{
qWarning() &lt;&lt; "Unable to open DrawingTools XML definition";
}
</code>
<default code="true">drawingTools</default>
</entry>
<entry key="AnnotationTools" type="StringList">
<code>
QStringList annotationTools;
// load the default tool list from the 'xml tools definition' file
QFile infoFile( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/tools.xml") );
if ( infoFile.exists() &amp;&amp; infoFile.open( QIODevice::ReadOnly ) )
{
QDomDocument doc;
if ( doc.setContent( &amp;infoFile ) )
{
QDomElement toolsDefinition = doc.elementsByTagName("annotatingTools").item( 0 ).toElement();
// create the annotationTools list from the XML dom tree
QDomNode toolDescription = toolsDefinition.firstChild();
while ( toolDescription.isElement() )
{
QDomElement toolElement = toolDescription.toElement();
if ( toolElement.tagName() == "tool" )
{
QDomDocument temp;
temp.appendChild( temp.importNode( toolElement, true) );
// add each &lt;tool&gt;...&lt;/tool&gt; as XML string
annotationTools &lt;&lt; temp.toString(-1);
}
toolDescription = toolDescription.nextSibling();
}
}
else
{
qWarning() &lt;&lt; "AnnotatingTools XML file seems to be damaged";
}
}
else
{
qWarning() &lt;&lt; "Unable to open AnnotatingTools XML definition";
}
</code>
<default code="true">annotationTools</default>
</entry>
</group>
<group name="Zoom">
<entry key="ZoomMode" type="UInt" >
<default>1</default>
<max>3</max>
</entry>
</group>
<group name="General" >
<entry key="ShellOpenFileInTabs" type="Bool" >
<default>false</default>
</entry>
<entry key="ShowOSD" type="Bool" >
<default>true</default>
</entry>
<entry key="DisplayDocumentTitle" type="Bool" >
<default>true</default>
</entry>
<entry key="rtlReadingDirection" type="Bool" >
<default>false</default>
</entry>
<entry key="DisplayDocumentNameOrPath" type="Enum" >
<default>Name</default>
<choices>
<choice name="Name" />
<choice name="Path" />
</choices>
</entry>
<entry key="UseTTS" type="Bool" />
<entry key="WatchFile" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="Dlg Presentation" >
<entry key="SlidesBackgroundColor" type="Color" >
<default code="true" >Qt::black</default>
</entry>
<entry key="SlidesTransition" type="Enum" >
<default>Replace</default>
<choices>
<choice name="BlindsHorizontal" />
<choice name="BlindsVertical" />
<choice name="BoxIn" />
<choice name="BoxOut" />
<choice name="Dissolve" />
<choice name="Fade" />
<choice name="GlitterDown" />
<choice name="GlitterRight" />
<choice name="GlitterRightDown" />
<choice name="Random" />
<choice name="Replace" />
<choice name="SplitHorizontalIn" />
<choice name="SplitHorizontalOut" />
<choice name="SplitVerticalIn" />
<choice name="SplitVerticalOut" />
<choice name="WipeDown" />
<choice name="WipeRight" />
<choice name="WipeLeft" />
<choice name="WipeUp" />
</choices>
</entry>
<entry key="SlidesCursor" type="Enum" >
<default>HiddenDelay</default>
<choices>
<choice name="HiddenDelay" />
<choice name="Visible" />
<choice name="Hidden" />
</choices>
</entry>
<entry key="SlidesShowProgress" type="Bool" >
<default>true</default>
</entry>
<entry key="SlidesShowSummary" type="Bool" >
<default>false</default>
</entry>
<entry key="SlidesTransitionsEnabled" type="Bool" >
<default>true</default>
</entry>
<entry key="SlidesScreen" type="Int" >
<default>-2</default>
<min>-2</min>
<max>20</max>
</entry>
</group>
<group name="Main View" >
<entry key="ShowLeftPanel" type="Bool" >
<default>true</default>
</entry>
<entry key="SplitterSizes" type="IntList" />
<entry key="ShowBottomBar" type="Bool" >
<default>true</default>
</entry>
</group>
<group name="Nav Panel" >
<entry key="CurrentPageOnly" type="Bool" >
<default>false</default>
</entry>
<entry key="GroupByAuthor" type="Bool" >
<default>true</default>
</entry>
<entry key="GroupByPage" type="Bool" >
<default>true</default>
</entry>
<entry key="FilterBookmarks" type="Bool" >
<default>false</default>
</entry>
<entry key="SyncThumbnailsViewport" type="Bool" >
<default>true</default>
</entry>
<entry key="TocPageColumn" type="Bool" >
<default>true</default>
</entry>
<entry key="SidebarShowText" type="Bool" >
<default>true</default>
</entry>
<entry key="SidebarIconSize" type="UInt" >
<default>48</default>
</entry>
</group>
<group name="PageView" >
<entry key="EditToolBarPlacement" type="Int" >
<default>0</default>
</entry>
<entry key="ShowScrollBars" type="Bool" >
<default>true</default>
</entry>
<entry key="ScrollOverlap" type="UInt" >
<default>0</default>
<min>0</min>
<max>50</max>
</entry>
<entry key="ViewColumns" type="UInt" >
<default>3</default>
<min>1</min>
<max>8</max>
</entry>
<entry key="TrimMargins" type="Bool" >
<default>false</default>
</entry>
<entry key="ViewContinuous" type="Bool" >
<default>true</default>
</entry>
<entry key="ViewMode" type="Enum" >
<default>Single</default>
<choices>
<choice name="Single" />
<choice name="Facing" />
<choice name="FacingFirstCentered" />
<choice name="Summary" />
</choices>
</entry>
<entry key="TrimMode" type="Enum" >
<default>None</default>
<choices>
<choice name="None" />
<choice name="Margins" />
<choice name="Selection" />
</choices>
</entry>
<entry key="MouseMode" type="Enum" >
<default>Browse</default>
<choices>
<choice name="Browse" />
<choice name="Zoom" />
<choice name="RectSelect" />
<choice name="TextSelect" />
<choice name="TableSelect" />
<choice name="Magnifier" />
<choice name="TrimSelect" />
</choices>
</entry>
<entry key="ShowSourceLocationsGraphically" type="Bool" >
<default>false</default>
</entry>
<entry key="UseCustomBackgroundColor" type="Bool" >
<default>false</default>
</entry>
<entry key="BackgroundColor" type="Color" >
</entry>
</group>
<group name="Search" >
<entry key="SearchCaseSensitive" type="Bool">
<default>false</default>
</entry>
<entry key="SearchFromCurrentPage" type="Bool">
<default>true</default>
</entry>
<entry key="FindAsYouType" type="Bool">
<default>true</default>
</entry>
</group>
<group name="Dlg Accessibility" >
<entry key="HighlightImages" type="Bool" >
<default>false</default>
</entry>
<entry key="HighlightLinks" type="Bool" >
<default>false</default>
</entry>
<entry key="RecolorForeground" type="Color" >
<default code="true" >0x600000</default>
</entry>
<entry key="RecolorBackground" type="Color" >
<default code="true" >0xF0F0F0</default>
</entry>
<entry key="BWThreshold" type="UInt" >
<default>127</default>
<min>2</min>
<max>253</max>
</entry>
<entry key="BWContrast" type="UInt" >
<default>2</default>
<min>2</min>
<max>6</max>
</entry>
</group>
<group name="Identity" >
<entry key="IdentityAuthor" type="String">
<code>
KUser currentUser;
QString userString = currentUser.property( KUser::FullName ).toString();
if ( userString.isEmpty() )
{
userString = currentUser.loginName();
}
</code>
<default code="true">userString</default>
</entry>
</group>
</kcfg>