summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/imageview.cpp
authoralwin <alwin>2004-04-23 13:22:22 (UTC)
committer alwin <alwin>2004-04-23 13:22:22 (UTC)
commitda6a98dbc555018a29bf140ed8e890015240b322 (patch) (side-by-side diff)
tree3b8b05451fcd2c653982e1cd63b92eb0fb8b9a72 /noncore/graphics/opie-eye/gui/imageview.cpp
parent33666eb31ae6d35aa527cf7bf22c2c2e0dcd6824 (diff)
downloadopie-da6a98dbc555018a29bf140ed8e890015240b322.zip
opie-da6a98dbc555018a29bf140ed8e890015240b322.tar.gz
opie-da6a98dbc555018a29bf140ed8e890015240b322.tar.bz2
ok, I think I have all tried to reduce flicker in fullscreen when opie-eye
get focus back. But as long I must repaint the fullScreenwidget my self when taskbar comes visible I can not do anymore.
Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp
index 03f3c1c..b4f3110 100644
--- a/noncore/graphics/opie-eye/gui/imageview.cpp
+++ b/noncore/graphics/opie-eye/gui/imageview.cpp
@@ -110,7 +110,6 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
odebug << "Popup " << oendl;
QPopupMenu *m = new QPopupMenu(0);
if (!m) return;
- bool old = fullScreen();
m->insertItem(tr("Toggle fullscreen"),this, SIGNAL(toggleFullScreen()));
if (fullScreen()) {
m->insertSeparator();
@@ -129,6 +128,13 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
void ImageView::setFullScreen(bool how)
{
m_isFullScreen = how;
+ if (how) {
+ m_ignore_next_in = true;
+ setFixedSize(qApp->desktop()->size());
+ showFullScreen();
+ } else {
+ setMinimumSize(10,10);
+ }
}
void ImageView::focusInEvent(QFocusEvent *)
@@ -140,29 +146,29 @@ void ImageView::focusInEvent(QFocusEvent *)
if (fullScreen()) enableFullscreen();
}
+void ImageView::hide()
+{
+ if (fullScreen()) {
+ m_ignore_next_in = true;
+ showNormal();
+ }
+ QWidget::hide();
+}
void ImageView::enableFullscreen()
{
- // This call is needed because showFullScreen won't work
- // correctly if the widget already considers itself to be fullscreen.
if (!fullScreen()) return;
if (m_ignore_next_in) {m_ignore_next_in = false;return;}
setUpdatesEnabled(false);
- parentWidget()->showNormal();
// This is needed because showNormal() forcefully changes the window
// style to WSTyle_TopLevel.
- parentWidget()->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0));
+ reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0));
// Enable fullscreen.
/* this is the trick - I don't now why, but after a showFullScreen QTE toggles the focus
* so we must block it here! */
m_ignore_next_in = true;
- parentWidget()->showFullScreen();
+ showFullScreen();
setUpdatesEnabled(true);
-}
-ImageWidget::ImageWidget(QWidget * parent, const char * name, WFlags f)
- : QWidget(parent,name,f)
-{
- // Make sure size is correct
- setFixedSize(qApp->desktop()->size());
}
+