author | alwin <alwin> | 2005-03-05 16:28:16 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-05 16:28:16 (UTC) |
commit | c017febf6f4092bb968d12df5a30a0af30066048 (patch) (side-by-side diff) | |
tree | cfeefc7fc3c2ee8a4485219e5dea502783f3db36 | |
parent | 206e91c510caba81f41704f11b097307d8daa6cb (diff) | |
download | opie-c017febf6f4092bb968d12df5a30a0af30066048.zip opie-c017febf6f4092bb968d12df5a30a0af30066048.tar.gz opie-c017febf6f4092bb968d12df5a30a0af30066048.tar.bz2 |
prepare for toggle of display mode of the different views
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 67 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 6 |
2 files changed, 52 insertions, 21 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 90e2e99..a96bfbd 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -50,2 +50,3 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) m_polishDone = false; + m_SmallWindow = QApplication::desktop()->size().width()<330; @@ -77,2 +78,5 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) m_aAutoRotate->setEnabled(!m_aUnscaled->isOn()); + if (m_aForceSmall) { + m_aForceSmall->setOn(m_cfg->readBoolEntry("dontshowseperate",true)); + } odebug << "mainwindow constructor done" << oendl; @@ -256,5 +260,5 @@ void PMainWindow::initDisp() { if (m_disp) { - if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { +// if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { //m_disp->setMinimumSize(QApplication::desktop()->size()/2); - } +// } m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType); @@ -308,2 +312,3 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay) setUpdatesEnabled(false); +#if 0 if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { @@ -314,7 +319,3 @@ void PMainWindow::setupViewWindow(bool current, bool forceDisplay) } - if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { - m_disp->reparent(0,QPoint(10,10)); - } else { - m_disp->reparent(0,QPoint(0,0)); - } +#endif m_disp->setBackgroundColor(white); @@ -356,5 +357,7 @@ void PMainWindow::slotShowInfo( const QString& inf ) { m_info->setPath( inf ); - if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { + if (m_SmallWindow) { m_aNext->removeFrom(toolBar); m_aPrevious->removeFrom(toolBar); + fsButton->hide(); + } m_aNext->setEnabled(false); @@ -365,4 +368,2 @@ void PMainWindow::slotShowInfo( const QString& inf ) { m_aStartSlide->setEnabled(false); - fsButton->hide(); - } m_stack->raiseWidget( ImageInfo ); @@ -377,7 +378,9 @@ void PMainWindow::slotDisplay( const QString& inf ) { m_disp->setImage( inf ); - if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { + if (m_SmallWindow) { if (m_gPrevNext->isEnabled()==false) { m_gPrevNext->addTo(toolBar); + fsButton->hide(); + } + } m_gPrevNext->setEnabled(true); - m_aDirUp->setEnabled(false); @@ -386,5 +389,3 @@ void PMainWindow::slotDisplay( const QString& inf ) { m_aStartSlide->setEnabled(false); - fsButton->hide(); - } - } + if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) { @@ -401,4 +402,6 @@ void PMainWindow::raiseIconView() { setUpdatesEnabled(false); - if (m_stack->mode() == Opie::Ui::OWidgetStack::SmallScreen) { + if (m_SmallWindow) { m_gPrevNext->removeFrom(toolBar); + fsButton->show(); + } m_gPrevNext->setEnabled(false); @@ -408,4 +411,3 @@ void PMainWindow::raiseIconView() { m_aStartSlide->setEnabled(true); - fsButton->show(); - } + if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { @@ -624,2 +626,10 @@ void PMainWindow::setupActions() m_hGroup->insert(m_aFullScreen); + + if (!m_SmallWindow) { + m_aForceSmall = new QAction(tr("Dont show seperate windows"),Resource::loadIconSet( "AppsIcon" ), 0, 0, this, 0, true); + m_aForceSmall->setToggleAction(true); + connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool))); + } else { + m_aForceSmall = 0; + } } @@ -649,3 +659,3 @@ void PMainWindow::setupToolbar() - if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { + if (!m_SmallWindow) { m_gPrevNext->addTo(toolBar); @@ -692,2 +702,6 @@ void PMainWindow::setupMenu() m_gPrevNext->addTo(dispMenu); + if (m_aForceSmall) { + dispMenu->insertSeparator(); + m_aForceSmall->addTo(dispMenu); + } @@ -739 +753,16 @@ void PMainWindow::polish() } + +void PMainWindow::slotForceSmall(bool how) +{ + odebug << "Disable separate windows: " << how << oendl; + if (m_stack) { + if (how) { + m_stack->forceMode(Opie::Ui::OWidgetStack::SmallScreen); + } else { + m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); + } + } + if (autoSave) { + m_cfg->writeEntry("dontshowseperate",how); + } +} diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h index 2f54090..a49a9d3 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.h +++ b/noncore/graphics/opie-eye/gui/mainwindow.h @@ -82,5 +82,6 @@ private: ImageView *m_disp; - bool autoSave; + bool autoSave:1; bool m_setDocCalled:1; bool m_polishDone:1; + bool m_SmallWindow:1; QToolButton*fsButton; @@ -92,3 +93,3 @@ private: QAction *m_aNext,*m_aPrevious,*m_aFullScreen; - QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer; + QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer,*m_aForceSmall; @@ -107,2 +108,3 @@ private slots: void dirChanged(); + void slotForceSmall(bool); }; |