Commit 3f06c929 authored by Pino Toscano's avatar Pino Toscano

remove qt3 hack and make the left toolbox collapsible again

svn path=/trunk/playground/graphics/okular/; revision=595267
parent 8c4c6730
......@@ -130,6 +130,7 @@ Part::Part(QWidget *parentWidget,
m_leftPanel->setMaximumWidth( 300 );
QVBoxLayout * leftPanelLayout = new QVBoxLayout( m_leftPanel );
leftPanelLayout->setMargin( 0 );
m_splitter->setCollapsible( 0, true );
// widgets: [left toolbox/..] | []
m_toolBox = new QToolBox( m_leftPanel );
......@@ -315,9 +316,8 @@ Part::Part(QWidget *parentWidget,
splitterSizes.push_back( 500 );
}
m_splitter->setSizes( splitterSizes );
// get notified about splitter size changes (HACK that will be removed
// by connecting to Qt4::QSplitter's sliderMoved())
m_pageView->installEventFilter( this );
// get notified about splitter size changes
connect( m_splitter, SIGNAL( splitterMoved( int, int ) ), this, SLOT( splitterMoved( int, int ) ) );
// document watcher and reloader
m_watcher = new KDirWatch( this );
......@@ -684,14 +684,11 @@ void Part::cannotQuit()
KMessageBox::information(widget(), i18n("This link points to a quit application action that does not work when using the embedded viewer."), QString::null, "warnNoQuitIfNotInOkular::");
}
bool Part::eventFilter( QObject * watched, QEvent * e )
void Part::splitterMoved( int /*pos*/, int index )
{
// if pageView has been resized, save splitter sizes
if ( watched == m_pageView && e->type() == QEvent::Resize )
if ( index == 1 )
saveSplitterSize();
// only intercept events, don't block them
return false;
}
void Part::slotShowLeftPanel()
......
......@@ -104,8 +104,6 @@ protected:
bool openFile();
bool openUrl(const KUrl &url);
bool closeUrl();
// filter that watches for splitter size changes
bool eventFilter( QObject * watched, QEvent * e );
void supportedMimetypes();
protected slots:
......@@ -130,6 +128,7 @@ protected slots:
bool slotImportPSFile();
void close();
void cannotQuit();
void splitterMoved( int pos, int index );
void setMimeTypes(KIO::Job *job);
void saveSplitterSize();
// can be connected to widget elements
......
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