From 38759958d21d3fb194c93ee23f381a03798515fc Mon Sep 17 00:00:00 2001 From: Niko Aarnio Date: Mon, 3 Feb 2025 11:04:04 +0200 Subject: [PATCH] fix plan feature digitizing without selected plan feature type Now plan feature type button does not toggle off by pressing it again, so clearing selection requires user to change map tool --- .../gui/components/new_feature_grid_widget.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arho_feature_template/gui/components/new_feature_grid_widget.py b/arho_feature_template/gui/components/new_feature_grid_widget.py index 2a7ace7..7c0dac6 100644 --- a/arho_feature_template/gui/components/new_feature_grid_widget.py +++ b/arho_feature_template/gui/components/new_feature_grid_widget.py @@ -56,14 +56,11 @@ def update_height(self): self.setFixedHeight(new_height) def handle_button_click(self, btn: FeatureButton): - # Clear other button selections - self.clear_selections(btn) + self.clear_selections(exclude=btn) # Map button texts to layer names - if btn.isChecked(): - self.active_feature_type_changed.emit(btn.text(), FEATURE_TYPE_TO_LAYER_NAME[btn.text()]) - else: - self.active_feature_type_changed.emit("", "") + btn.setChecked(True) + self.active_feature_type_changed.emit(btn.text(), FEATURE_TYPE_TO_LAYER_NAME[btn.text()]) def clear_selections(self, exclude: FeatureButton | None = None): for btn in self.buttons.values():