|
Lines 43-49
Link Here
|
| 43 |
#define ENABLE_PROGRESS_OVERLAY |
43 |
#define ENABLE_PROGRESS_OVERLAY |
| 44 |
|
44 |
|
| 45 |
|
45 |
|
| 46 |
// a frame contains a pointer to the page object, its tqgeometry and the |
46 |
// a frame contains a pointer to the page object, its geometry and the |
| 47 |
// transition effect to the next frame |
47 |
// transition effect to the next frame |
| 48 |
struct PresentationFrame |
48 |
struct PresentationFrame |
| 49 |
{ |
49 |
{ |
|
Lines 56-62
Link Here
|
| 56 |
: TQDialog( parent, "presentationWidget", true, WDestructiveClose | WStyle_NoBorder), |
56 |
: TQDialog( parent, "presentationWidget", true, WDestructiveClose | WStyle_NoBorder), |
| 57 |
m_pressedLink( 0 ), m_handCursor( false ), m_document( doc ), m_frameIndex( -1 ) |
57 |
m_pressedLink( 0 ), m_handCursor( false ), m_document( doc ), m_frameIndex( -1 ) |
| 58 |
{ |
58 |
{ |
| 59 |
// set look and tqgeometry |
59 |
// set look and geometry |
| 60 |
setBackgroundMode( TQt::NoBackground ); |
60 |
setBackgroundMode( TQt::NoBackground ); |
| 61 |
|
61 |
|
| 62 |
m_width = -1; |
62 |
m_width = -1; |
|
Lines 124-130
Link Here
|
| 124 |
{ |
124 |
{ |
| 125 |
PresentationFrame * frame = new PresentationFrame(); |
125 |
PresentationFrame * frame = new PresentationFrame(); |
| 126 |
frame->page = *setIt; |
126 |
frame->page = *setIt; |
| 127 |
// calculate frame tqgeometry keeping constant aspect ratio |
127 |
// calculate frame geometry keeping constant aspect ratio |
| 128 |
float pageRatio = frame->page->ratio(); |
128 |
float pageRatio = frame->page->ratio(); |
| 129 |
int pageWidth = m_width, |
129 |
int pageWidth = m_width, |
| 130 |
pageHeight = m_height; |
130 |
pageHeight = m_height; |
|
Lines 289-295
Link Here
|
| 289 |
// show the bar if reaching top 2 pixels |
289 |
// show the bar if reaching top 2 pixels |
| 290 |
if ( e->y() <= (tqgeometry().top() + 1) ) |
290 |
if ( e->y() <= (tqgeometry().top() + 1) ) |
| 291 |
m_topBar->show(); |
291 |
m_topBar->show(); |
| 292 |
// handle "dragging the wheel" if clicking on its tqgeometry |
292 |
// handle "dragging the wheel" if clicking on its geometry |
| 293 |
else if ( e->state() == Qt::LeftButton && m_overlayGeometry.contains( e->pos() ) ) |
293 |
else if ( e->state() == Qt::LeftButton && m_overlayGeometry.contains( e->pos() ) ) |
| 294 |
overlayClick( e->pos() ); |
294 |
overlayClick( e->pos() ); |
| 295 |
} |
295 |
} |
|
Lines 378-384
Link Here
|
| 378 |
if ( m_frameIndex < 0 || m_frameIndex >= (int)m_frames.size() ) |
378 |
if ( m_frameIndex < 0 || m_frameIndex >= (int)m_frames.size() ) |
| 379 |
return 0; |
379 |
return 0; |
| 380 |
|
380 |
|
| 381 |
// get frame, page and tqgeometry |
381 |
// get frame, page and geometry |
| 382 |
const PresentationFrame * frame = m_frames[ m_frameIndex ]; |
382 |
const PresentationFrame * frame = m_frames[ m_frameIndex ]; |
| 383 |
const KPDFPage * page = frame->page; |
383 |
const KPDFPage * page = frame->page; |
| 384 |
const TQRect & frameGeometry = frame->tqgeometry; |
384 |
const TQRect & frameGeometry = frame->tqgeometry; |
|
Lines 396-402
Link Here
|
| 396 |
if ( !object ) |
396 |
if ( !object ) |
| 397 |
return 0; |
397 |
return 0; |
| 398 |
|
398 |
|
| 399 |
// compute link tqgeometry if destination rect present |
399 |
// compute link geometry if destination rect present |
| 400 |
if ( tqgeometry ) |
400 |
if ( tqgeometry ) |
| 401 |
{ |
401 |
{ |
| 402 |
*tqgeometry = object->tqgeometry( frameGeometry.width(), frameGeometry.height() ); |
402 |
*tqgeometry = object->tqgeometry( frameGeometry.width(), frameGeometry.height() ); |
|
Lines 622-628
Link Here
|
| 622 |
void PresentationWidget::generateOverlay() |
622 |
void PresentationWidget::generateOverlay() |
| 623 |
{ |
623 |
{ |
| 624 |
#ifdef ENABLE_PROGRESS_OVERLAY |
624 |
#ifdef ENABLE_PROGRESS_OVERLAY |
| 625 |
// calculate overlay tqgeometry and resize pixmap if needed |
625 |
// calculate overlay geometry and resize pixmap if needed |
| 626 |
int side = m_width / 16; |
626 |
int side = m_width / 16; |
| 627 |
m_overlayGeometry.setRect( m_width - side - 4, 4, side, side ); |
627 |
m_overlayGeometry.setRect( m_width - side - 4, 4, side, side ); |
| 628 |
if ( m_lastRenderedOverlay.width() != side ) |
628 |
if ( m_lastRenderedOverlay.width() != side ) |