Commit d905b1fd authored by Enrico Ros's avatar Enrico Ros
Browse files

Single page mode back to work laying out in the qscrollview only current

page, hiding others and redefining contents area. Bookmark action moved to
document, that updates observers state after each operation. Many fixes in
pageview. Pixmapwidget returns a const KPDFPage*. No scroll-on-drag and
go-to-page only with left click onThumbnailList. Starting to reorganize
PageView events (link test with cursor changing on page sample impl.).

svn path=/branches/kpdf_experiments/kdegraphics/kpdf/; revision=350583
parent 8d67d2d0
......@@ -11,17 +11,17 @@ More items
-> zoom: fit text (with configurable margin)
-> automatic online dictionaries / translators (BR80338)
-> session support: restoring page location (BR82589)
-> nice label box to the top to display messages to user (for example session restoring,etc..)
-> wrong zoom buttons order (BR74248) (check consistancy with kdvi/kghostview/.. (not konq))
Porting / In progress on the branch (first item comes first):
-> restore single page mode (broke up)
-> fix keys/mouse in single/continous modes
-> porting Albert's link following
-> minimize PageView's reLayout and requestPixmaps on changes
-> implementing async document generator using Albert's thread as the generation thread
-> reading aids (accessibility): mode: normal, invert, contrast, recolor bg/text
Done (sorted by inv.time)
-> remake single page mode
-> zoom buttons in sync with text
-> added continous mode
-> added multiple pages per view (gui selects 1 or 2 ppv)
......
......@@ -292,6 +292,16 @@ void KPDFDocument::slotSetFilter( const QString & pattern, bool keepCase )
processPageList( false );
}
void KPDFDocument::slotBookmarkPage( int page, bool on )
{
KPDFPage * p = ( page < d->pages.count() ) ? d->pages[page] : 0;
if ( p )
{
p->bookmark( on );
foreachObserver( notifyPixmapChanged( page ) );
}
}
void KPDFDocument::slotFind( const QString & string, bool keepCase )
{
// turn selection drawing off on filtered pages
......
......@@ -77,6 +77,7 @@ public slots:
void slotSetCurrentPage( int page );
void slotSetCurrentPagePosition( int page, float position );
void slotSetFilter( const QString & pattern, bool caseSensitive );
void slotBookmarkPage( int page, bool enabled );
void slotFind( const QString & text = "", bool caseSensitive = false );
void slotGoToLink( /* UnknownType unknown */ );
......
......@@ -17,8 +17,8 @@
<Action name="zoom_fit_width"/>
<Action name="zoom_fit_page"/>
<Separator/>
<Action name="view_twopages"/>
<Action name="view_continous"/>
<Action name="view_twopages"/>
</Menu>
<Menu name="go"><text>&amp;Go</text>
<Action name="first_page"/>
......@@ -46,8 +46,8 @@
<!--Action name="zoom_fit_page"/-->
<Merge/>
<Separator/>
<Action name="view_twopages"/>
<Action name="view_continous"/>
<Action name="view_twopages"/>
<Separator/>
<Action name="mouse_drag"/>
<Action name="mouse_select"/>
......
This diff is collapsed.
......@@ -62,9 +62,9 @@ protected:
void contentsMouseReleaseEvent( QMouseEvent* );
void contentsMouseMoveEvent( QMouseEvent* );
void viewportResizeEvent( QResizeEvent* );
void keyPressEvent( QKeyEvent* );
void wheelEvent( QWheelEvent* );
void viewportResizeEvent( QResizeEvent* );
void dragEnterEvent( QDragEnterEvent* );
void dropEvent( QDropEvent* );
......@@ -75,7 +75,7 @@ signals:
private slots:
// connected to local actions
void slotZoom( const QString& );
void slotZoom();
void slotZoomIn();
void slotZoomOut();
void slotFitToWidthToggled( bool );
......@@ -94,8 +94,11 @@ private slots:
void slotRequestVisiblePixmaps( int left = -1, int top = -1 );
private:
// update internal zoom values and end in a slotRelayoutPages();
void updateZoom( ZoomMode newZm );
// update the text on the label using global zoom value or current page's one
void updateZoomText();
// return the widget placed on a certain point or 0 if clicking on empty space
PageWidget * pickPageOnPoint( int x, int y );
// FIXME REMOVE ME what does atTop() means if I see 4 tiled pages on screen ?
......
......@@ -64,6 +64,11 @@ int PixmapWidget::pageNumber() const
return m_page->number();
}
const KPDFPage * PixmapWidget::page() const
{
return m_page;
}
void PixmapWidget::setPixmapMargins( int left, int top, int right, int bottom )
{
m_marginLeft = left;
......
......@@ -38,6 +38,7 @@ public:
// other queries
int pageNumber() const;
const KPDFPage * page() const;
protected:
void setPixmapMargins( int left, int top, int right, int bottom );
......
......@@ -36,6 +36,7 @@ ThumbnailList::ThumbnailList( QWidget *parent, KPDFDocument *document )
viewport()->setPaletteBackgroundColor( Qt::gray );
setResizePolicy( Manual );
setAcceptDrops( true );
setDragAutoScroll( false );
// set contents background to the 'base' color
viewport()->setPaletteBackgroundColor( palette().active().base() );
......@@ -183,6 +184,8 @@ void ThumbnailList::keyPressEvent( QKeyEvent * keyEvent )
void ThumbnailList::contentsMousePressEvent( QMouseEvent * e )
{
if ( e->button() != Qt::LeftButton )
return;
int clickY = e->y();
QValueVector<ThumbnailWidget *>::iterator thumbIt = m_thumbnails.begin();
QValueVector<ThumbnailWidget *>::iterator thumbEnd = m_thumbnails.end();
......
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