author | alwin <alwin> | 2004-04-05 22:09:25 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-05 22:09:25 (UTC) |
commit | 266b184c615022484b988e1638be768b11c0c19b (patch) (side-by-side diff) | |
tree | b2560b3a64c49db414fa950fc3ef4670e25cd5ca /noncore/graphics/opie-eye/gui/mainwindow.cpp | |
parent | 930abeed35ee6dd3aaec491f13d400f825b9d9d1 (diff) | |
download | opie-266b184c615022484b988e1638be768b11c0c19b.zip opie-266b184c615022484b988e1638be768b11c0c19b.tar.gz opie-266b184c615022484b988e1638be768b11c0c19b.tar.bz2 |
yeah - autoresize and autoscale now have toggle-buttons and the image display
respect these buttons
ToDo:
find a good way for prescaled loading of images if autoScale is on (in respect
to autorotate and so on)
Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (ignore 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 @@ -94,2 +94,16 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) this, SLOT(slotConfig() ) ); + + 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 ); |