Killed ZoomFitText, not supported by Okular

Commit 02e7c0abfb says that it's "not yet
implemented", but that was KDE 4.0, before the "Trim margin" feature was
introduced.
remotes/origin/KDE/4.10
Fabio D'Urso 14 years ago
parent 7db0647128
commit c6f20bd1eb
  1. 1
      TODO
  2. 27
      ui/pageview.cpp
  3. 5
      ui/pageview.h

@ -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
this visually explains basic usage, mouse buttons functions & more..
-> 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..)
-> wallet: use asynchronous interface (to prevent ui-blocking)
-> restore a location from a given url (like http:/someurl?stringForViewport) (BR99240)

@ -193,7 +193,6 @@ public:
KAction * aZoomOut;
KToggleAction * aZoomFitWidth;
KToggleAction * aZoomFitPage;
KToggleAction * aZoomFitText;
KActionMenu * aViewMode;
KToggleAction * aViewContinuous;
QAction * aPrevAction;
@ -301,7 +300,6 @@ PageView::PageView( QWidget *parent, Okular::Document *document )
d->aToggleAnnotator = 0;
d->aZoomFitWidth = 0;
d->aZoomFitPage = 0;
d->aZoomFitText = 0;
d->aViewMode = 0;
d->aViewContinuous = 0;
d->aPrevAction = 0;
@ -458,12 +456,6 @@ void PageView::setupViewerActions( KActionCollection * ac )
ac->addAction("view_fit_to_page", d->aZoomFitPage );
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
d->aViewMode = new KActionMenu( KIcon( "view-split-left-right" ), i18n( "&View Mode" ), this );
d->aViewMode->setDelayed( false );
@ -628,7 +620,6 @@ void PageView::fitPageWidth( int page )
Okular::Settings::setViewMode( 0 );
d->aZoomFitWidth->setChecked( true );
d->aZoomFitPage->setChecked( false );
// d->aZoomFitText->setChecked( false );
d->aViewMode->menu()->actions().at( 0 )->setChecked( true );
viewport()->setUpdatesEnabled( false );
slotRelayoutPages();
@ -949,8 +940,6 @@ void PageView::updateActionState( bool haspages, bool documentChanged, bool hasf
d->aZoomFitWidth->setEnabled( haspages );
if ( d->aZoomFitPage )
d->aZoomFitPage->setEnabled( haspages );
if ( d->aZoomFitText )
d->aZoomFitText->setEnabled( haspages );
if ( d->aZoom )
{
@ -3417,9 +3406,6 @@ void PageView::updateZoom( ZoomMode newZoomMode )
case ZoomFitPage:
checkedZoomAction = d->aZoomFitPage;
break;
case ZoomFitText:
checkedZoomAction = d->aZoomFitText;
break;
case ZoomRefreshCurrent:
newZoomMode = ZoomFixed;
d->zoomFactor = -1;
@ -3449,7 +3435,6 @@ void PageView::updateZoom( ZoomMode newZoomMode )
{
d->aZoomFitWidth->setChecked( checkedZoomAction == d->aZoomFitWidth );
d->aZoomFitPage->setChecked( checkedZoomAction == d->aZoomFitPage );
// d->aZoomFitText->setChecked( checkedZoomAction == d->aZoomFitText );
}
}
else if ( newZoomMode == ZoomFixed && newFactor == d->zoomFactor )
@ -3469,13 +3454,12 @@ void PageView::updateZoomText()
// add items that describe fit actions
QStringList translated;
translated << i18n("Fit Width") << i18n("Fit Page") /*<< i18n("Fit Text")*/;
translated << i18n("Fit Width") << i18n("Fit Page");
// add percent items
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 };
int idx = 0,
selIdx = 2; // use 3 if "fit text" present
int idx = 0, selIdx = 2;
bool inserted = false; //use: "d->zoomMode != ZoomFixed" to hide Fit/* zoom ratio
while ( idx < 10 || !inserted )
{
@ -3502,8 +3486,6 @@ void PageView::updateZoomText()
selIdx = 0;
else if ( d->zoomMode == ZoomFitPage )
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
d->aZoom->setEnabled( true );
d->aZoom->selectableActionGroup()->setEnabled( true );
@ -4178,11 +4160,6 @@ void PageView::slotFitToPageToggled( bool on )
if ( on ) updateZoom( ZoomFitPage );
}
void PageView::slotFitToTextToggled( bool on )
{
if ( on ) updateZoom( ZoomFitText );
}
void PageView::slotViewMode( QAction *action )
{
const int nr = action->data().toInt();

@ -56,8 +56,8 @@ Q_OBJECT
PageView( QWidget *parent, Okular::Document *document );
~PageView();
// Zoom mode ( last 4 are internally used only! )
enum ZoomMode { ZoomFixed = 0, ZoomFitWidth = 1, ZoomFitPage = 2, ZoomFitText,
// Zoom mode ( last 3 are internally used only! )
enum ZoomMode { ZoomFixed = 0, ZoomFitWidth = 1, ZoomFitPage = 2,
ZoomIn, ZoomOut, ZoomRefreshCurrent };
enum ClearMode { ClearAllSelection, ClearOnlyDividers };
@ -223,7 +223,6 @@ Q_OBJECT
void slotZoomOut();
void slotFitToWidthToggled( bool );
void slotFitToPageToggled( bool );
void slotFitToTextToggled( bool );
void slotViewMode( QAction *action );
void slotContinuousToggled( bool );
void slotSetMouseNormal();

Loading…
Cancel
Save