diff options
Diffstat (limited to 'src/videowidget.cc')
-rw-r--r-- | src/videowidget.cc | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/videowidget.cc b/src/videowidget.cc index 4fadb1d..859763d 100644 --- a/src/videowidget.cc +++ b/src/videowidget.cc @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.4 2005/07/25 15:35:41 deva + * *** empty log message *** + * * Revision 1.3 2005/05/03 08:31:59 deva * Removed the error object, and replaced it with a more generic info object. * @@ -44,8 +47,10 @@ #include "videowidget.h" -VideoWidget::VideoWidget(QWidget *parent) : QWidget(parent, "") +VideoWidget::VideoWidget(QWidget *p) : QWidget(p, "") { + parent = p; + // A welltested hack to force SDL to draw in the QWidget QString ids; setenv("SDL_WINDOWID", ids.setNum(winId()), 1); @@ -60,4 +65,25 @@ QPixmap VideoWidget::getScreenshot() return QPixmap::grabWindow (winId()); } +void VideoWidget::mousePressEvent(QMouseEvent *event) +{ + if(isFullScreen()) { + + printf("Going normal\n"); + + reparent(parent, 0, QPoint(0,0), FALSE); + + showNormal(); + + } else { + + printf("Going fullscreen\n"); + + reparent(NULL, 0, QPoint(10,10), FALSE); + + showFullScreen(); + + } +} + #endif /* USE_GUI */ |