Skip to content
Permalink
Browse files

Add size grip so Composer window can be resized by Mac OS X. Also del…

…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/qgis@6283 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski
telwertowski committed Dec 19, 2006
1 parent 5161592 commit 1d3b6dda761c46079b3497845537dce80f84a720
Showing with 19 additions and 4 deletions.
  1. +14 −3 src/composer/qgscomposer.cpp
  2. +4 −0 src/composer/qgscomposer.h
  3. +1 −0 src/gui/qgisapp.cpp
  4. +0 −1 src/ui/qgscomposerbase.ui
@@ -40,6 +40,7 @@
#include <QToolBar>
#include <QImageWriter>
#include <QCheckBox>
#include <QSizeGrip>
#include <iostream>


@@ -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" );
}
@@ -87,8 +93,6 @@ QgsComposer::QgsComposer( QgisApp *qgis): QMainWindow()
restoreWindowState();

selectItem(); // Set selection tool

statusBar()->setHidden(true);
}

QgsComposer::~QgsComposer()
@@ -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()
{
@@ -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
@@ -193,6 +194,9 @@ public slots:
//! Layout
QGridLayout *mItemOptionsLayout;

//! Size grip
QSizeGrip *mSizeGrip;

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

@@ -52,6 +52,7 @@
#include <QProgressBar>
#include <QSettings>
#include <QSplashScreen>
#include <QStatusBar>
#include <QStringList>
#include <QTcpSocket>
#include <QTextStream>
@@ -221,7 +221,6 @@
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar" />
<widget class="QToolBar" name="toolBar" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>

0 comments on commit 1d3b6dd

Please sign in to comment.
You can’t perform that action at this time.