Skip to content

Commit 6d15d2c

Browse files
committed
Dir/File item: enable browse button only if widget is active and not readonly
1 parent ef8b8bf commit 6d15d2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guidata/dataset/qtitemwidgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ def set_state(self):
940940
"""Update the visual status of the widget and disbales/enables it if
941941
necessary"""
942942
super().set_state()
943-
self.button.setEnabled(not self.is_readonly())
943+
self.button.setEnabled(not self.is_readonly() and self.is_active())
944944

945945

946946
class DirectoryWidget(HLayoutMixin, LineEditWidget):
@@ -970,7 +970,7 @@ def set_state(self):
970970
"""Update the visual status of the widget and disbales/enables it if
971971
necessary"""
972972
super().set_state()
973-
self.button.setEnabled(not self.is_readonly())
973+
self.button.setEnabled(not self.is_readonly() and self.is_active())
974974

975975

976976
class ChoiceWidget(AbstractDataSetWidget):

0 commit comments

Comments
 (0)