diff --git a/images/images.qrc b/images/images.qrc
index 49074341ce..41a9f1db90 100644
--- a/images/images.qrc
+++ b/images/images.qrc
@@ -477,11 +477,7 @@
themes/qfield/nodpi/ic_reshape_tool_white_24dp.svg
themes/qfield/nodpi/ic_ring_tool_white_24dp.svg
themes/qfield/nodpi/ic_vertex_tool_white_24dp.svg
- themes/qfield/hdpi/ic_view_green_48dp.png
- themes/qfield/mdpi/ic_view_green_48dp.png
- themes/qfield/xhdpi/ic_view_green_48dp.png
- themes/qfield/xxhdpi/ic_view_green_48dp.png
- themes/qfield/xxxhdpi/ic_view_green_48dp.png
+ themes/qfield/nodpi/ic_view_black_24dp.svg
themes/qfield/hdpi/content-cut.png
themes/qfield/mdpi/content-cut.png
themes/qfield/xhdpi/content-cut.png
diff --git a/images/themes/qfield/hdpi/ic_view_green_48dp.png b/images/themes/qfield/hdpi/ic_view_green_48dp.png
deleted file mode 100644
index ec5fdaaadb..0000000000
Binary files a/images/themes/qfield/hdpi/ic_view_green_48dp.png and /dev/null differ
diff --git a/images/themes/qfield/mdpi/ic_view_green_48dp.png b/images/themes/qfield/mdpi/ic_view_green_48dp.png
deleted file mode 100644
index d4ae6602d3..0000000000
Binary files a/images/themes/qfield/mdpi/ic_view_green_48dp.png and /dev/null differ
diff --git a/images/themes/qfield/nodpi/ic_view_black_24dp.svg b/images/themes/qfield/nodpi/ic_view_black_24dp.svg
new file mode 100644
index 0000000000..7f2e1fe6d9
--- /dev/null
+++ b/images/themes/qfield/nodpi/ic_view_black_24dp.svg
@@ -0,0 +1,4 @@
+
+
diff --git a/images/themes/qfield/nodpi/ic_view_green_48dp.svg b/images/themes/qfield/nodpi/ic_view_green_48dp.svg
deleted file mode 100644
index 323979b7f4..0000000000
--- a/images/themes/qfield/nodpi/ic_view_green_48dp.svg
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
diff --git a/images/themes/qfield/xhdpi/ic_view_green_48dp.png b/images/themes/qfield/xhdpi/ic_view_green_48dp.png
deleted file mode 100644
index 6151863a94..0000000000
Binary files a/images/themes/qfield/xhdpi/ic_view_green_48dp.png and /dev/null differ
diff --git a/images/themes/qfield/xxhdpi/ic_view_green_48dp.png b/images/themes/qfield/xxhdpi/ic_view_green_48dp.png
deleted file mode 100644
index c2f0c44a55..0000000000
Binary files a/images/themes/qfield/xxhdpi/ic_view_green_48dp.png and /dev/null differ
diff --git a/images/themes/qfield/xxxhdpi/ic_view_green_48dp.png b/images/themes/qfield/xxxhdpi/ic_view_green_48dp.png
deleted file mode 100644
index f51318cf5d..0000000000
Binary files a/images/themes/qfield/xxxhdpi/ic_view_green_48dp.png and /dev/null differ
diff --git a/src/core/attributeformmodelbase.cpp b/src/core/attributeformmodelbase.cpp
index 874ec9c8f5..868ad3c034 100644
--- a/src/core/attributeformmodelbase.cpp
+++ b/src/core/attributeformmodelbase.cpp
@@ -262,8 +262,11 @@ void AttributeFormModelBase::updateAttributeValue( QStandardItem *item )
QVariant attributeValue = mFeatureModel->data( mFeatureModel->index( fieldIndex ), FeatureModel::AttributeValue );
item->setData( attributeValue.isNull() ? QVariant() : attributeValue, AttributeFormModel::AttributeValue );
item->setData( mFeatureModel->data( mFeatureModel->index( fieldIndex ), FeatureModel::AttributeAllowEdit ), AttributeFormModel::AttributeAllowEdit );
- //set item visibility to false in case it's a linked attribute
- item->setData( !mFeatureModel->data( mFeatureModel->index( fieldIndex ), FeatureModel::LinkedAttribute ).toBool(), AttributeFormModel::CurrentlyVisible );
+ // set item editable state to false in case it's a linked attribute
+ if ( mFeatureModel->data( mFeatureModel->index( fieldIndex ), FeatureModel::LinkedAttribute ).toBool() )
+ {
+ item->setData( false, AttributeFormModel::AttributeEditable );
+ }
}
else if ( item->data( AttributeFormModel::ElementType ) == QStringLiteral( "qml" ) || item->data( AttributeFormModel::ElementType ) == QStringLiteral( "html" ) )
{
diff --git a/src/core/layertreemodel.cpp b/src/core/layertreemodel.cpp
index eae817b066..90823b9be6 100644
--- a/src/core/layertreemodel.cpp
+++ b/src/core/layertreemodel.cpp
@@ -1208,6 +1208,28 @@ QgsRectangle FlatLayerTreeModelBase::nodeExtent( const QModelIndex &index, QgsQu
}
}
+ if ( extent.width() == 0.0 || extent.height() == 0.0 )
+ {
+ // If all of the features are at the one point, buffer the
+ // rectangle a bit. If they are all at zero, do something a bit
+ // more crude.
+ if ( extent.xMinimum() == 0.0 && extent.xMaximum() == 0.0 && extent.yMinimum() == 0.0 && extent.yMaximum() == 0.0 )
+ {
+ extent.set( -1.0, -1.0, 1.0, 1.0 );
+ }
+ else
+ {
+ const double padFactor = 1e-8;
+ const double widthPad = extent.xMinimum() * padFactor;
+ const double heightPad = extent.yMinimum() * padFactor;
+ const double xmin = extent.xMinimum() - widthPad;
+ const double xmax = extent.xMaximum() + widthPad;
+ const double ymin = extent.yMinimum() - heightPad;
+ const double ymax = extent.yMaximum() + heightPad;
+ extent.set( xmin, ymin, xmax, ymax );
+ }
+ }
+
if ( buffer )
{
extent = extent.buffered( extent.width() * buffer );
diff --git a/src/qml/FeatureForm.qml b/src/qml/FeatureForm.qml
index ff491ad3c5..4d17def2b9 100644
--- a/src/qml/FeatureForm.qml
+++ b/src/qml/FeatureForm.qml
@@ -511,6 +511,8 @@ Page {
// - not set to editable in the widget configuration
// - not in edit mode (ReadOnly)
// - a relation in multi edit mode
+ property bool isAdding: form.state === 'Add'
+ property bool isEditing: form.state === 'Edit'
property bool isEnabled: !!AttributeEditable
&& form.state !== 'ReadOnly'
&& !( Type === 'relation' && form.model.featureModel.modelMode == FeatureModel.MultiFeatureModel )
diff --git a/src/qml/editorwidgets/RelationReference.qml b/src/qml/editorwidgets/RelationReference.qml
index 3bf6b0c923..ab23b1c291 100644
--- a/src/qml/editorwidgets/RelationReference.qml
+++ b/src/qml/editorwidgets/RelationReference.qml
@@ -57,7 +57,7 @@ EditorWidgetBase {
height: 48
bgcolor: "transparent"
- iconSource: Theme.getThemeIcon("ic_view_green_48dp")
+ iconSource: Theme.getThemeVectorIcon("ic_view_black_24dp")
onClicked: {
if ( relationReference.currentKeyValue !== undefined && relationReference.currentKeyValue !== '' ) {
diff --git a/src/qml/editorwidgets/UuidGenerator.qml b/src/qml/editorwidgets/UuidGenerator.qml
index 9046684e6e..b21b340e04 100644
--- a/src/qml/editorwidgets/UuidGenerator.qml
+++ b/src/qml/editorwidgets/UuidGenerator.qml
@@ -28,12 +28,13 @@ EditorWidgetBase {
color: 'gray'
text: {
var displayValue = value !== undefined ? value : ''
- if (isLoaded && isEnabled && (value === undefined || value == '')) {
+ if (isLoaded && isAdding && (value == undefined || value === '')) {
displayValue = StringUtils.createUuid();
valueChangeRequested(displayValue ,false);
}
return displayValue;
}
+ elide: Text.ElideMiddle
}
Rectangle {