[ui][aur] improved Required / Optional confirmation dialogs

This commit is contained in:
Vinicius Moreira
2019-11-26 19:09:00 -03:00
parent bed3db69e6
commit 7720d4d3e3
5 changed files with 42 additions and 6 deletions

View File

@@ -15,6 +15,10 @@ class RadioButtonQt(QRadioButton):
self.model_parent = model_parent
self.toggled.connect(self._set_checked)
if self.model.read_only:
self.setAttribute(Qt.WA_TransparentForMouseEvents)
self.setFocusPolicy(Qt.NoFocus)
def _set_checked(self, checked: bool):
if checked:
self.model_parent.value = self.model
@@ -34,6 +38,10 @@ class CheckboxQt(QCheckBox):
if model.icon_path:
self.setIcon(QIcon(model.icon_path))
if model.read_only:
self.setAttribute(Qt.WA_TransparentForMouseEvents)
self.setFocusPolicy(Qt.NoFocus)
def _set_checked(self, state):
checked = state == 2