Commit 3e317aab authored by Tobias Koenig's avatar Tobias Koenig

Add some variants of the basic transitions to the default transition menu.

svn path=/trunk/kdegraphics/kpdf/; revision=377061
parent eef18e87
......@@ -12,6 +12,9 @@
<height>261</height>
</rect>
</property>
<property name="caption">
<string>DlgPresentation</string>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
......@@ -86,62 +89,92 @@
<widget class="QComboBox" row="1" column="1">
<item>
<property name="text">
<string>Replace</string>
<string>Blinds Vertical</string>
</property>
</item>
<item>
<property name="text">
<string>Split</string>
<string>Blinds Horizontal</string>
</property>
</item>
<item>
<property name="text">
<string>Blinds</string>
<string>Box In</string>
</property>
</item>
<item>
<property name="text">
<string>Box</string>
<string>Box Out</string>
</property>
</item>
<item>
<property name="text">
<string>Wipe</string>
<string>Dissolve</string>
</property>
</item>
<item>
<property name="text">
<string>Dissolve</string>
<string>Glitter Down</string>
</property>
</item>
<item>
<property name="text">
<string>Glitter Right</string>
</property>
</item>
<item>
<property name="text">
<string>Glitter Right-Down</string>
</property>
</item>
<item>
<property name="text">
<string>Random Transition</string>
</property>
</item>
<item>
<property name="text">
<string>Replace</string>
</property>
</item>
<item>
<property name="text">
<string>Split Horizontal In</string>
</property>
</item>
<item>
<property name="text">
<string>Split Horizontal Out</string>
</property>
</item>
<item>
<property name="text">
<string>Glitter</string>
<string>Split Vertical In</string>
</property>
</item>
<item>
<property name="text">
<string>Fly</string>
<string>Split Vertical Out</string>
</property>
</item>
<item>
<property name="text">
<string>Push</string>
<string>Wipe Down</string>
</property>
</item>
<item>
<property name="text">
<string>Cover</string>
<string>Wipe Right</string>
</property>
</item>
<item>
<property name="text">
<string>Uncover</string>
<string>Wipe Left</string>
</property>
</item>
<item>
<property name="text">
<string>Fade</string>
<string>Wipe Up</string>
</property>
</item>
<property name="name">
......
......@@ -110,18 +110,24 @@
<entry key="SlidesTransition" type="Enum" >
<default>Replace</default>
<choices>
<choice name="Replace" />
<choice name="Split" />
<choice name="Blinds" />
<choice name="Box" />
<choice name="Wipe" />
<choice name="BlindsHorizontal" />
<choice name="BlindsVertical" />
<choice name="BoxIn" />
<choice name="BoxOut" />
<choice name="Dissolve" />
<choice name="Glitter" />
<choice name="Fly" />
<choice name="Push" />
<choice name="Cover" />
<choice name="Uncover" />
<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" >
......
......@@ -13,6 +13,7 @@
#include <qpainter.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <kapplication.h>
#include <kcursor.h>
#include <ktoolbar.h>
#include <kdebug.h>
......@@ -579,41 +580,132 @@ void PresentationWidget::slotTransitionStep()
const KPDFPageTransition PresentationWidget::defaultTransition() const
{
switch ( Settings::slidesTransition() )
return defaultTransition( Settings::slidesTransition() );
}
const KPDFPageTransition PresentationWidget::defaultTransition( int type ) const
{
switch ( type )
{
case Settings::EnumSlidesTransition::Split:
return KPDFPageTransition( KPDFPageTransition::Split );
case Settings::EnumSlidesTransition::BlindsHorizontal:
{
KPDFPageTransition transition( KPDFPageTransition::Blinds );
transition.setAlignment( KPDFPageTransition::Horizontal );
return transition;
break;
case Settings::EnumSlidesTransition::Blinds:
return KPDFPageTransition( KPDFPageTransition::Blinds );
}
case Settings::EnumSlidesTransition::BlindsVertical:
{
KPDFPageTransition transition( KPDFPageTransition::Blinds );
transition.setAlignment( KPDFPageTransition::Vertical );
return transition;
break;
case Settings::EnumSlidesTransition::Box:
return KPDFPageTransition( KPDFPageTransition::Box );
}
case Settings::EnumSlidesTransition::BoxIn:
{
KPDFPageTransition transition( KPDFPageTransition::Box );
transition.setDirection( KPDFPageTransition::Inward );
return transition;
break;
case Settings::EnumSlidesTransition::Wipe:
return KPDFPageTransition( KPDFPageTransition::Wipe );
}
case Settings::EnumSlidesTransition::BoxOut:
{
KPDFPageTransition transition( KPDFPageTransition::Box );
transition.setDirection( KPDFPageTransition::Outward );
return transition;
break;
}
case Settings::EnumSlidesTransition::Dissolve:
{
return KPDFPageTransition( KPDFPageTransition::Dissolve );
break;
case Settings::EnumSlidesTransition::Glitter:
return KPDFPageTransition( KPDFPageTransition::Glitter );
}
case Settings::EnumSlidesTransition::GlitterDown:
{
KPDFPageTransition transition( KPDFPageTransition::Glitter );
transition.setAngle( 270 );
return transition;
break;
case Settings::EnumSlidesTransition::Fly:
return KPDFPageTransition( KPDFPageTransition::Fly );
}
case Settings::EnumSlidesTransition::GlitterRight:
{
KPDFPageTransition transition( KPDFPageTransition::Glitter );
transition.setAngle( 0 );
return transition;
break;
case Settings::EnumSlidesTransition::Push:
return KPDFPageTransition( KPDFPageTransition::Push );
}
case Settings::EnumSlidesTransition::GlitterRightDown:
{
KPDFPageTransition transition( KPDFPageTransition::Glitter );
transition.setAngle( 315 );
return transition;
break;
case Settings::EnumSlidesTransition::Cover:
return KPDFPageTransition( KPDFPageTransition::Cover );
}
case Settings::EnumSlidesTransition::Random:
{
return defaultTransition( KApplication::random() % 18 );
break;
case Settings::EnumSlidesTransition::Uncover:
return KPDFPageTransition( KPDFPageTransition::Uncover );
}
case Settings::EnumSlidesTransition::SplitHorizontalIn:
{
KPDFPageTransition transition( KPDFPageTransition::Split );
transition.setAlignment( KPDFPageTransition::Horizontal );
transition.setDirection( KPDFPageTransition::Inward );
return transition;
break;
case Settings::EnumSlidesTransition::Fade:
return KPDFPageTransition( KPDFPageTransition::Fade );
}
case Settings::EnumSlidesTransition::SplitHorizontalOut:
{
KPDFPageTransition transition( KPDFPageTransition::Split );
transition.setAlignment( KPDFPageTransition::Horizontal );
transition.setDirection( KPDFPageTransition::Outward );
return transition;
break;
}
case Settings::EnumSlidesTransition::SplitVerticalIn:
{
KPDFPageTransition transition( KPDFPageTransition::Split );
transition.setAlignment( KPDFPageTransition::Vertical );
transition.setDirection( KPDFPageTransition::Inward );
return transition;
break;
}
case Settings::EnumSlidesTransition::SplitVerticalOut:
{
KPDFPageTransition transition( KPDFPageTransition::Split );
transition.setAlignment( KPDFPageTransition::Vertical );
transition.setDirection( KPDFPageTransition::Outward );
return transition;
break;
}
case Settings::EnumSlidesTransition::WipeDown:
{
KPDFPageTransition transition( KPDFPageTransition::Wipe );
transition.setAngle( 270 );
return transition;
break;
}
case Settings::EnumSlidesTransition::WipeRight:
{
KPDFPageTransition transition( KPDFPageTransition::Wipe );
transition.setAngle( 0 );
return transition;
break;
}
case Settings::EnumSlidesTransition::WipeLeft:
{
KPDFPageTransition transition( KPDFPageTransition::Wipe );
transition.setAngle( 180 );
return transition;
break;
}
case Settings::EnumSlidesTransition::WipeUp:
{
KPDFPageTransition transition( KPDFPageTransition::Wipe );
transition.setAngle( 90 );
return transition;
break;
}
case Settings::EnumSlidesTransition::Replace:
default:
return KPDFPageTransition( KPDFPageTransition::Replace );
......
......@@ -59,6 +59,7 @@ class PresentationWidget : public QWidget, public KPDFDocumentObserver
void generateOverlay();
void initTransition( const KPDFPageTransition *transition );
const KPDFPageTransition defaultTransition() const;
const KPDFPageTransition defaultTransition( int ) const;
// cache stuff
int m_width;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment