Skip to content

Commit

Permalink
UX - Make group mutually exclusive and legend collapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Dec 6, 2023
1 parent 691f95b commit 6fde186
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2529,7 +2529,9 @@ def _add_group_legend(
if qgis_group.name() == label:
return qgis_group

return root_group.addGroup(label)
new_group = root_group.addGroup(label)
new_group.setIsMutuallyExclusive(True, -1)
return new_group

def add_group_hidden(self):
""" Add the hidden group. """
Expand Down Expand Up @@ -2600,7 +2602,8 @@ def _add_base_layer(self, source: str, name: str, attribution_url: str = None, a
for qgis_group in groups:
qgis_group: QgsLayerTreeGroup
if qgis_group.name() == 'baselayers':
qgis_group.addLayer(raster)
node = qgis_group.addLayer(raster)
node.setExpanded(False)
break

self.dlg.display_message_bar(
Expand Down

0 comments on commit 6fde186

Please sign in to comment.