Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 7f384bd..88acd59 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -95,2 +95,16 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) + rotateButton = new QToolButton(bar); + rotateButton->setIconSet( Resource::loadIconSet( "rotate" ) ); + rotateButton->setToggleButton(true); + rotateButton->setOn(true); + connect(rotateButton,SIGNAL(toggled(bool)),this,SLOT(slotRotateToggled(bool))); + autoRotate = true; + + btn = new QToolButton(bar); + btn->setIconSet( Resource::loadIconSet( "1to1" ) ); + btn->setToggleButton(true); + btn->setOn(false); + connect(btn,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); + autoScale = true; + } @@ -101,2 +115,21 @@ PMainWindow::~PMainWindow() { +void PMainWindow::slotRotateToggled(bool how) +{ + autoRotate = how; + if (m_disp) { + m_disp->setAutoRotate(how); + } +} + +void PMainWindow::slotScaleToggled(bool how) +{ + autoScale = !how; + if (m_disp) { + m_disp->setAutoScale(autoScale); + } + if (!autoScale && autoRotate) { + rotateButton->setOn(false); + } + rotateButton->setEnabled(!how); +} @@ -182,2 +215,7 @@ void PMainWindow::initDisp() { initT<ImageScrollView>( "Image ScrollView", &m_disp, ImageDisplay ); + if (m_disp) { + m_disp->setAutoScale(autoScale); + m_disp->setAutoRotate(autoRotate); + } + } @@ -200,4 +238,5 @@ void PMainWindow::slotShowInfo( const QString& inf ) { void PMainWindow::slotDisplay( const QString& inf ) { - if ( !m_disp ) + if ( !m_disp ) { initDisp(); + } m_disp->setImage( inf ); |