Commit c6f20bd1 authored by Fabio D'Urso's avatar Fabio D'Urso

Killed ZoomFitText, not supported by Okular

Commit 02e7c0ab says that it's "not yet
implemented", but that was KDE 4.0, before the "Trim margin" feature was
introduced.
parent 7db06471
...@@ -102,7 +102,6 @@ More items (first items will enter 'In progress list' first): ...@@ -102,7 +102,6 @@ More items (first items will enter 'In progress list' first):
-> add okular manual in PDF format loaded on the first startup or on menu->help->manual -> add okular manual in PDF format loaded on the first startup or on menu->help->manual
this visually explains basic usage, mouse buttons functions & more.. this visually explains basic usage, mouse buttons functions & more..
-> ADD: click over image allows "save image" [60% done (activerect of type image)] -> ADD: click over image allows "save image" [60% done (activerect of type image)]
-> zoom: fit text (with configurable margin)
-> bookview: 3d opengl widget for viewing the document as a real book (turning pages, etc..) -> bookview: 3d opengl widget for viewing the document as a real book (turning pages, etc..)
-> wallet: use asynchronous interface (to prevent ui-blocking) -> wallet: use asynchronous interface (to prevent ui-blocking)
-> restore a location from a given url (like http:/someurl?stringForViewport) (BR99240) -> restore a location from a given url (like http:/someurl?stringForViewport) (BR99240)
......
...@@ -193,7 +193,6 @@ public: ...@@ -193,7 +193,6 @@ public:
KAction * aZoomOut; KAction * aZoomOut;
KToggleAction * aZoomFitWidth; KToggleAction * aZoomFitWidth;
KToggleAction * aZoomFitPage; KToggleAction * aZoomFitPage;
KToggleAction * aZoomFitText;
KActionMenu * aViewMode; KActionMenu * aViewMode;
KToggleAction * aViewContinuous; KToggleAction * aViewContinuous;
QAction * aPrevAction; QAction * aPrevAction;
...@@ -301,7 +300,6 @@ PageView::PageView( QWidget *parent, Okular::Document *document ) ...@@ -301,7 +300,6 @@ PageView::PageView( QWidget *parent, Okular::Document *document )
d->aToggleAnnotator = 0; d->aToggleAnnotator = 0;
d->aZoomFitWidth = 0; d->aZoomFitWidth = 0;
d->aZoomFitPage = 0; d->aZoomFitPage = 0;
d->aZoomFitText = 0;
d->aViewMode = 0; d->aViewMode = 0;
d->aViewContinuous = 0; d->aViewContinuous = 0;
d->aPrevAction = 0; d->aPrevAction = 0;
...@@ -458,12 +456,6 @@ void PageView::setupViewerActions( KActionCollection * ac ) ...@@ -458,12 +456,6 @@ void PageView::setupViewerActions( KActionCollection * ac )
ac->addAction("view_fit_to_page", d->aZoomFitPage ); ac->addAction("view_fit_to_page", d->aZoomFitPage );
connect( d->aZoomFitPage, SIGNAL(toggled(bool)), SLOT(slotFitToPageToggled(bool)) ); connect( d->aZoomFitPage, SIGNAL(toggled(bool)), SLOT(slotFitToPageToggled(bool)) );
/*
d->aZoomFitText = new KToggleAction(KIcon( "zoom-fit-best" ), i18n("Fit &Text"), this);
ac->addAction("zoom_fit_text", d->aZoomFitText );
connect( d->aZoomFitText, SIGNAL(toggled(bool)), SLOT(slotFitToTextToggled(bool)) );
*/
// View-Layout actions // View-Layout actions
d->aViewMode = new KActionMenu( KIcon( "view-split-left-right" ), i18n( "&View Mode" ), this ); d->aViewMode = new KActionMenu( KIcon( "view-split-left-right" ), i18n( "&View Mode" ), this );
d->aViewMode->setDelayed( false ); d->aViewMode->setDelayed( false );
...@@ -628,7 +620,6 @@ void PageView::fitPageWidth( int page ) ...@@ -628,7 +620,6 @@ void PageView::fitPageWidth( int page )
Okular::Settings::setViewMode( 0 ); Okular::Settings::setViewMode( 0 );
d->aZoomFitWidth->setChecked( true ); d->aZoomFitWidth->setChecked( true );
d->aZoomFitPage->setChecked( false ); d->aZoomFitPage->setChecked( false );
// d->aZoomFitText->setChecked( false );
d->aViewMode->menu()->actions().at( 0 )->setChecked( true ); d->aViewMode->menu()->actions().at( 0 )->setChecked( true );
viewport()->setUpdatesEnabled( false ); viewport()->setUpdatesEnabled( false );
slotRelayoutPages(); slotRelayoutPages();
...@@ -949,8 +940,6 @@ void PageView::updateActionState( bool haspages, bool documentChanged, bool hasf ...@@ -949,8 +940,6 @@ void PageView::updateActionState( bool haspages, bool documentChanged, bool hasf
d->aZoomFitWidth->setEnabled( haspages ); d->aZoomFitWidth->setEnabled( haspages );
if ( d->aZoomFitPage ) if ( d->aZoomFitPage )
d->aZoomFitPage->setEnabled( haspages ); d->aZoomFitPage->setEnabled( haspages );
if ( d->aZoomFitText )
d->aZoomFitText->setEnabled( haspages );
if ( d->aZoom ) if ( d->aZoom )
{ {
...@@ -3417,9 +3406,6 @@ void PageView::updateZoom( ZoomMode newZoomMode ) ...@@ -3417,9 +3406,6 @@ void PageView::updateZoom( ZoomMode newZoomMode )
case ZoomFitPage: case ZoomFitPage:
checkedZoomAction = d->aZoomFitPage; checkedZoomAction = d->aZoomFitPage;
break; break;
case ZoomFitText:
checkedZoomAction = d->aZoomFitText;
break;
case ZoomRefreshCurrent: case ZoomRefreshCurrent:
newZoomMode = ZoomFixed; newZoomMode = ZoomFixed;
d->zoomFactor = -1; d->zoomFactor = -1;
...@@ -3449,7 +3435,6 @@ void PageView::updateZoom( ZoomMode newZoomMode ) ...@@ -3449,7 +3435,6 @@ void PageView::updateZoom( ZoomMode newZoomMode )
{ {
d->aZoomFitWidth->setChecked( checkedZoomAction == d->aZoomFitWidth ); d->aZoomFitWidth->setChecked( checkedZoomAction == d->aZoomFitWidth );
d->aZoomFitPage->setChecked( checkedZoomAction == d->aZoomFitPage ); d->aZoomFitPage->setChecked( checkedZoomAction == d->aZoomFitPage );
// d->aZoomFitText->setChecked( checkedZoomAction == d->aZoomFitText );
} }
} }
else if ( newZoomMode == ZoomFixed && newFactor == d->zoomFactor ) else if ( newZoomMode == ZoomFixed && newFactor == d->zoomFactor )
...@@ -3469,13 +3454,12 @@ void PageView::updateZoomText() ...@@ -3469,13 +3454,12 @@ void PageView::updateZoomText()
// add items that describe fit actions // add items that describe fit actions
QStringList translated; QStringList translated;
translated << i18n("Fit Width") << i18n("Fit Page") /*<< i18n("Fit Text")*/; translated << i18n("Fit Width") << i18n("Fit Page");
// add percent items // add percent items
QString double_oh( "00" ); QString double_oh( "00" );
const float zoomValue[10] = { 0.12, 0.25, 0.33, 0.50, 0.66, 0.75, 1.00, 1.25, 1.50, 2.00 }; const float zoomValue[10] = { 0.12, 0.25, 0.33, 0.50, 0.66, 0.75, 1.00, 1.25, 1.50, 2.00 };
int idx = 0, int idx = 0, selIdx = 2;
selIdx = 2; // use 3 if "fit text" present
bool inserted = false; //use: "d->zoomMode != ZoomFixed" to hide Fit/* zoom ratio bool inserted = false; //use: "d->zoomMode != ZoomFixed" to hide Fit/* zoom ratio
while ( idx < 10 || !inserted ) while ( idx < 10 || !inserted )
{ {
...@@ -3502,8 +3486,6 @@ void PageView::updateZoomText() ...@@ -3502,8 +3486,6 @@ void PageView::updateZoomText()
selIdx = 0; selIdx = 0;
else if ( d->zoomMode == ZoomFitPage ) else if ( d->zoomMode == ZoomFitPage )
selIdx = 1; selIdx = 1;
else if ( d->zoomMode == ZoomFitText )
selIdx = 2;
// we have to temporarily enable the actions as otherwise we can't set a new current item // we have to temporarily enable the actions as otherwise we can't set a new current item
d->aZoom->setEnabled( true ); d->aZoom->setEnabled( true );
d->aZoom->selectableActionGroup()->setEnabled( true ); d->aZoom->selectableActionGroup()->setEnabled( true );
...@@ -4178,11 +4160,6 @@ void PageView::slotFitToPageToggled( bool on ) ...@@ -4178,11 +4160,6 @@ void PageView::slotFitToPageToggled( bool on )
if ( on ) updateZoom( ZoomFitPage ); if ( on ) updateZoom( ZoomFitPage );
} }
void PageView::slotFitToTextToggled( bool on )
{
if ( on ) updateZoom( ZoomFitText );
}
void PageView::slotViewMode( QAction *action ) void PageView::slotViewMode( QAction *action )
{ {
const int nr = action->data().toInt(); const int nr = action->data().toInt();
......
...@@ -56,8 +56,8 @@ Q_OBJECT ...@@ -56,8 +56,8 @@ Q_OBJECT
PageView( QWidget *parent, Okular::Document *document ); PageView( QWidget *parent, Okular::Document *document );
~PageView(); ~PageView();
// Zoom mode ( last 4 are internally used only! ) // Zoom mode ( last 3 are internally used only! )
enum ZoomMode { ZoomFixed = 0, ZoomFitWidth = 1, ZoomFitPage = 2, ZoomFitText, enum ZoomMode { ZoomFixed = 0, ZoomFitWidth = 1, ZoomFitPage = 2,
ZoomIn, ZoomOut, ZoomRefreshCurrent }; ZoomIn, ZoomOut, ZoomRefreshCurrent };
enum ClearMode { ClearAllSelection, ClearOnlyDividers }; enum ClearMode { ClearAllSelection, ClearOnlyDividers };
...@@ -223,7 +223,6 @@ Q_OBJECT ...@@ -223,7 +223,6 @@ Q_OBJECT
void slotZoomOut(); void slotZoomOut();
void slotFitToWidthToggled( bool ); void slotFitToWidthToggled( bool );
void slotFitToPageToggled( bool ); void slotFitToPageToggled( bool );
void slotFitToTextToggled( bool );
void slotViewMode( QAction *action ); void slotViewMode( QAction *action );
void slotContinuousToggled( bool ); void slotContinuousToggled( bool );
void slotSetMouseNormal(); void slotSetMouseNormal();
......
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