Skip to content
Permalink
Browse files

Resize snapping column widths. Reduce dialog margins

  • Loading branch information
NathanW2 committed Sep 10, 2014
1 parent e7f3c82 commit 17767ba9734bbef7323a85016ed3655db1d0abda
Showing with 65 additions and 39 deletions.
  1. +6 −5 src/app/qgssnappingdialog.cpp
  2. +59 −34 src/ui/qgssnappingdialogbase.ui
@@ -87,11 +87,6 @@ QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas )
}

mLayerTreeWidget->setHeaderLabels( QStringList() << "" );
mLayerTreeWidget->resizeColumnToContents( 0 );
mLayerTreeWidget->setColumnWidth( 1, 200 ); //hardcoded for now
mLayerTreeWidget->setColumnWidth( 2, 200 ); //hardcoded for now
mLayerTreeWidget->resizeColumnToContents( 3 );
mLayerTreeWidget->resizeColumnToContents( 4 );
mLayerTreeWidget->setSortingEnabled( true );

connect( QgsProject::instance(), SIGNAL( snapSettingsChanged() ), this, SLOT( reload() ) );
@@ -211,6 +206,12 @@ void QgsSnappingDialog::show()
mDock->setVisible( true );
else
QDialog::show();

mLayerTreeWidget->resizeColumnToContents( 0 );
mLayerTreeWidget->resizeColumnToContents( 1 );
mLayerTreeWidget->resizeColumnToContents( 2 );
mLayerTreeWidget->resizeColumnToContents( 3 );
mLayerTreeWidget->resizeColumnToContents( 4 );
}

void QgsSnappingDialog::addLayers( QList<QgsMapLayer *> layers )
@@ -14,6 +14,18 @@
<string>Snapping options</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item row="0" column="0" colspan="3">
<widget class="QTreeWidget" name="mLayerTreeWidget">
<property name="selectionMode">
@@ -55,52 +67,65 @@
</column>
<column>
<property name="text">
<string>Avoid Int.</string>
<string>Avoid intersections</string>
</property>
<property name="toolTip">
<string>Avoid intersections of new polygons</string>
</property>
<property name="textAlignment">
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
<set>AlignLeft|AlignVCenter</set>
</property>
</column>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cbxEnableTopologicalEditingCheckBox">
<property name="text">
<string>Enable topological editing</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="cbxEnableIntersectionSnappingCheckBox">
<property name="text">
<string>Enable snapping on intersection</string>
<item row="2" column="0" colspan="3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin">
<number>3</number>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<property name="topMargin">
<number>0</number>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<property name="rightMargin">
<number>3</number>
</property>
</widget>
<item>
<widget class="QCheckBox" name="cbxEnableTopologicalEditingCheckBox">
<property name="text">
<string>Enable topological editing</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxEnableIntersectionSnappingCheckBox">
<property name="text">
<string>Enable snapping on intersection</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="mButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>

0 comments on commit 17767ba

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