Skip to content

Commit

Permalink
Merge pull request #5009 from opengisch/lock_icon
Browse files Browse the repository at this point in the history
Use vector icon for the locked layer badge to fix visual glitch.
  • Loading branch information
nirvn authored Feb 7, 2024
2 parents e282d88 + ff4b409 commit 4f72239
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 7 deletions.
5 changes: 0 additions & 5 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,6 @@
<file>themes/qfield/xhdpi/more_horiz.png</file>
<file>themes/qfield/xxhdpi/more_horiz.png</file>
<file>themes/qfield/xxxhdpi/more_horiz.png</file>
<file>themes/qfield/hdpi/ic_lock_black_24dp.png</file>
<file>themes/qfield/mdpi/ic_lock_black_24dp.png</file>
<file>themes/qfield/xhdpi/ic_lock_black_24dp.png</file>
<file>themes/qfield/xxhdpi/ic_lock_black_24dp.png</file>
<file>themes/qfield/xxxhdpi/ic_lock_black_24dp.png</file>
<file>themes/qfield/mdpi/ic_navigation_flag_red_24dp.png</file>
<file>themes/qfield/hdpi/ic_navigation_flag_red_24dp.png</file>
<file>themes/qfield/xhdpi/ic_navigation_flag_red_24dp.png</file>
Expand Down
Binary file removed images/themes/qfield/hdpi/ic_lock_black_24dp.png
Binary file not shown.
Binary file removed images/themes/qfield/mdpi/ic_lock_black_24dp.png
Binary file not shown.
Binary file removed images/themes/qfield/xhdpi/ic_lock_black_24dp.png
Binary file not shown.
Binary file removed images/themes/qfield/xxhdpi/ic_lock_black_24dp.png
Binary file not shown.
Binary file removed images/themes/qfield/xxxhdpi/ic_lock_black_24dp.png
Binary file not shown.
4 changes: 4 additions & 0 deletions src/core/identifytool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ QList<IdentifyTool::IdentifyResult> IdentifyTool::identifyVectorLayer( QgsVector
if ( !temporalFilter.isEmpty() )
req.setFilterExpression( temporalFilter );
req.setLimit( QSettings().value( "/QField/identify/limit", 200 ).toInt() );
#if _QGIS_VERSION_INT >= 33500
req.setFlags( Qgis::FeatureRequestFlag::ExactIntersect );
#else
req.setFlags( QgsFeatureRequest::ExactIntersect );
#endif

QgsAttributeTableConfig config = layer->attributeTableConfig();
if ( !config.sortExpression().isEmpty() )
Expand Down
8 changes: 8 additions & 0 deletions src/core/locator/activelayerfeatureslocatorfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ QStringList ActiveLayerFeaturesLocatorFilter::prepare( const QString &string, co
req.setSubsetOfAttributes( qgis::setToList( mDispExpression.referencedAttributeIndexes( layer->fields() ) ) );
if ( !mDispExpression.needsGeometry() )
{
#if _QGIS_VERSION_INT >= 33500
req.setFlags( Qgis::FeatureRequestFlag::NoGeometry );
#else
req.setFlags( QgsFeatureRequest::NoGeometry );
#endif
}
QString enhancedSearch = searchString;
enhancedSearch.replace( ' ', '%' );
Expand Down Expand Up @@ -159,7 +163,11 @@ QStringList ActiveLayerFeaturesLocatorFilter::prepare( const QString &string, co
QgsFeatureRequest req;
if ( !mDispExpression.needsGeometry() )
{
#if _QGIS_VERSION_INT >= 33500
req.setFlags( Qgis::FeatureRequestFlag::NoGeometry );
#else
req.setFlags( QgsFeatureRequest::NoGeometry );
#endif
}
req.setFilterExpression( expression );
if ( isRestricting )
Expand Down
4 changes: 4 additions & 0 deletions src/core/locator/featureslocatorfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ QStringList FeaturesLocatorFilter::prepare( const QString &string, const QgsLoca
QgsFeatureRequest req;
req.setSubsetOfAttributes( expression.referencedAttributeIndexes( layer->fields() ).values() );
if ( !expression.needsGeometry() )
#if _QGIS_VERSION_INT >= 33500
req.setFlags( Qgis::FeatureRequestFlag::NoGeometry );
#else
req.setFlags( QgsFeatureRequest::NoGeometry );
#endif
QString enhancedSearch = string;
enhancedSearch.replace( " ", "%" );
req.setFilterExpression( QStringLiteral( "%1 ILIKE '%%2%'" )
Expand Down
4 changes: 4 additions & 0 deletions src/core/utils/layerutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ QgsAbstractVectorLayerLabeling *LayerUtils::defaultLabeling( QgsVectorLayer *lay
case Qgis::GeometryType::Polygon:
{
settings.placement = Qgis::LabelPlacement::AroundPoint;
#if _QGIS_VERSION_INT >= 33500
settings.obstacleSettings().setType( QgsLabelObstacleSettings::ObstacleType::PolygonBoundary );
#else
settings.obstacleSettings().setType( QgsLabelObstacleSettings::PolygonBoundary );
#endif
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/qml/LayerTreeItemProperties.qml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Popup {
Text {
id: lockText

property var padlockIcon: Theme.getThemeIcon('ic_lock_black_24dp')
property var padlockIcon: Theme.getThemeVectorIcon('ic_lock_black_24dp')
property var padlockSize: fontMetrics.height - 5

property bool isReadOnly: index !== undefined && layerTree.data(index, FlatLayerTreeModel.ReadOnly)
Expand Down
2 changes: 1 addition & 1 deletion src/qml/Legend.qml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ ListView {
bgcolor: 'transparent'
opacity: 0.5

icon.source: Theme.getThemeIcon( 'ic_lock_black_24dp' )
icon.source: Theme.getThemeVectorIcon( 'ic_lock_black_24dp' )
icon.color: Theme.mainTextColor

onClicked: {
Expand Down

1 comment on commit 4f72239

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.