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" > <ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>DlgPresentationBase</class> <class>DlgPresentationBase</class>
<widget class="QWidget" name="DlgPresentationBase" > <widget class="QWidget" name="DlgPresentationBase" >
<property name="geometry" > <property name="geometry" >
@ -9,7 +6,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>318</width> <width>318</width>
<height>275</height> <height>376</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
@ -267,6 +264,41 @@
</layout> </layout>
</widget> </widget>
</item> </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> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
@ -277,8 +309,8 @@
</property> </property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>31</width> <width>318</width>
<height>4</height> <height>16</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@ -290,10 +322,8 @@
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>KColorButton</class> <class>KColorButton</class>
<extends>QWidget</extends> <extends>QPushButton</extends>
<header>kcolorbutton.h</header> <header>kcolorbutton.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>

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

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

Loading…
Cancel
Save