remove qt3 hack and make the left toolbox collapsible again

svn path=/trunk/playground/graphics/okular/; revision=595267
This commit is contained in:
Pino Toscano 2006-10-13 19:30:39 +00:00
parent 8c4c673073
commit 3f06c92940
2 changed files with 6 additions and 10 deletions

View file

@ -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()

3
part.h
View file

@ -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