Skip to content

Commit

Permalink
Add size grip so Composer window can be resized by Mac OS X. Also del…
Browse files Browse the repository at this point in the history
…ete 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
  • Loading branch information
telwertowski committed Dec 19, 2006
1 parent 7c5e9af commit ec8f060
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/composer/qgscomposer.cpp
Expand Up @@ -40,6 +40,7 @@
#include <QToolBar>
#include <QImageWriter>
#include <QCheckBox>
#include <QSizeGrip>
#include <iostream>


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

// Create size grip (needed by Mac OS X for QMainWindow if QStatusBar is not visible)
mSizeGrip = new QSizeGrip(this);
mSizeGrip->resize(mSizeGrip->sizeHint());
mSizeGrip->move(rect().bottomRight() - mSizeGrip->rect().bottomRight());

if ( ! connect( mQgis, SIGNAL( projectRead() ), this, SLOT( projectRead()) ) ) {
qDebug( "unable to connect to projectRead" );
}
Expand All @@ -87,8 +93,6 @@ QgsComposer::QgsComposer( QgisApp *qgis): QMainWindow()
restoreWindowState();

selectItem(); // Set selection tool

statusBar()->setHidden(true);
}

QgsComposer::~QgsComposer()
Expand Down Expand Up @@ -858,7 +862,14 @@ void QgsComposer::on_mActionAddImage_activated(void)
}

void QgsComposer::moveEvent ( QMoveEvent *e ) { saveWindowState(); }
void QgsComposer::resizeEvent ( QResizeEvent *e ) { saveWindowState(); }

void QgsComposer::resizeEvent ( QResizeEvent *e )
{
// Move size grip when window is resized
mSizeGrip->move(rect().bottomRight() - mSizeGrip->rect().bottomRight());

saveWindowState();
}

void QgsComposer::saveWindowState()
{
Expand Down
4 changes: 4 additions & 0 deletions src/composer/qgscomposer.h
Expand Up @@ -31,6 +31,7 @@ class QDomDocument;
class QMoveEvent;
class QResizeEvent;
class QFile;
class QSizeGrip;

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

//! Size grip
QSizeGrip *mSizeGrip;

//! Help context id
static const int context_id = 985715179;

Expand Down
1 change: 1 addition & 0 deletions src/gui/qgisapp.cpp
Expand Up @@ -52,6 +52,7 @@
#include <QProgressBar>
#include <QSettings>
#include <QSplashScreen>
#include <QStatusBar>
#include <QStringList>
#include <QTcpSocket>
#include <QTextStream>
Expand Down
1 change: 0 additions & 1 deletion src/ui/qgscomposerbase.ui
Expand Up @@ -221,7 +221,6 @@
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar" />
<widget class="QToolBar" name="toolBar" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
Expand Down

0 comments on commit ec8f060

Please sign in to comment.