Skip to content

Commit ec8f060

Browse files
author
telwertowski
committed
Add size grip so Composer window can be resized by Mac OS X. Also delete rather than hide the status bar since it isn't used at all.
The size grip was previously provided by the status bar which was recently hidden to make room for buttons. git-svn-id: http://svn.osgeo.org/qgis/trunk@6283 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7c5e9af commit ec8f060

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

src/composer/qgscomposer.cpp

+14-3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <QToolBar>
4141
#include <QImageWriter>
4242
#include <QCheckBox>
43+
#include <QSizeGrip>
4344
#include <iostream>
4445

4546

@@ -74,6 +75,11 @@ QgsComposer::QgsComposer( QgisApp *qgis): QMainWindow()
7475
mComposition = new QgsComposition( this, 1 );
7576
mComposition->setActive ( true );
7677

78+
// Create size grip (needed by Mac OS X for QMainWindow if QStatusBar is not visible)
79+
mSizeGrip = new QSizeGrip(this);
80+
mSizeGrip->resize(mSizeGrip->sizeHint());
81+
mSizeGrip->move(rect().bottomRight() - mSizeGrip->rect().bottomRight());
82+
7783
if ( ! connect( mQgis, SIGNAL( projectRead() ), this, SLOT( projectRead()) ) ) {
7884
qDebug( "unable to connect to projectRead" );
7985
}
@@ -87,8 +93,6 @@ QgsComposer::QgsComposer( QgisApp *qgis): QMainWindow()
8793
restoreWindowState();
8894

8995
selectItem(); // Set selection tool
90-
91-
statusBar()->setHidden(true);
9296
}
9397

9498
QgsComposer::~QgsComposer()
@@ -858,7 +862,14 @@ void QgsComposer::on_mActionAddImage_activated(void)
858862
}
859863

860864
void QgsComposer::moveEvent ( QMoveEvent *e ) { saveWindowState(); }
861-
void QgsComposer::resizeEvent ( QResizeEvent *e ) { saveWindowState(); }
865+
866+
void QgsComposer::resizeEvent ( QResizeEvent *e )
867+
{
868+
// Move size grip when window is resized
869+
mSizeGrip->move(rect().bottomRight() - mSizeGrip->rect().bottomRight());
870+
871+
saveWindowState();
872+
}
862873

863874
void QgsComposer::saveWindowState()
864875
{

src/composer/qgscomposer.h

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class QDomDocument;
3131
class QMoveEvent;
3232
class QResizeEvent;
3333
class QFile;
34+
class QSizeGrip;
3435

3536
/* The constructor creates empty composer, without compositions and mFirstTime set to true.
3637
* - if signal projectRead() is recieved all old compositions are deleted and
@@ -193,6 +194,9 @@ public slots:
193194
//! Layout
194195
QGridLayout *mItemOptionsLayout;
195196

197+
//! Size grip
198+
QSizeGrip *mSizeGrip;
199+
196200
//! Help context id
197201
static const int context_id = 985715179;
198202

src/gui/qgisapp.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#include <QProgressBar>
5353
#include <QSettings>
5454
#include <QSplashScreen>
55+
#include <QStatusBar>
5556
#include <QStringList>
5657
#include <QTcpSocket>
5758
#include <QTextStream>

src/ui/qgscomposerbase.ui

-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@
221221
</item>
222222
</layout>
223223
</widget>
224-
<widget class="QStatusBar" name="statusbar" />
225224
<widget class="QToolBar" name="toolBar" >
226225
<property name="orientation" >
227226
<enum>Qt::Horizontal</enum>

0 commit comments

Comments
 (0)