Skip to content

Commit e26b6b5

Browse files
committedMar 25, 2014
[FEATURE] Identify highlight options.
- optional highlight color, line/outline buffer and minimum width - fixed symbol sizes (thanks to Martin Dobias)
1 parent 3b7b2b4 commit e26b6b5

File tree

5 files changed

+336
-117
lines changed

5 files changed

+336
-117
lines changed
 

‎src/app/qgsidentifyresultsdialog.cpp

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,24 +1253,30 @@ void QgsIdentifyResultsDialog::highlightFeature( QTreeWidgetItem *item )
12531253
if ( !featItem->feature().geometry() || featItem->feature().geometry()->wkbType() == QGis::WKBUnknown )
12541254
return;
12551255

1256+
QgsHighlight *highlight = 0;
12561257
if ( vlayer )
12571258
{
1258-
QgsHighlight *h = new QgsHighlight( mCanvas, featItem->feature(), vlayer );
1259-
h->setColor( Qt::red );
1260-
h->show();
1261-
mHighlights.insert( featItem, h );
1259+
highlight = new QgsHighlight( mCanvas, featItem->feature(), vlayer );
12621260
}
12631261
else
12641262
{
1265-
QgsHighlight *h = new QgsHighlight( mCanvas, featItem->feature().geometry(), layer );
1266-
if ( h )
1267-
{
1268-
h->setWidth( 2 );
1269-
h->setColor( Qt::red );
1270-
h->show();
1271-
mHighlights.insert( featItem, h );
1272-
}
1263+
highlight = new QgsHighlight( mCanvas, featItem->feature().geometry(), layer );
1264+
highlight->setWidth( 2 );
12731265
}
1266+
1267+
QSettings settings;
1268+
QColor color = QColor( settings.value( "/Map/identify/highlight/color", "#ff0000" ).toString() );
1269+
int alpha = settings.value( "/Map/identify/highlight/colorAlpha", "128" ).toInt();
1270+
double buffer = settings.value( "/Map/highlight/buffer", "0.5" ).toDouble();
1271+
double minWidth = settings.value( "/Map/highlight/minWidth", "1." ).toDouble();
1272+
1273+
highlight->setColor( color ); // sets also fill with default alpha
1274+
color.setAlpha( alpha );
1275+
highlight->setFillColor( color ); // sets fill with alpha
1276+
highlight->setBuffer( buffer );
1277+
highlight->setMinWidth( minWidth );
1278+
highlight->show();
1279+
mHighlights.insert( featItem, highlight );
12741280
}
12751281

12761282
void QgsIdentifyResultsDialog::zoomToFeature()

‎src/app/qgsoptions.cpp

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgis.h"
2222
#include "qgisapp.h"
2323
#include "qgisappstylesheet.h"
24+
#include "qgshighlight.h"
2425
#include "qgslegend.h"
2526
#include "qgsmapcanvas.h"
2627
#include "qgsmaprenderer.h"
@@ -104,7 +105,9 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
104105
cmbIdentifyMode->addItem( tr( "Top down" ), 2 );
105106
cmbIdentifyMode->addItem( tr( "Layer selection" ), 3 );
106107

107-
// read the current browser and set it
108+
mIdentifyHighlightColorButton->setColorDialogTitle( tr( "Identify highlight color" ) );
109+
mIdentifyHighlightColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel );
110+
108111
QSettings settings;
109112

110113
int identifyMode = settings.value( "/Map/identifyMode", 0 ).toInt();
@@ -116,6 +119,14 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
116119
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
117120
spinBoxIdentifyValue->setMinimum( 0.01 );
118121
spinBoxIdentifyValue->setValue( identifyValue );
122+
QColor highlightColor = QColor( settings.value( "/Map/identify/highlight/color", "#ff0000" ).toString() );
123+
int highlightAlpha = settings.value( "/Map/identify/highlight/colorAlpha", "63" ).toInt();
124+
highlightColor.setAlpha( highlightAlpha );
125+
mIdentifyHighlightColorButton->setColor( highlightColor );
126+
double highlightBuffer = settings.value( "/Map/highlight/buffer", "0.5" ).toDouble();
127+
mIdentifyHighlightBufferSpinBox->setValue( highlightBuffer );
128+
double highlightMinWidth = settings.value( "/Map/highlight/minWidth", "1." ).toDouble();
129+
mIdentifyHighlightMinWidthSpinBox->setValue( highlightMinWidth );
119130

120131
// custom environment variables
121132
bool useCustomVars = settings.value( "qgis/customEnvVarsUse", QVariant( false ) ).toBool();
@@ -1035,6 +1046,11 @@ void QgsOptions::saveOptions()
10351046
settings.setValue( "/Map/identifyMode", cmbIdentifyMode->itemData( cmbIdentifyMode->currentIndex() ).toInt() );
10361047
settings.setValue( "/Map/identifyAutoFeatureForm", cbxAutoFeatureForm->isChecked() );
10371048
settings.setValue( "/Map/identifyRadius", spinBoxIdentifyValue->value() );
1049+
settings.setValue( "/Map/identify/highlight/color", mIdentifyHighlightColorButton->color().name() );
1050+
settings.setValue( "/Map/identify/highlight/colorAlpha", mIdentifyHighlightColorButton->color().alpha() );
1051+
settings.setValue( "/Map/highlight/buffer", mIdentifyHighlightBufferSpinBox->value() );
1052+
settings.setValue( "/Map/highlight/minWidth", mIdentifyHighlightMinWidthSpinBox->value() );
1053+
10381054
bool showLegendClassifiers = settings.value( "/qgis/showLegendClassifiers", false ).toBool();
10391055
settings.setValue( "/qgis/showLegendClassifiers", cbxLegendClassifiers->isChecked() );
10401056
bool legendLayersBold = settings.value( "/qgis/legendLayersBold", true ).toBool();
@@ -1533,11 +1549,11 @@ QStringList QgsOptions::i18nList()
15331549

15341550
void QgsOptions::on_mRestoreDefaultWindowStateBtn_clicked()
15351551
{
1536-
// richard
1537-
QSettings mySettings;
1538-
if ( QMessageBox::warning( this, tr( "Restore UI defaults" ), tr( "Are you sure to reset the UI to default (needs restart)?" ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
1539-
return;
1540-
mySettings.setValue( "/qgis/restoreDefaultWindowState", true );
1552+
// richard
1553+
QSettings mySettings;
1554+
if ( QMessageBox::warning( this, tr( "Restore UI defaults" ), tr( "Are you sure to reset the UI to default (needs restart)?" ), QMessageBox::Ok | QMessageBox::Cancel ) == QMessageBox::Cancel )
1555+
return;
1556+
mySettings.setValue( "/qgis/restoreDefaultWindowState", true );
15411557
}
15421558

15431559
void QgsOptions::on_mCustomVariablesChkBx_toggled( bool chkd )

‎src/gui/qgshighlight.cpp

Lines changed: 86 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,35 @@
2121
#include "qgslinesymbollayerv2.h"
2222

2323
#include "qgscoordinatetransform.h"
24+
#include "qgsfillsymbollayerv2.h"
2425
#include "qgsgeometry.h"
2526
#include "qgshighlight.h"
27+
#include "qgslinesymbollayerv2.h"
28+
#include "qgslinesymbollayerv2.h"
2629
#include "qgsmapcanvas.h"
2730
#include "qgsmaplayer.h"
2831
#include "qgsmaprenderer.h"
32+
#include "qgsmarkersymbollayerv2.h"
2933
#include "qgsrendercontext.h"
3034
#include "qgssymbollayerv2.h"
3135
#include "qgssymbolv2.h"
3236
#include "qgsvectorlayer.h"
3337

38+
/* Few notes about highligting (RB):
39+
- The highlight fill must always be partially transparent because above highlighted layer
40+
may be another layer which must remain partially visible.
41+
- Because single highlight color does not work well with layers using similar layer color
42+
there were considered various possibilities but no optimal solution was found.
43+
What does not work:
44+
- lighter/darker color: it would work more or less for fully opaque highlight, but
45+
overlaying transparent lighter color over original has small visual efect.
46+
- complemetary color: mixing transparent (128) complement color with original color
47+
results in grey for all colors
48+
- contrast line style/ fill pattern: impression is not highligh but just different style
49+
- line buffer with contrast (or 2 contrast) color: the same as with patterns, no highlight impression
50+
- fill with highlight or contrast color but opaque and using pattern
51+
(e.g. Qt::Dense7Pattern): again no highlight impression
52+
*/
3453
/*!
3554
\class QgsHighlight
3655
\brief The QgsHighlight class provides a transparent overlay widget
@@ -39,7 +58,8 @@
3958
QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsMapLayer *layer )
4059
: QgsMapCanvasItem( mapCanvas )
4160
, mLayer( layer )
42-
, mRenderer( 0 )
61+
, mBuffer( 0 )
62+
, mMinWidth( 0 )
4363
{
4464
mGeometry = geom ? new QgsGeometry( *geom ) : 0;
4565
init();
@@ -48,7 +68,8 @@ QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsMapLa
4868
QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer )
4969
: QgsMapCanvasItem( mapCanvas )
5070
, mLayer( static_cast<QgsMapLayer *>( layer ) )
51-
, mRenderer( 0 )
71+
, mBuffer( 0 )
72+
, mMinWidth( 0 )
5273
{
5374
mGeometry = geom ? new QgsGeometry( *geom ) : 0;
5475
init();
@@ -59,7 +80,8 @@ QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, const QgsFeature& feature,
5980
, mGeometry( 0 )
6081
, mLayer( static_cast<QgsMapLayer *>( layer ) )
6182
, mFeature( feature )
62-
, mRenderer( 0 )
83+
, mBuffer( 0 )
84+
, mMinWidth( 0 )
6385
{
6486
init();
6587
}
@@ -90,7 +112,6 @@ void QgsHighlight::init()
90112
QgsHighlight::~QgsHighlight()
91113
{
92114
delete mGeometry;
93-
delete mRenderer;
94115
}
95116

96117
/*!
@@ -102,25 +123,34 @@ void QgsHighlight::setColor( const QColor & color )
102123
QColor fillColor( color.red(), color.green(), color.blue(), 63 );
103124
mBrush.setColor( fillColor );
104125
mBrush.setStyle( Qt::SolidPattern );
126+
}
105127

106-
delete mRenderer;
107-
mRenderer = 0;
128+
void QgsHighlight::setFillColor( const QColor & fillColor )
129+
{
130+
mBrush.setColor( fillColor );
131+
mBrush.setStyle( Qt::SolidPattern );
132+
}
133+
134+
QgsFeatureRendererV2 * QgsHighlight::getRenderer( const QgsRenderContext & context )
135+
{
136+
QgsFeatureRendererV2 *renderer = 0;
108137
QgsVectorLayer *layer = vectorLayer();
109138
if ( layer && layer->rendererV2() )
110139
{
111-
mRenderer = layer->rendererV2()->clone();
140+
renderer = layer->rendererV2()->clone();
112141
}
113-
if ( mRenderer )
142+
if ( renderer )
114143
{
115-
foreach ( QgsSymbolV2* symbol, mRenderer->symbols() )
144+
foreach ( QgsSymbolV2* symbol, renderer->symbols() )
116145
{
117146
if ( !symbol ) continue;
118-
setSymbolColor( symbol, color );
147+
setSymbol( symbol, context, mPen.color() );
119148
}
120149
}
150+
return renderer;
121151
}
122152

123-
void QgsHighlight::setSymbolColor( QgsSymbolV2* symbol, const QColor & color )
153+
void QgsHighlight::setSymbol( QgsSymbolV2* symbol, const QgsRenderContext & context, const QColor & color )
124154
{
125155
if ( !symbol ) return;
126156

@@ -146,20 +176,49 @@ void QgsHighlight::setSymbolColor( QgsSymbolV2* symbol, const QColor & color )
146176

147177
if ( symbolLayer->subSymbol() )
148178
{
149-
setSymbolColor( symbolLayer->subSymbol(), color );
179+
setSymbol( symbolLayer->subSymbol(), context, color );
150180
}
151181
else
152182
{
153183
symbolLayer->setColor( color ); // line symbology layers
154184
symbolLayer->setOutlineColor( color ); // marker and fill symbology layers
155185
symbolLayer->setFillColor( mTemporaryFillColor ); // marker and fill symbology layers
156186

187+
// Data defined widths overwrite what we set here (widths do not work with data defined)
188+
QgsSimpleMarkerSymbolLayerV2 * simpleMarker = dynamic_cast<QgsSimpleMarkerSymbolLayerV2*>( symbolLayer );
189+
if ( simpleMarker )
190+
{
191+
simpleMarker->setOutlineWidth( getSymbolWidth( context, simpleMarker->outlineWidth(), simpleMarker->outlineWidthUnit() ) );
192+
}
193+
QgsSimpleLineSymbolLayerV2 * simpleLine = dynamic_cast<QgsSimpleLineSymbolLayerV2*>( symbolLayer );
194+
if ( simpleLine )
195+
{
196+
simpleLine->setWidth( getSymbolWidth( context, simpleLine->width(), simpleLine->widthUnit() ) );
197+
}
198+
QgsSimpleFillSymbolLayerV2 * simpleFill = dynamic_cast<QgsSimpleFillSymbolLayerV2*>( symbolLayer );
199+
if ( simpleFill )
200+
{
201+
simpleFill->setBorderWidth( getSymbolWidth( context, simpleFill->borderWidth(), simpleFill->outputUnit() ) );
202+
}
157203
symbolLayer->removeDataDefinedProperty( "color" );
158204
symbolLayer->removeDataDefinedProperty( "color_border" );
159205
}
160206
}
161207
}
162208

209+
double QgsHighlight::getSymbolWidth( const QgsRenderContext & context, double width, QgsSymbolV2::OutputUnit unit )
210+
{
211+
// if necessary scale mm to map units
212+
double scale = 1.;
213+
if ( unit == QgsSymbolV2::MapUnit )
214+
{
215+
scale = QgsSymbolLayerV2Utils::lineWidthScaleFactor( context, QgsSymbolV2::MM ) / QgsSymbolLayerV2Utils::lineWidthScaleFactor( context, QgsSymbolV2::MapUnit );
216+
}
217+
return qMax( width + 2*mBuffer*scale, mMinWidth*scale );
218+
219+
220+
}
221+
163222
/*!
164223
Set the outline width.
165224
*/
@@ -299,50 +358,41 @@ void QgsHighlight::paint( QPainter* p )
299358
return;
300359
}
301360
}
302-
else if ( mFeature.geometry() && mRenderer )
361+
else if ( mFeature.geometry() )
303362
{
304363
QgsVectorLayer *layer = vectorLayer();
305-
if ( layer )
306-
{
307-
QgsRenderContext context = *( mMapCanvas->mapRenderer()->rendererContext() );
364+
QgsMapSettings mapSettings = mMapCanvas->mapSettings();
365+
QgsRenderContext context = QgsRenderContext::fromMapSettings( mapSettings );
308366

309-
// The context is local rectangle of QgsHighlight we previously set.
310-
// Because QgsMapCanvasItem::setRect() adds 1 pixel on border we cannot simply
311-
// use boundingRect().height() for QgsMapToPixel height.
367+
QgsFeatureRendererV2 *renderer = getRenderer( context );
368+
if ( layer && renderer )
369+
{
312370
QgsRectangle extent = mMapCanvas->extent();
313371
if ( extent != rect() ) // catches also canvas resize as it is causing extent change
314372
{
315373
updateRect();
316374
return; // it will be repainted after updateRect()
317375
}
318376

319-
320-
QPointF ll = toCanvasCoordinates( QgsPoint( extent.xMinimum(), extent.yMinimum() ) );
321-
QPointF ur = toCanvasCoordinates( QgsPoint( extent.xMaximum(), extent.yMaximum() ) );
322-
double height = ll.y() - ur.y();
323-
double width = ur.x() - ll.x();
324-
325377
// Because lower level outlines must be covered by upper level fill color
326378
// we render first with temporary opaque color, which is then replaced
327379
// by final transparent fill color.
328-
QImage image = QImage(( int )width, ( int )height, QImage::Format_ARGB32 );
380+
//QImage image = QImage(( int )width, ( int )height, QImage::Format_ARGB32 );
381+
QSize imageSize( mMapCanvas->mapSettings().outputSize() );
382+
QImage image = QImage( imageSize.width(), imageSize.height(), QImage::Format_ARGB32 );
329383
image.fill( 0 );
330384
QPainter *imagePainter = new QPainter( &image );
331385
imagePainter->setRenderHint( QPainter::Antialiasing, true );
332386

333-
QgsMapToPixel mapToPixel = QgsMapToPixel( mMapCanvas->mapUnitsPerPixel(),
334-
height, extent.yMinimum(), extent.xMinimum() );
335-
context.setMapToPixel( mapToPixel );
336-
context.setExtent( extent );
337-
context.setCoordinateTransform( 0 ); // we reprojected geometry in init()
338387
context.setPainter( imagePainter );
339388

340-
mRenderer->startRender( context, layer );
341-
mRenderer->renderFeature( mFeature, context );
342-
mRenderer->stopRender( context );
389+
renderer->startRender( context, layer->pendingFields() );
390+
renderer->renderFeature( mFeature, context );
391+
renderer->stopRender( context );
343392

344393
imagePainter->end();
345394

395+
// overwrite temporary fill color
346396
QRgb temporaryRgb = mTemporaryFillColor.rgba();
347397
QColor color = QColor( mBrush.color() );
348398
color.setAlpha( 63 );
@@ -363,6 +413,7 @@ void QgsHighlight::paint( QPainter* p )
363413
p->drawImage( 0, 0, image );
364414

365415
delete imagePainter;
416+
delete renderer;
366417
}
367418
}
368419
}
@@ -404,3 +455,4 @@ QgsVectorLayer * QgsHighlight::vectorLayer()
404455
{
405456
return dynamic_cast<QgsVectorLayer *>( mLayer );
406457
}
458+

‎src/gui/qgshighlight.h

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "qgsfeaturestore.h"
2020
#include "qgsgeometry.h"
2121
#include "qgsrendererv2.h"
22+
#include "qgssymbolv2.h"
2223
#include <QBrush>
2324
#include <QColor>
2425
#include <QList>
@@ -46,11 +47,25 @@ class GUI_EXPORT QgsHighlight: public QgsMapCanvasItem
4647
QgsHighlight( QgsMapCanvas *mapCanvas, const QgsFeature& feature, QgsVectorLayer *layer );
4748
~QgsHighlight();
4849

50+
/** Set line/outline to color, polygon fill to color with alpha = 63.
51+
* This is legacy function, use setFillColor() after setColor() if different fill color is required. */
4952
void setColor( const QColor & color );
5053

54+
/** Set polygons fill color.
55+
* @note: added in version 2.3 */
56+
void setFillColor( const QColor & fillColor );
57+
5158
/** Set width. Ignored in feature mode. */
5259
void setWidth( int width );
5360

61+
/** Set line / outline buffer in milimeters.
62+
* @note: added in version 2.3 */
63+
void setBuffer( double buffer ) { mBuffer = buffer; }
64+
65+
/** Set minimum line / outline width in milimeters.
66+
* @note: added in version 2.3 */
67+
void setMinWidth( double width ) { mMinWidth = width; }
68+
5469
protected:
5570
virtual void paint( QPainter* p );
5671

@@ -59,7 +74,10 @@ class GUI_EXPORT QgsHighlight: public QgsMapCanvasItem
5974

6075
private:
6176
void init();
62-
void setSymbolColor( QgsSymbolV2* symbol, const QColor & color );
77+
void setSymbol( QgsSymbolV2* symbol, const QgsRenderContext & context, const QColor & color );
78+
double getSymbolWidth( const QgsRenderContext & context, double width, QgsSymbolV2::OutputUnit unit );
79+
/** Get renderer for current color mode and colors. The renderer should be freed by caller. */
80+
QgsFeatureRendererV2 * getRenderer( const QgsRenderContext & context );
6381
void paintPoint( QPainter *p, QgsPoint point );
6482
void paintLine( QPainter *p, QgsPolyline line );
6583
void paintPolygon( QPainter *p, QgsPolygon polygon );
@@ -73,8 +91,9 @@ class GUI_EXPORT QgsHighlight: public QgsMapCanvasItem
7391
QgsGeometry *mGeometry;
7492
QgsMapLayer *mLayer;
7593
QgsFeature mFeature;
76-
QgsFeatureRendererV2 *mRenderer;
7794
QColor mTemporaryFillColor;
95+
double mBuffer; // line / outline buffer in pixels
96+
double mMinWidth; // line / outline minimum width in pixels
7897
};
7998

8099
#endif

‎src/ui/qgsoptionsbase.ui

Lines changed: 189 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>801</width>
9+
<width>820</width>
1010
<height>636</height>
1111
</rect>
1212
</property>
@@ -248,7 +248,7 @@
248248
<item>
249249
<widget class="QStackedWidget" name="mOptionsStackedWidget">
250250
<property name="currentIndex">
251-
<number>3</number>
251+
<number>0</number>
252252
</property>
253253
<widget class="QWidget" name="mOptionsPageGeneral">
254254
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -268,8 +268,8 @@
268268
<rect>
269269
<x>0</x>
270270
<y>0</y>
271-
<width>524</width>
272-
<height>706</height>
271+
<width>646</width>
272+
<height>586</height>
273273
</rect>
274274
</property>
275275
<layout class="QVBoxLayout" name="verticalLayout_28">
@@ -931,8 +931,8 @@
931931
<rect>
932932
<x>0</x>
933933
<y>0</y>
934-
<width>645</width>
935-
<height>803</height>
934+
<width>610</width>
935+
<height>867</height>
936936
</rect>
937937
</property>
938938
<layout class="QVBoxLayout" name="verticalLayout_22">
@@ -1293,8 +1293,8 @@
12931293
<rect>
12941294
<x>0</x>
12951295
<y>0</y>
1296-
<width>529</width>
1297-
<height>480</height>
1296+
<width>502</width>
1297+
<height>381</height>
12981298
</rect>
12991299
</property>
13001300
<layout class="QVBoxLayout" name="verticalLayout_27">
@@ -1603,8 +1603,8 @@
16031603
<rect>
16041604
<x>0</x>
16051605
<y>0</y>
1606-
<width>702</width>
1607-
<height>890</height>
1606+
<width>669</width>
1607+
<height>744</height>
16081608
</rect>
16091609
</property>
16101610
<layout class="QVBoxLayout" name="verticalLayout_29">
@@ -2202,8 +2202,8 @@
22022202
<rect>
22032203
<x>0</x>
22042204
<y>0</y>
2205-
<width>480</width>
2206-
<height>394</height>
2205+
<width>469</width>
2206+
<height>335</height>
22072207
</rect>
22082208
</property>
22092209
<layout class="QVBoxLayout" name="verticalLayout_25">
@@ -2538,32 +2538,99 @@
25382538
<rect>
25392539
<x>0</x>
25402540
<y>0</y>
2541-
<width>650</width>
2542-
<height>770</height>
2541+
<width>630</width>
2542+
<height>687</height>
25432543
</rect>
25442544
</property>
25452545
<layout class="QVBoxLayout" name="verticalLayout_30">
25462546
<item>
2547-
<widget class="QgsCollapsibleGroupBox" name="groupBox_7">
2547+
<widget class="QgsCollapsibleGroupBox" name="mIdentifyGroupBox">
25482548
<property name="title">
25492549
<string>Identify</string>
25502550
</property>
2551-
<layout class="QGridLayout" name="layout_7">
2552-
<item row="0" column="0" colspan="2">
2551+
<layout class="QVBoxLayout" name="verticalLayout_37">
2552+
<item>
25532553
<widget class="QCheckBox" name="cbxIdentifyResultsDocked">
25542554
<property name="text">
25552555
<string>Open identify results in a dock window (QGIS restart required)</string>
25562556
</property>
25572557
</widget>
25582558
</item>
2559-
<item row="2" column="0" colspan="2">
2559+
<item>
2560+
<layout class="QHBoxLayout" name="mIdentifyModeHorizontalLayout">
2561+
<item>
2562+
<widget class="QLabel" name="label_4">
2563+
<property name="text">
2564+
<string>Mode</string>
2565+
</property>
2566+
</widget>
2567+
</item>
2568+
<item>
2569+
<widget class="QComboBox" name="cmbIdentifyMode"/>
2570+
</item>
2571+
<item>
2572+
<spacer name="horizontalSpacer_43">
2573+
<property name="orientation">
2574+
<enum>Qt::Horizontal</enum>
2575+
</property>
2576+
<property name="sizeHint" stdset="0">
2577+
<size>
2578+
<width>40</width>
2579+
<height>20</height>
2580+
</size>
2581+
</property>
2582+
</spacer>
2583+
</item>
2584+
</layout>
2585+
</item>
2586+
<item>
25602587
<widget class="QCheckBox" name="cbxAutoFeatureForm">
25612588
<property name="text">
25622589
<string>Open feature form, if a single feature is identified</string>
25632590
</property>
25642591
</widget>
25652592
</item>
2566-
<item row="4" column="0" colspan="2">
2593+
<item>
2594+
<layout class="QHBoxLayout" name="mIdentifyRadiusHorizontalLayout">
2595+
<item>
2596+
<widget class="QLabel" name="textLabel1_3">
2597+
<property name="text">
2598+
<string>Search radius for identifying features and displaying map tips</string>
2599+
</property>
2600+
</widget>
2601+
</item>
2602+
<item>
2603+
<widget class="QDoubleSpinBox" name="spinBoxIdentifyValue">
2604+
<property name="suffix">
2605+
<string> %</string>
2606+
</property>
2607+
<property name="maximum">
2608+
<double>100.000000000000000</double>
2609+
</property>
2610+
<property name="singleStep">
2611+
<double>0.010000000000000</double>
2612+
</property>
2613+
<property name="value">
2614+
<double>5.000000000000000</double>
2615+
</property>
2616+
</widget>
2617+
</item>
2618+
<item>
2619+
<spacer name="horizontalSpacer_44">
2620+
<property name="orientation">
2621+
<enum>Qt::Horizontal</enum>
2622+
</property>
2623+
<property name="sizeHint" stdset="0">
2624+
<size>
2625+
<width>40</width>
2626+
<height>20</height>
2627+
</size>
2628+
</property>
2629+
</spacer>
2630+
</item>
2631+
</layout>
2632+
</item>
2633+
<item>
25672634
<widget class="QLabel" name="textLabel2">
25682635
<property name="text">
25692636
<string>&lt;b&gt;Note:&lt;/b&gt; Specify the search radius as a percentage of the map width</string>
@@ -2573,38 +2640,97 @@
25732640
</property>
25742641
</widget>
25752642
</item>
2576-
<item row="1" column="1">
2577-
<widget class="QComboBox" name="cmbIdentifyMode"/>
2578-
</item>
2579-
<item row="3" column="0">
2580-
<widget class="QLabel" name="textLabel1_3">
2581-
<property name="text">
2582-
<string>Search radius for identifying features and displaying map tips</string>
2583-
</property>
2584-
</widget>
2585-
</item>
2586-
<item row="3" column="1">
2587-
<widget class="QDoubleSpinBox" name="spinBoxIdentifyValue">
2588-
<property name="suffix">
2589-
<string>%</string>
2590-
</property>
2591-
<property name="maximum">
2592-
<double>100.000000000000000</double>
2593-
</property>
2594-
<property name="singleStep">
2595-
<double>0.010000000000000</double>
2596-
</property>
2597-
<property name="value">
2598-
<double>5.000000000000000</double>
2599-
</property>
2600-
</widget>
2601-
</item>
2602-
<item row="1" column="0">
2603-
<widget class="QLabel" name="label_4">
2604-
<property name="text">
2605-
<string>Mode</string>
2606-
</property>
2607-
</widget>
2643+
<item>
2644+
<layout class="QHBoxLayout" name="mIdentifyHighlightHorizontalLayout">
2645+
<item>
2646+
<widget class="QLabel" name="mIdentifyHighlighColorLabel">
2647+
<property name="text">
2648+
<string>Highlight color</string>
2649+
</property>
2650+
</widget>
2651+
</item>
2652+
<item>
2653+
<widget class="QgsColorButton" name="mIdentifyHighlightColorButton">
2654+
<property name="sizePolicy">
2655+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
2656+
<horstretch>0</horstretch>
2657+
<verstretch>0</verstretch>
2658+
</sizepolicy>
2659+
</property>
2660+
<property name="minimumSize">
2661+
<size>
2662+
<width>100</width>
2663+
<height>0</height>
2664+
</size>
2665+
</property>
2666+
<property name="maximumSize">
2667+
<size>
2668+
<width>100</width>
2669+
<height>16777215</height>
2670+
</size>
2671+
</property>
2672+
<property name="toolTip">
2673+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The color used to highlight identified feature. The alpha channel is only used for polygons fill, lines and outlines are fully opaque.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
2674+
</property>
2675+
<property name="text">
2676+
<string/>
2677+
</property>
2678+
</widget>
2679+
</item>
2680+
<item>
2681+
<widget class="QLabel" name="mIdentifyHighlightBufferLabel">
2682+
<property name="toolTip">
2683+
<string/>
2684+
</property>
2685+
<property name="text">
2686+
<string>Buffer</string>
2687+
</property>
2688+
</widget>
2689+
</item>
2690+
<item>
2691+
<widget class="QDoubleSpinBox" name="mIdentifyHighlightBufferSpinBox">
2692+
<property name="toolTip">
2693+
<string>Lines / outlines buffer in milimeters.</string>
2694+
</property>
2695+
<property name="suffix">
2696+
<string> mm</string>
2697+
</property>
2698+
</widget>
2699+
</item>
2700+
<item>
2701+
<widget class="QLabel" name="mIdentifyHighlightMinWidthLabel">
2702+
<property name="toolTip">
2703+
<string/>
2704+
</property>
2705+
<property name="text">
2706+
<string>Minimum width</string>
2707+
</property>
2708+
</widget>
2709+
</item>
2710+
<item>
2711+
<widget class="QDoubleSpinBox" name="mIdentifyHighlightMinWidthSpinBox">
2712+
<property name="toolTip">
2713+
<string>Minimum line / outline width in milimeters.</string>
2714+
</property>
2715+
<property name="suffix">
2716+
<string> mm</string>
2717+
</property>
2718+
</widget>
2719+
</item>
2720+
<item>
2721+
<spacer name="horizontalSpacer_45">
2722+
<property name="orientation">
2723+
<enum>Qt::Horizontal</enum>
2724+
</property>
2725+
<property name="sizeHint" stdset="0">
2726+
<size>
2727+
<width>40</width>
2728+
<height>20</height>
2729+
</size>
2730+
</property>
2731+
</spacer>
2732+
</item>
2733+
</layout>
26082734
</item>
26092735
</layout>
26102736
</widget>
@@ -2949,8 +3075,8 @@
29493075
<rect>
29503076
<x>0</x>
29513077
<y>0</y>
2952-
<width>507</width>
2953-
<height>396</height>
3078+
<width>470</width>
3079+
<height>360</height>
29543080
</rect>
29553081
</property>
29563082
<layout class="QVBoxLayout" name="verticalLayout_39">
@@ -3160,8 +3286,8 @@
31603286
<rect>
31613287
<x>0</x>
31623288
<y>0</y>
3163-
<width>494</width>
3164-
<height>691</height>
3289+
<width>472</width>
3290+
<height>579</height>
31653291
</rect>
31663292
</property>
31673293
<layout class="QVBoxLayout" name="verticalLayout_31">
@@ -3651,8 +3777,8 @@
36513777
<rect>
36523778
<x>0</x>
36533779
<y>0</y>
3654-
<width>464</width>
3655-
<height>386</height>
3780+
<width>432</width>
3781+
<height>364</height>
36563782
</rect>
36573783
</property>
36583784
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -3781,8 +3907,8 @@
37813907
<rect>
37823908
<x>0</x>
37833909
<y>0</y>
3784-
<width>635</width>
3785-
<height>762</height>
3910+
<width>598</width>
3911+
<height>700</height>
37863912
</rect>
37873913
</property>
37883914
<layout class="QGridLayout" name="gridLayout_15">
@@ -4035,8 +4161,8 @@
40354161
<rect>
40364162
<x>0</x>
40374163
<y>0</y>
4038-
<width>298</width>
4039-
<height>240</height>
4164+
<width>283</width>
4165+
<height>221</height>
40404166
</rect>
40414167
</property>
40424168
<layout class="QVBoxLayout" name="verticalLayout_32">
@@ -4125,8 +4251,8 @@
41254251
<rect>
41264252
<x>0</x>
41274253
<y>0</y>
4128-
<width>528</width>
4129-
<height>754</height>
4254+
<width>486</width>
4255+
<height>649</height>
41304256
</rect>
41314257
</property>
41324258
<layout class="QVBoxLayout" name="verticalLayout_33">

0 commit comments

Comments
 (0)
Please sign in to comment.