Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index 5b34ca2..53376c0 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -105,27 +105,56 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
105 | if (e->button()==1) { | 105 | if (e->button()==1) { |
106 | return OImageScrollView::contentsMousePressEvent(e); | 106 | return OImageScrollView::contentsMousePressEvent(e); |
107 | } | 107 | } |
108 | if (!fullScreen()) return; | 108 | // if (!fullScreen()) return; |
109 | #if 0 | ||
110 | // doesn't work right (repainting problems) | ||
111 | odebug << "Popup " << oendl; | 109 | odebug << "Popup " << oendl; |
112 | QPopupMenu *m = new QPopupMenu(0); | 110 | QPopupMenu *m = new QPopupMenu(0); |
113 | if (!m) return; | 111 | if (!m) return; |
114 | m->insertItem(tr("Previous image"),ShowPrevious); | 112 | bool old = fullScreen(); |
115 | m->insertItem(tr("Next image"),ShowNext); | 113 | m->insertItem(tr("Toggle fullscreen"),this, SIGNAL(toggleFullScreen())); |
114 | if (fullScreen()) { | ||
115 | m->insertSeparator(); | ||
116 | m->insertItem(tr("Previous image"),this,SIGNAL(dispPrev())); | ||
117 | m->insertItem(tr("Next image"),this,SIGNAL(dispNext())); | ||
116 | m->insertSeparator(); | 118 | m->insertSeparator(); |
117 | m->insertItem(tr("Toggle fullscreen"),FullScreen); | 119 | m->insertItem(tr("Toggle autoscale"),this, SIGNAL(toggleAutoscale())); |
118 | m->insertItem(tr("Toggle autoscale"),Autoscale); | 120 | m->insertItem(tr("Toggle autorotate"),this, SIGNAL(toggleAutorotate())); |
119 | m->insertItem(tr("Toggle autorotate"),Autorotate); | 121 | m->insertItem(tr("Toggle thumbnail"),this, SIGNAL(toggleZoomer())); |
120 | m->insertItem(tr("Toggle thumbnail"),Zoomer); | 122 | } |
121 | m->setFocus(); | 123 | m->setFocus(); |
122 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 124 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
123 | delete m; | 125 | delete m; |
124 | parentWidget()->showFullScreen(); | 126 | /* if we were fullScreen() and must overlap the taskbar again */ |
125 | #endif | 127 | if (fullScreen() && old) { |
128 | enableFullscreen(); | ||
129 | // parentWidget()->hide(); | ||
130 | // parentWidget()->show(); | ||
131 | } | ||
126 | } | 132 | } |
127 | 133 | ||
128 | void ImageView::setFullScreen(bool how) | 134 | void ImageView::setFullScreen(bool how) |
129 | { | 135 | { |
130 | m_isFullScreen = how; | 136 | m_isFullScreen = how; |
131 | } | 137 | } |
138 | |||
139 | void ImageView::focusInEvent(QFocusEvent *) | ||
140 | { | ||
141 | // Always do it here, no matter the size. | ||
142 | /* result in an endless loop */ | ||
143 | // if (fullScreen()) enableFullscreen(); | ||
144 | } | ||
145 | |||
146 | void ImageView::enableFullscreen() | ||
147 | { | ||
148 | if (!fullScreen()) return; | ||
149 | // Make sure size is correct | ||
150 | parentWidget()->setFixedSize(qApp->desktop()->size()); | ||
151 | // This call is needed because showFullScreen won't work | ||
152 | // correctly if the widget already considers itself to be fullscreen. | ||
153 | parentWidget()->showNormal(); | ||
154 | // This is needed because showNormal() forcefully changes the window | ||
155 | // style to WSTyle_TopLevel. | ||
156 | parentWidget()->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); | ||
157 | // Enable fullscreen. | ||
158 | parentWidget()->showFullScreen(); | ||
159 | } | ||
160 | |||