add an option to configure the color of the pencil of the presentation mode

svn path=/trunk/playground/graphics/okular/; revision=601067
remotes/origin/KDE/4.0
Pino Toscano 20 years ago
parent e113d48bf3
commit 1112ada99f
  1. 48
      conf/dlgpresentationbase.ui
  2. 3
      conf/okular.kcfg
  3. 5
      ui/presentationwidget.cpp

@ -1,7 +1,4 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>DlgPresentationBase</class>
<widget class="QWidget" name="DlgPresentationBase" >
<property name="geometry" >
@ -9,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>318</width>
<height>275</height>
<height>376</height>
</rect>
</property>
<layout class="QVBoxLayout" >
@ -267,6 +264,41 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3" >
<property name="title" >
<string>Pencil</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
<string>Pencil color:</string>
</property>
</widget>
</item>
<item>
<widget class="KColorButton" name="kcfg_SlidesPencilColor" />
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
@ -277,8 +309,8 @@
</property>
<property name="sizeHint" >
<size>
<width>31</width>
<height>4</height>
<width>318</width>
<height>16</height>
</size>
</property>
</spacer>
@ -290,10 +322,8 @@
<customwidgets>
<customwidget>
<class>KColorButton</class>
<extends>QWidget</extends>
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<resources/>

@ -123,6 +123,9 @@
<entry key="SlidesShowSummary" type="Bool" >
<default>false</default>
</entry>
<entry key="SlidesPencilColor" type="Color" >
<default code="true" >Qt::red</default>
</entry>
</group>
<group name="General" >
<entry key="AnnotationsAuthor" type="String" />

@ -967,15 +967,16 @@ void PresentationWidget::togglePencilMode( bool on )
{
if ( on )
{
QString colorstring = Okular::Settings::slidesPencilColor().name();
// FIXME this should not be recreated every time
QDomDocument doc( "engine" );
QDomElement root = doc.createElement( "engine" );
root.setAttribute( "color", "#FF0000" );
root.setAttribute( "color", colorstring );
doc.appendChild( root );
QDomElement annElem = doc.createElement( "annotation" );
root.appendChild( annElem );
annElem.setAttribute( "type", "Ink" );
annElem.setAttribute( "color", "#FF0000" );
annElem.setAttribute( "color", colorstring );
annElem.setAttribute( "width", "2" );
m_drawingEngine = new SmoothPathEngine( root );
}

Loading…
Cancel
Save