diff --git a/TODO b/TODO
index ca0847a14..b4785abe5 100644
--- a/TODO
+++ b/TODO
@@ -91,6 +91,10 @@ More items (first items will enter 'In progress list' first):
-> move some document related features from part to the document (see find, goto dialog, ...)
Done (newest features come first):
+-> ADD: presentation: cursor modes: hidden, visible, hidden with delay (Tobias)
+-> ADD: presentation: default transition which is used when no transition is defined in document (Tobias)
+-> ADD: presentation: support for automatic advance and loop on last page (Tobias)
+-> ADD: presentation: add additional presentation page to settings dialog (Tobias)
-> CHG: presentation: the round wheel indicator can be clicked to change page
-> FIX: layout margins on pageView
-> ADD: restore the last active page when a file is opened again
diff --git a/conf/Makefile.am b/conf/Makefile.am
index a1bb4c6b1..ef2efc9dd 100644
--- a/conf/Makefile.am
+++ b/conf/Makefile.am
@@ -3,6 +3,7 @@ INCLUDES = -I$(srcdir)/.. -I$(top_builddir)/kpdf $(all_includes)
METASOURCES = AUTO
libkpdfconf_la_SOURCES = dlggeneral.ui dlgperformance.ui dlgaccessibility.ui \
+ dlgpresentation.ui \
preferencesdialog.cpp settings.kcfgc
noinst_LTLIBRARIES = libkpdfconf.la
diff --git a/conf/dlggeneral.ui b/conf/dlggeneral.ui
index 9c54bd56d..359799cc8 100644
--- a/conf/dlggeneral.ui
+++ b/conf/dlggeneral.ui
@@ -8,10 +8,13 @@
0
0
- 320
- 255
+ 289
+ 169
+
+ DlgGeneral
+
unnamed
@@ -147,96 +150,6 @@
-
-
- groupBox1
-
-
- Presentation
-
-
-
- unnamed
-
-
-
- layout12
-
-
-
- unnamed
-
-
-
- kcfg_SlidesShowProgress
-
-
- Show &progress indicator
-
-
-
-
- kcfg_SlidesShowGrayBack
-
-
- Show light &gray background
-
-
-
-
- kcfg_SlidesShowSummary
-
-
- Show s&ummary page
-
-
-
-
-
-
- layout3
-
-
-
- unnamed
-
-
-
- pixmapLabel1
-
-
-
- 0
- 0
- 0
- 0
-
-
-
- "kpresenter_kpr", 32
-
-
-
-
- spacerV2
-
-
- Vertical
-
-
- Minimum
-
-
-
- 20
- 1
-
-
-
-
-
-
-
spacer3
diff --git a/conf/dlgpresentation.ui b/conf/dlgpresentation.ui
new file mode 100644
index 000000000..0fe5fd748
--- /dev/null
+++ b/conf/dlgpresentation.ui
@@ -0,0 +1,243 @@
+
+DlgPresentation
+
+
+ DlgPresentation
+
+
+
+ 0
+ 0
+ 348
+ 298
+
+
+
+ DlgPresentation
+
+
+
+ unnamed
+
+
+
+ groupBox1
+
+
+ Navigation
+
+
+
+ unnamed
+
+
+
+ layout1
+
+
+
+ unnamed
+
+
+
+ kcfg_SlidesAdvanceTime
+
+
+ false
+
+
+ sec.
+
+
+ 5
+
+
+
+
+ kcfg_SlidesAdvance
+
+
+ Advance Every
+
+
+
+
+ kcfg_SlidesLoop
+
+
+ Loop After Last Page
+
+
+
+
+
+
+
+
+ groupBox2
+
+
+ Appearance
+
+
+
+ unnamed
+
+
+ -
+
+ Replace
+
+
+ -
+
+ Split
+
+
+ -
+
+ Blinds
+
+
+ -
+
+ Box
+
+
+ -
+
+ Wipe
+
+
+ -
+
+ Dissolve
+
+
+ -
+
+ Glitter
+
+
+ -
+
+ Fly
+
+
+ -
+
+ Push
+
+
+ -
+
+ Cover
+
+
+ -
+
+ Uncover
+
+
+ -
+
+ Fade
+
+
+
+ kcfg_SlidesTransition
+
+
+
+
+ textLabel1
+
+
+ Default Transition:
+
+
+
+
+ textLabel2
+
+
+ Mouse Cursor:
+
+
+
+ -
+
+ Hidden After Delay
+
+
+ -
+
+ Always Visible
+
+
+ -
+
+ Always Hidden
+
+
+
+ kcfg_SlidesCursor
+
+
+
+
+ textLabel3
+
+
+ Background Color:
+
+
+
+
+ kcfg_SlidesBackgroundColor
+
+
+
+
+
+
+
+ kcfg_SlidesShowSummary
+
+
+ Show s&ummary page
+
+
+ Alt+U
+
+
+
+
+ kcfg_SlidesShowProgress
+
+
+ Show &progress indicator
+
+
+ Alt+P
+
+
+
+
+
+
+
+
+
+
+ kcfg_SlidesAdvance
+ toggled(bool)
+ kcfg_SlidesAdvanceTime
+ setEnabled(bool)
+
+
+
+
+ kcolorbutton.h
+
+
diff --git a/conf/kpdf.kcfg b/conf/kpdf.kcfg
index 169e403ed..6e715ae67 100644
--- a/conf/kpdf.kcfg
+++ b/conf/kpdf.kcfg
@@ -90,10 +90,46 @@
-
- true
+
+ false
+
+
+ 5
+ 1
+ 3600
+
+
+ false
+
+
+ Qt::black
-
+
+ Replace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ HiddenDelay
+
+
+
+
+
+
+
true
diff --git a/conf/preferencesdialog.cpp b/conf/preferencesdialog.cpp
index b6432b73b..9c70f756d 100644
--- a/conf/preferencesdialog.cpp
+++ b/conf/preferencesdialog.cpp
@@ -13,6 +13,7 @@
#include "dlggeneral.h"
#include "dlgperformance.h"
#include "dlgaccessibility.h"
+#include "dlgpresentation.h"
// reimplementing this
#include "preferencesdialog.h"
@@ -23,8 +24,11 @@ PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skelet
m_general = new DlgGeneral(0);
m_performance = new DlgPerformance(0);
m_accessibility = new DlgAccessibility(0);
+ m_presentation = new DlgPresentation(0);
addPage( m_general, i18n("General"), "kpdf", i18n("General Options") );
addPage( m_accessibility, i18n("Accessibility"), "access", i18n("Reading Aids") );
addPage( m_performance, i18n("Performance"), "launch", i18n("Performance Tuning") );
+ addPage( m_presentation, i18n("Presentation"), "kpresenter_kpr",
+ i18n("Options For Presentation Mode") );
}
diff --git a/conf/preferencesdialog.h b/conf/preferencesdialog.h
index ace9c722a..475320ab2 100644
--- a/conf/preferencesdialog.h
+++ b/conf/preferencesdialog.h
@@ -19,6 +19,7 @@ class KConfigSkeleton;
class DlgGeneral;
class DlgPerformance;
class DlgAccessibility;
+class DlgPresentation;
class PreferencesDialog : public KConfigDialog
{
@@ -37,6 +38,7 @@ class PreferencesDialog : public KConfigDialog
DlgGeneral * m_general;
DlgPerformance * m_performance;
DlgAccessibility * m_accessibility;
+ DlgPresentation * m_presentation;
};
#endif
diff --git a/core/pagetransition.cpp b/core/pagetransition.cpp
index 969b4b0b8..cdf04a7ff 100644
--- a/core/pagetransition.cpp
+++ b/core/pagetransition.cpp
@@ -12,8 +12,8 @@
/** class KPDFPageTransition **/
-KPDFPageTransition::KPDFPageTransition()
- : m_type( Replace ),
+KPDFPageTransition::KPDFPageTransition( Type type )
+ : m_type( type ),
m_duration( 1 ),
m_alignment( Horizontal ),
m_direction( Inward ),
diff --git a/core/pagetransition.h b/core/pagetransition.h
index 30ef835b0..4a3d5d3ee 100644
--- a/core/pagetransition.h
+++ b/core/pagetransition.h
@@ -16,9 +16,6 @@
class KPDFPageTransition
{
public:
- KPDFPageTransition();
- ~KPDFPageTransition();
-
enum Type {
Replace,
Split,
@@ -44,6 +41,9 @@ class KPDFPageTransition
Outward
};
+ KPDFPageTransition( Type type = Replace );
+ ~KPDFPageTransition();
+
// Get type of the transition.
inline Type type() const { return m_type; }
diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp
index bc6efcc66..4e0af6221 100644
--- a/ui/presentationwidget.cpp
+++ b/ui/presentationwidget.cpp
@@ -77,6 +77,8 @@ PresentationWidget::PresentationWidget( KPDFDocument * doc )
connect( m_transitionTimer, SIGNAL( timeout() ), this, SLOT( slotTransitionStep() ) );
m_overlayHideTimer = new QTimer( this );
connect( m_overlayHideTimer, SIGNAL( timeout() ), this, SLOT( slotHideOverlay() ) );
+ m_advanceTimer = new QTimer( this );
+ connect( m_advanceTimer, SIGNAL( timeout() ), this, SLOT( slotNextPage() ) );
// register this observer in document
m_document->addObserver( this );
@@ -88,8 +90,15 @@ PresentationWidget::PresentationWidget( KPDFDocument * doc )
else
slotNextPage();
- KCursor::setAutoHideCursor( this, true );
- KCursor::setHideCursorDelay( 3000 );
+ if ( Settings::slidesCursor() == Settings::EnumSlidesCursor::HiddenDelay )
+ {
+ KCursor::setAutoHideCursor( this, true );
+ KCursor::setHideCursorDelay( 3000 );
+ }
+ else if ( Settings::slidesCursor() == Settings::EnumSlidesCursor::Hidden )
+ {
+ setCursor( KCursor::blankCursor() );
+ }
}
PresentationWidget::~PresentationWidget()
@@ -338,8 +347,10 @@ void PresentationWidget::generatePage()
m_frames[ m_frameIndex ]->page->getTransition() : 0;
if ( transition )
initTransition( transition );
- else
- update();
+ else {
+ KPDFPageTransition trans = defaultTransition();
+ initTransition( &trans );
+ }
}
void PresentationWidget::generateIntroPage( QPainter & p )
@@ -418,32 +429,7 @@ void PresentationWidget::generateContentsPage( int pageNum, QPainter & p )
for ( uint i = 0; i < rects.count(); i++ )
{
const QRect & r = rects[i];
- if ( Settings::slidesShowGrayBack() )
- {
- // use a vertical gray gradient background
- int baseTint = Qt::gray.red(),
- blendLevel = 9 * m_height / 10,
- blendLeft = r.left(),
- blendWidth = r.width();
- float blendDiv = (m_height * m_height) / 100; // use 100 to fade to pure white
- QColor baseColor( baseTint, baseTint, baseTint );
- for ( int i = r.top(); i <= r.bottom(); i++ )
- {
- if ( i <= blendLevel )
- p.fillRect( blendLeft, i, blendWidth, 1, baseColor );
- else
- {
- int k = i - blendLevel;
- k = baseTint + (int)( (255-baseTint) * (k * k) / blendDiv );
- p.fillRect( blendLeft, i, blendWidth, 1, QColor( baseTint, baseTint, k ) );
- }
- }
- }
- else
- {
- // use the black color that 'crops' images on beamers
- p.fillRect( r, Qt::black );
- }
+ p.fillRect( r, Settings::slidesBackgroundColor() );
}
}
@@ -525,6 +511,13 @@ void PresentationWidget::generateOverlay()
void PresentationWidget::slotNextPage()
{
+ if ( m_advanceTimer->isActive() )
+ m_advanceTimer->stop();
+
+ // loop when configured
+ if ( m_frameIndex == (int)m_frames.count() - 1 && Settings::slidesLoop() )
+ m_frameIndex = -1;
+
if ( m_frameIndex < (int)m_frames.count() - 1 )
{
// go to next page
@@ -536,7 +529,11 @@ void PresentationWidget::slotNextPage()
update();
}
+ // we need the setFocus() call here to let KCursor::autoHide() work correctly
setFocus();
+
+ if ( Settings::slidesAdvance() )
+ m_advanceTimer->start( Settings::slidesAdvanceTime() * 1000 );
}
void PresentationWidget::slotPrevPage()
@@ -573,6 +570,49 @@ void PresentationWidget::slotTransitionStep()
m_transitionTimer->start( m_transitionDelay, true );
}
+const KPDFPageTransition PresentationWidget::defaultTransition() const
+{
+ switch ( Settings::slidesTransition() )
+ {
+ case Settings::EnumSlidesTransition::Split:
+ return KPDFPageTransition( KPDFPageTransition::Split );
+ break;
+ case Settings::EnumSlidesTransition::Blinds:
+ return KPDFPageTransition( KPDFPageTransition::Blinds );
+ break;
+ case Settings::EnumSlidesTransition::Box:
+ return KPDFPageTransition( KPDFPageTransition::Box );
+ break;
+ case Settings::EnumSlidesTransition::Wipe:
+ return KPDFPageTransition( KPDFPageTransition::Wipe );
+ break;
+ case Settings::EnumSlidesTransition::Dissolve:
+ return KPDFPageTransition( KPDFPageTransition::Dissolve );
+ break;
+ case Settings::EnumSlidesTransition::Glitter:
+ return KPDFPageTransition( KPDFPageTransition::Glitter );
+ break;
+ case Settings::EnumSlidesTransition::Fly:
+ return KPDFPageTransition( KPDFPageTransition::Fly );
+ break;
+ case Settings::EnumSlidesTransition::Push:
+ return KPDFPageTransition( KPDFPageTransition::Push );
+ break;
+ case Settings::EnumSlidesTransition::Cover:
+ return KPDFPageTransition( KPDFPageTransition::Cover );
+ break;
+ case Settings::EnumSlidesTransition::Uncover:
+ return KPDFPageTransition( KPDFPageTransition::Uncover );
+ break;
+ case Settings::EnumSlidesTransition::Fade:
+ return KPDFPageTransition( KPDFPageTransition::Fade );
+ break;
+ case Settings::EnumSlidesTransition::Replace:
+ default:
+ return KPDFPageTransition( KPDFPageTransition::Replace );
+ break;
+ }
+}
/** ONLY the TRANSITIONS GENERATION function from here on **/
void PresentationWidget::initTransition( const KPDFPageTransition *transition )
diff --git a/ui/presentationwidget.h b/ui/presentationwidget.h
index 1bf87d7a2..c86b7a5f9 100644
--- a/ui/presentationwidget.h
+++ b/ui/presentationwidget.h
@@ -58,6 +58,7 @@ class PresentationWidget : public QWidget, public KPDFDocumentObserver
void generateContentsPage( int page, QPainter & p );
void generateOverlay();
void initTransition( const KPDFPageTransition *transition );
+ const KPDFPageTransition defaultTransition() const;
// cache stuff
int m_width;
@@ -69,6 +70,7 @@ class PresentationWidget : public QWidget, public KPDFDocumentObserver
// transition related
QTimer * m_transitionTimer;
QTimer * m_overlayHideTimer;
+ QTimer * m_advanceTimer;
int m_transitionDelay;
int m_transitionMul;
QValueList< QRect > m_transitionRects;