Commit 20e1fde0 authored by Jan Hambrecht's avatar Jan Hambrecht

It is not necessary to wrap the zoom action in a toolbar

when adding it to the status bar. Just add the custom 
widget to the status bar.


svn path=/trunk/koffice/; revision=648876
parent da320081
......@@ -73,7 +73,7 @@ void KisZoomManager::setup( KActionCollection * actionCollection )
m_zoomController->setDocumentSize(QSizeF(img->width() / img->xRes(), img->height() / img->yRes() ));
m_zoomAction = m_zoomController->zoomAction();
m_view->viewBar()->addAction(m_zoomAction);
m_view->addStatusBarItem( m_zoomAction->createWidget( m_view->KoView::statusBar() ), 0, true );
m_showRulersAction = new KToggleAction(i18n("Show Rulers"), this);
actionCollection->addAction("view_ruler", m_showRulersAction );
......
......@@ -222,8 +222,8 @@ void KoZoomAction::zoomOut()
QWidget * KoZoomAction::createWidget( QWidget * _parent )
{
QToolBar *parent = qobject_cast<QToolBar *>(_parent);
if (!parent || !qobject_cast<QStatusBar*>(parent->parent()))
// create the custom widget only if we add the action to the status bar
if( ! qobject_cast<QStatusBar*>(_parent) )
return KSelectAction::createWidget(_parent);
QWidget * group = new QWidget(_parent);
......
......@@ -50,6 +50,7 @@
#include <kicon.h>
#include <ktoggleaction.h>
#include <kactioncollection.h>
#include <kstatusbar.h>
KoPAView::KoPAView( KoPADocument *document, QWidget *parent )
: KoView( document, parent )
......@@ -96,7 +97,7 @@ void KoPAView::initGUI()
m_zoomController = new KoZoomController( m_canvasController, &m_zoomHandler, actionCollection() );
m_zoomAction = m_zoomController->zoomAction();
viewBar()->addAction( m_zoomAction );
addStatusBarItem( m_zoomAction->createWidget( statusBar() ), 0 );
connect( m_zoomController, SIGNAL( zoomChanged( KoZoomMode::Mode, double ) ),
this, SLOT( slotZoomChanged( KoZoomMode::Mode, double ) ) );
......
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