Mercurial > hg > forks > UniversalIndentGUI
annotate src/AboutDialogGraphicsView.cpp @ 747:850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@1024 59b1889a-e5ac-428c-b0c7-476e01d41282
author | thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282> |
---|---|
date | Sat, 02 Oct 2010 11:56:10 +0000 |
parents | b30f03c1a40d |
children | ac165b6ae67e |
rev | line source |
---|---|
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
1 /*************************************************************************** |
727
aae5a8d04f70
Updated comment copyright year.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
716
diff
changeset
|
2 * Copyright (C) 2006-2010 by Thomas Schweitzer * |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
3 * thomas-schweitzer(at)arcor.de * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
4 * * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
6 * it under the terms of the GNU General Public License version 2.0 as * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
7 * published by the Free Software Foundation. * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
8 * * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
9 * This program is distributed in the hope that it will be useful, * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
12 * GNU General Public License for more details. * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
13 * * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
14 * You should have received a copy of the GNU General Public License * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
15 * along with this program in the file LICENSE.GPL; if not, write to the * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
16 * Free Software Foundation, Inc., * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
18 ***************************************************************************/ |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
19 #include <QtGui> |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
20 #include "AboutDialogGraphicsView.h" |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
21 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
22 /*! |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
23 \class AboutDialogGraphicsView |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
24 \brief A container for the real \a AboutDialog. Makes the 3D animation possible. |
634
82cd1efd6015
Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
599
diff
changeset
|
25 |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
26 The 3D animation shall suggest the user, that he is looking at his desktop, while |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
27 this animation is done. Since this is not directly possible, \a AboutDialogGraphicsView |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
28 when shown starts in frameless fullscreen mode with a screenshot of the desktop as background. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
29 */ |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
30 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
31 /*! |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
32 \brief The constructor initializes everything needed for the 3D animation. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
33 */ |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
34 AboutDialogGraphicsView::AboutDialogGraphicsView(AboutDialog *aboutDialog, QWidget *parent) : QGraphicsView(parent) { |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
35 this->parent = parent; |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
36 setWindowFlags(Qt::SplashScreen); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
37 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
38 #ifdef Q_OS_LINUX |
745
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
39 QRect availableGeometry = QApplication::desktop()->availableGeometry(); |
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
40 QRect newGeometry = QRect( availableGeometry.x(), availableGeometry.y(), availableGeometry.width(), availableGeometry.height() ); |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
41 #else |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
42 QRect newGeometry = QRect( -1,-1, QApplication::desktop()->rect().width()+2, QApplication::desktop()->rect().height()+2 ); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
43 #endif |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
44 setGeometry( newGeometry ); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
45 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
46 this->aboutDialog = aboutDialog; |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
47 |
716
b9123ff53106
Run cppcheck over the code and removed some possible problems.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
648
diff
changeset
|
48 windowTitleBarWidth = 0; |
747
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
49 windowPosOffset = 0; |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
50 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
51 scene = new QGraphicsScene(this); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
52 setSceneRect( newGeometry ); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
53 aboutDialogAsSplashScreen = new QSplashScreen(this); |
737
9b37def27afe
Updated the AboutDialogGraphicsView to show correctly on Mac and set the window focus back to the main window after closing the dialog.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
727
diff
changeset
|
54 //aboutDialogAsSplashScreen->setPixmap( QPixmap::grabWidget(aboutDialog) ); |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
55 graphicsProxyWidget = scene->addWidget(aboutDialogAsSplashScreen); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
56 graphicsProxyWidget->setWindowFlags( Qt::ToolTip ); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
57 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
58 setScene( scene ); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
59 setRenderHint(QPainter::Antialiasing); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
60 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
61 setCacheMode(QGraphicsView::CacheBackground); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
62 setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
63 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
64 connect(aboutDialog, SIGNAL(finished(int)), this, SLOT(hide())); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
65 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
66 //setWindowOpacity(0.9); |
634
82cd1efd6015
Talking about clean and well formatted code all the time and never run mine through a beautifier while still having a mix of tabs an spaces. So now Uncrustify has cleaned my code. Still two unsatisfying points are left. indenthandler.cpp line 467 a space between case label and colon has been removed and like on line 503 some code lines got indented without setting that explicitly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
599
diff
changeset
|
67 |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
68 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
69 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
70 setStyleSheet("AboutDialogGraphicsView { border: 0px; }"); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
71 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
72 timeLine = new QTimeLine(1000, this); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
73 timeLine->setFrameRange(270, 0); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
74 //timeLine->setUpdateInterval(10); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
75 //timeLine->setCurveShape(QTimeLine::EaseInCurve); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
76 connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(updateStep(int))); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
77 } |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
78 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
79 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
80 AboutDialogGraphicsView::~AboutDialogGraphicsView(void) { |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
81 } |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
82 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
83 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
84 /*! |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
85 \brief Grabs a screenshot of the full desktop and shows that as background. Above that background the |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
86 AboutDialog 3D animation is shown. Also grabs the content of the AboutDialog itself. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
87 */ |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
88 void AboutDialogGraphicsView::show() { |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
89 // Because on X11 system the window decoration is only available after a widget has been shown once, |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
90 // we can detect windowTitleBarWidth here for the first time. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
91 windowTitleBarWidth = parent->geometry().y() - parent->y(); |
747
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
92 // If the windowTitleBarWidth could not be determined, try it a second way. Even the chances are low to get good results. |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
93 if ( windowTitleBarWidth == 0 ) |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
94 windowTitleBarWidth = parent->frameGeometry().height() - parent->geometry().height(); |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
95 #ifdef Q_OS_LINUX |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
96 if ( windowTitleBarWidth == 0 ) { |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
97 //TODO: 27 pixel is a fix value for the Ubuntu 10.4 default window theme and so just a workaround for that specific case. |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
98 windowPosOffset = 27; |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
99 windowTitleBarWidth = 27; |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
100 } |
850c647d857d
AboutDialogGraphicsView: Improved the about dialog positioning on Linux.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
745
diff
changeset
|
101 #endif |
745
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
102 QPixmap originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId(), QApplication::desktop()->availableGeometry().x(), QApplication::desktop()->availableGeometry().y(), geometry().width(), geometry().height() ); |
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
103 QBrush brush(originalPixmap); |
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
104 QTransform transform; |
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
105 transform.translate(0, QApplication::desktop()->availableGeometry().y()); |
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
106 brush.setTransform(transform); |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
107 |
745
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
108 setBackgroundBrush(brush); |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
109 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
110 aboutDialogAsSplashScreen->setPixmap( QPixmap::grabWidget(aboutDialog) ); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
111 graphicsProxyWidget->setGeometry( aboutDialog->geometry() ); |
737
9b37def27afe
Updated the AboutDialogGraphicsView to show correctly on Mac and set the window focus back to the main window after closing the dialog.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
727
diff
changeset
|
112 aboutDialog->hide(); |
745
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
113 graphicsProxyWidget->setPos( parent->geometry().x()+(parent->geometry().width()-graphicsProxyWidget->geometry().width()) / 2, parent->y()+windowTitleBarWidth-windowPosOffset); |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
114 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
115 QRectF r = graphicsProxyWidget->boundingRect(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
116 graphicsProxyWidget->setTransform(QTransform() |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
117 .translate(r.width() / 2, -windowTitleBarWidth) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
118 .rotate(270, Qt::XAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
119 //.rotate(90, Qt::YAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
120 //.rotate(5, Qt::ZAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
121 //.scale(1 + 1.5 * step, 1 + 1.5 * step) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
122 .translate(-r.width() / 2, windowTitleBarWidth)); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
123 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
124 graphicsProxyWidget->show(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
125 //aboutDialogAsSplashScreen->show(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
126 QGraphicsView::show(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
127 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
128 connect(timeLine, SIGNAL(finished()), this, SLOT(showAboutDialog())); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
129 timeLine->setDirection(QTimeLine::Forward); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
130 timeLine->start(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
131 } |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
132 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
133 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
134 /*! |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
135 \brief Does the next calculation/transformation step. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
136 */ |
635
e1fdfb9adf92
According to the previous code formatting also made the function opening brace be consistently placed.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
634
diff
changeset
|
137 void AboutDialogGraphicsView::updateStep(int step) { |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
138 QRectF r = graphicsProxyWidget->boundingRect(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
139 graphicsProxyWidget->setTransform(QTransform() |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
140 .translate(r.width() / 2, -windowTitleBarWidth) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
141 .rotate(step, Qt::XAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
142 //.rotate(step, Qt::YAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
143 //.rotate(step * 5, Qt::ZAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
144 //.scale(1 + 1.5 * step, 1 + 1.5 * step) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
145 .translate(-r.width() / 2, windowTitleBarWidth)); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
146 //update(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
147 } |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
148 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
149 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
150 /*! |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
151 \brief Stops the 3D animation, moves the AboutDialog to the correct place and really shows it. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
152 */ |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
153 void AboutDialogGraphicsView::showAboutDialog() { |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
154 //hide(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
155 disconnect(timeLine, SIGNAL(finished()), this, SLOT(showAboutDialog())); |
745
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
156 aboutDialog->move( int(parent->geometry().x()+(parent->geometry().width()-graphicsProxyWidget->geometry().width()) / 2), parent->y()+windowTitleBarWidth-windowPosOffset ); |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
157 aboutDialog->exec(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
158 } |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
159 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
160 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
161 /*! |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
162 \brief Does not directly hide the AboutDialog but instead starts the "fade out" 3D animation. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
163 */ |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
164 void AboutDialogGraphicsView::hide() { |
737
9b37def27afe
Updated the AboutDialogGraphicsView to show correctly on Mac and set the window focus back to the main window after closing the dialog.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
727
diff
changeset
|
165 //aboutDialogAsSplashScreen->setPixmap( QPixmap::grabWidget(aboutDialog) ); |
9b37def27afe
Updated the AboutDialogGraphicsView to show correctly on Mac and set the window focus back to the main window after closing the dialog.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
727
diff
changeset
|
166 //graphicsProxyWidget->setGeometry( aboutDialog->geometry() ); |
745
b30f03c1a40d
Changed the positioning of the about dialog background to work on Linux properly.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
737
diff
changeset
|
167 graphicsProxyWidget->setPos( parent->geometry().x()+(parent->geometry().width()-graphicsProxyWidget->geometry().width()) / 2, parent->y()+windowTitleBarWidth-windowPosOffset); |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
168 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
169 QRectF r = graphicsProxyWidget->boundingRect(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
170 graphicsProxyWidget->setTransform(QTransform() |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
171 .translate(r.width() / 2, -windowTitleBarWidth) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
172 .rotate(0, Qt::XAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
173 //.rotate(90, Qt::YAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
174 //.rotate(5, Qt::ZAxis) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
175 //.scale(1 + 1.5 * step, 1 + 1.5 * step) |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
176 .translate(-r.width() / 2, windowTitleBarWidth)); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
177 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
178 graphicsProxyWidget->show(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
179 //aboutDialogAsSplashScreen->show(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
180 QGraphicsView::show(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
181 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
182 connect(timeLine, SIGNAL(finished()), this, SLOT(hideReally())); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
183 timeLine->setDirection(QTimeLine::Backward); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
184 timeLine->start(); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
185 } |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
186 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
187 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
188 /*! |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
189 \brief This slot really hides this AboutDialog container. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
190 */ |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
191 void AboutDialogGraphicsView::hideReally() { |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
192 disconnect(timeLine, SIGNAL(finished()), this, SLOT(hideReally())); |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
193 QGraphicsView::hide(); |
737
9b37def27afe
Updated the AboutDialogGraphicsView to show correctly on Mac and set the window focus back to the main window after closing the dialog.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
727
diff
changeset
|
194 parent->activateWindow(); |
556
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
195 } |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
196 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
197 |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
198 /*! |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
199 \brief Makes it possible to set the screen shot used for the animation. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
200 */ |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
201 //TODO: Test whether this function is really still needed. Not only for debug. |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
202 void AboutDialogGraphicsView::setScreenshotPixmap(const QPixmap &screenShot) { |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
203 originalPixmap = screenShot; |
6255a3c1c66c
On Linux and Mac the fullscreen AboutDialogGraphicsView had a frame. Removed that.
thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
parents:
542
diff
changeset
|
204 } |