Skip to content

Commit

Permalink
set eye for layer visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
moovida committed May 27, 2024
1 parent 866e4c9 commit a3dba53
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
37 changes: 21 additions & 16 deletions lib/eu/hydrologis/smash/maps/layers/core/layersview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -445,22 +445,27 @@ class LayersPageState extends State<LayersPage> {
trailing: Padding(
padding:
EdgeInsets.only(right: SmashPlatform.isDesktop() ? 10.0 : 0.0),
child: Checkbox(
value: layerSourceItem.isActive(),
onChanged: (isVisible) async {
layerSourceItem.setActive(isVisible!);
_somethingChanged = true;
if (isVisible &&
layerSourceItem is LoadableLayerSource &&
!layerSourceItem.isLoaded) {
setState(() {
isLoadingData = true;
loadLayerWithProgressEnd(layerSourceItem, context);
});
} else {
setState(() {});
}
}),
child: IconButton(
icon: Icon(MdiIcons.eye,
color: layerSourceItem.isActive()
? SmashColors.mainDecorations
: SmashColors.disabled),
onPressed: () {
var isVisible = !layerSourceItem.isActive();
layerSourceItem.setActive(isVisible);
_somethingChanged = true;
if (isVisible &&
layerSourceItem is LoadableLayerSource &&
!layerSourceItem.isLoaded) {
setState(() {
isLoadingData = true;
loadLayerWithProgressEnd(layerSourceItem, context);
});
} else {
setState(() {});
}
},
),
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion smashlibs

0 comments on commit a3dba53

Please sign in to comment.