Skip to content

Commit 6c069c1

Browse files
3nidsm-kuhn
authored andcommittedOct 15, 2018
better layout in dock
1 parent ff9da2f commit 6c069c1

File tree

2 files changed

+113
-24
lines changed

2 files changed

+113
-24
lines changed
 

‎src/app/qgsgeometryvalidationdock.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ QgsGeometryValidationDock::QgsGeometryValidationDock( const QString &title, QgsM
4141
mProblemDescriptionLabel->setFont( font );
4242
mErrorListView->setAlternatingRowColors( true );
4343

44-
connect( mNextButton, &QPushButton::clicked, this, &QgsGeometryValidationDock::gotoNextError );
45-
connect( mPreviousButton, &QPushButton::clicked, this, &QgsGeometryValidationDock::gotoPreviousError );
46-
connect( mZoomToProblemButton, &QPushButton::clicked, this, &QgsGeometryValidationDock::zoomToProblem );
47-
connect( mZoomToFeatureButton, &QPushButton::clicked, this, &QgsGeometryValidationDock::zoomToFeature );
44+
connect( mNextButton, &QToolButton::clicked, this, &QgsGeometryValidationDock::gotoNextError );
45+
connect( mPreviousButton, &QToolButton::clicked, this, &QgsGeometryValidationDock::gotoPreviousError );
46+
connect( mZoomToProblemButton, &QToolButton::clicked, this, &QgsGeometryValidationDock::zoomToProblem );
47+
connect( mZoomToFeatureButton, &QToolButton::clicked, this, &QgsGeometryValidationDock::zoomToFeature );
4848
connect( mMapCanvas, &QgsMapCanvas::currentLayerChanged, this, &QgsGeometryValidationDock::onCurrentLayerChanged );
4949
connect( mMapCanvas, &QgsMapCanvas::currentLayerChanged, this, &QgsGeometryValidationDock::updateLayerTransform );
5050
connect( mMapCanvas, &QgsMapCanvas::destinationCrsChanged, this, &QgsGeometryValidationDock::updateLayerTransform );
@@ -178,7 +178,7 @@ void QgsGeometryValidationDock::onCurrentErrorChanged( const QModelIndex &curren
178178
QLabel *resolveLabel = new QLabel( resolutionMethod, mResolutionWidget );
179179
resolveLabel->setWordWrap( true );
180180
layout->addWidget( resolveLabel, resolutionIndex, 1 );
181-
connect( resolveBtn, &QPushButton::clicked, this, [resolutionIndex, error, this]()
181+
connect( resolveBtn, &QToolButton::clicked, this, [resolutionIndex, error, this]()
182182
{
183183
mGeometryValidationService->fixError( error, resolutionIndex );
184184
} );

‎src/ui/qgsgeometryvalidationdockbase.ui

Lines changed: 108 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>607</width>
10-
<height>973</height>
9+
<width>418</width>
10+
<height>404</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -18,18 +18,29 @@
1818
<item row="3" column="0" colspan="2">
1919
<widget class="QWidget" name="mProblemDetailWidget" native="true">
2020
<layout class="QGridLayout" name="gridLayout">
21-
<item row="1" column="2">
22-
<widget class="QPushButton" name="mZoomToProblemButton">
21+
<property name="leftMargin">
22+
<number>0</number>
23+
</property>
24+
<property name="topMargin">
25+
<number>0</number>
26+
</property>
27+
<property name="rightMargin">
28+
<number>0</number>
29+
</property>
30+
<property name="bottomMargin">
31+
<number>0</number>
32+
</property>
33+
<item row="1" column="6">
34+
<widget class="QToolButton" name="mNextButton">
2335
<property name="text">
24-
<string>Zoom To Problem</string>
36+
<string>Next</string>
2537
</property>
26-
<property name="icon">
27-
<iconset resource="../../images/images.qrc">
28-
<normaloff>:/images/themes/default/mActionZoomToLayer.svg</normaloff>:/images/themes/default/mActionZoomToLayer.svg</iconset>
38+
<property name="arrowType">
39+
<enum>Qt::RightArrow</enum>
2940
</property>
3041
</widget>
3142
</item>
32-
<item row="1" column="0">
43+
<item row="1" column="1">
3344
<widget class="QToolButton" name="mPreviousButton">
3445
<property name="text">
3546
<string>Previous</string>
@@ -39,29 +50,94 @@
3950
</property>
4051
</widget>
4152
</item>
42-
<item row="1" column="1">
43-
<widget class="QPushButton" name="mZoomToFeatureButton">
53+
<item row="1" column="2">
54+
<spacer name="horizontalSpacer_3">
55+
<property name="orientation">
56+
<enum>Qt::Horizontal</enum>
57+
</property>
58+
<property name="sizeHint" stdset="0">
59+
<size>
60+
<width>0</width>
61+
<height>20</height>
62+
</size>
63+
</property>
64+
</spacer>
65+
</item>
66+
<item row="1" column="0">
67+
<spacer name="horizontalSpacer">
68+
<property name="orientation">
69+
<enum>Qt::Horizontal</enum>
70+
</property>
71+
<property name="sizeHint" stdset="0">
72+
<size>
73+
<width>0</width>
74+
<height>20</height>
75+
</size>
76+
</property>
77+
</spacer>
78+
</item>
79+
<item row="1" column="3">
80+
<widget class="QToolButton" name="mZoomToFeatureButton">
4481
<property name="text">
4582
<string>Zoom To Feature</string>
4683
</property>
4784
<property name="icon">
4885
<iconset resource="../../images/images.qrc">
4986
<normaloff>:/images/themes/default/mActionZoomToSelected.svg</normaloff>:/images/themes/default/mActionZoomToSelected.svg</iconset>
5087
</property>
88+
<property name="toolButtonStyle">
89+
<enum>Qt::ToolButtonTextBesideIcon</enum>
90+
</property>
5191
</widget>
5292
</item>
53-
<item row="1" column="3">
54-
<widget class="QToolButton" name="mNextButton">
93+
<item row="1" column="4">
94+
<widget class="QToolButton" name="mZoomToProblemButton">
5595
<property name="text">
56-
<string>Next</string>
96+
<string>Zoom To Problem</string>
5797
</property>
58-
<property name="arrowType">
59-
<enum>Qt::RightArrow</enum>
98+
<property name="icon">
99+
<iconset resource="../../images/images.qrc">
100+
<normaloff>:/images/themes/default/mActionZoomToLayer.svg</normaloff>:/images/themes/default/mActionZoomToLayer.svg</iconset>
101+
</property>
102+
<property name="toolButtonStyle">
103+
<enum>Qt::ToolButtonTextBesideIcon</enum>
60104
</property>
61105
</widget>
62106
</item>
63-
<item row="0" column="1" colspan="2">
107+
<item row="1" column="7">
108+
<spacer name="horizontalSpacer_2">
109+
<property name="orientation">
110+
<enum>Qt::Horizontal</enum>
111+
</property>
112+
<property name="sizeHint" stdset="0">
113+
<size>
114+
<width>0</width>
115+
<height>20</height>
116+
</size>
117+
</property>
118+
</spacer>
119+
</item>
120+
<item row="1" column="5">
121+
<spacer name="horizontalSpacer_4">
122+
<property name="orientation">
123+
<enum>Qt::Horizontal</enum>
124+
</property>
125+
<property name="sizeHint" stdset="0">
126+
<size>
127+
<width>0</width>
128+
<height>20</height>
129+
</size>
130+
</property>
131+
</spacer>
132+
</item>
133+
<item row="0" column="2" colspan="4">
64134
<widget class="QLabel" name="mProblemDescriptionLabel">
135+
<property name="sizePolicy">
136+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
137+
<horstretch>0</horstretch>
138+
<verstretch>0</verstretch>
139+
</sizepolicy>
140+
</property>
65141
<property name="text">
66142
<string>Detailed Desctiption</string>
67143
</property>
@@ -70,8 +146,21 @@
70146
</property>
71147
</widget>
72148
</item>
73-
<item row="3" column="1" colspan="2">
74-
<widget class="QWidget" name="mResolutionWidget" native="true"/>
149+
<item row="3" column="2" colspan="4">
150+
<widget class="QWidget" name="mResolutionWidget" native="true">
151+
<property name="sizePolicy">
152+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
153+
<horstretch>0</horstretch>
154+
<verstretch>0</verstretch>
155+
</sizepolicy>
156+
</property>
157+
<property name="minimumSize">
158+
<size>
159+
<width>0</width>
160+
<height>0</height>
161+
</size>
162+
</property>
163+
</widget>
75164
</item>
76165
</layout>
77166
</widget>

0 commit comments

Comments
 (0)
Please sign in to comment.