Skip to content

Commit 0ba1286

Browse files
committed
Tighten margins and spacing on various docks
Fixes a rendering artefact on OSX toolbars and leaves more space for content. Let me know if this looks bad on Windows and I'll ifdef it out
1 parent 85128c5 commit 0ba1286

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

src/app/qgisapp.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,6 +3040,8 @@ void QgisApp::initLayerTreeView()
30403040

30413041
QVBoxLayout* vboxLayout = new QVBoxLayout;
30423042
vboxLayout->setMargin( 0 );
3043+
vboxLayout->setContentsMargins( 0, 0, 0, 0 );
3044+
vboxLayout->setSpacing( 0 );
30433045
vboxLayout->addWidget( toolbar );
30443046
vboxLayout->addWidget( mLayerTreeView );
30453047

src/app/qgsattributetabledialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
9898

9999
setAttribute( Qt::WA_DeleteOnClose );
100100

101+
layout()->setMargin( 0 );
102+
layout()->setContentsMargins( 0, 0, 0, 0 );
103+
static_cast< QGridLayout* >( layout() )->setVerticalSpacing( 0 );
104+
101105
QSettings settings;
102106

103107
int size = settings.value( "/IconSize", 16 ).toInt();

src/app/qgsbookmarks.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ QgsBookmarks::QgsBookmarks( QWidget *parent )
4141
setupUi( this );
4242
restorePosition();
4343

44+
bookmarksDockContents->layout()->setMargin( 0 );
45+
bookmarksDockContents->layout()->setContentsMargins( 0, 0, 0, 0 );
46+
static_cast< QGridLayout* >( bookmarksDockContents->layout() )->setVerticalSpacing( 0 );
47+
4448
QToolButton* btnImpExp = new QToolButton;
4549
btnImpExp->setAutoRaise( true );
4650
btnImpExp->setToolTip( tr( "Import/Export Bookmarks" ) );

src/app/qgsbrowserdockwidget.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ QgsBrowserDockWidget::QgsBrowserDockWidget( const QString& name, QWidget * paren
270270
{
271271
setupUi( this );
272272

273+
mContents->layout()->setContentsMargins( 0, 0, 0, 0 );
274+
mContents->layout()->setMargin( 0 );
275+
static_cast< QVBoxLayout* >( mContents->layout() )->setSpacing( 0 );
276+
273277
setWindowTitle( name );
274278

275279
mBrowserView = new QgsDockBrowserTreeView( this );

0 commit comments

Comments
 (0)