If bools are bistate, remove the "Clear" button from edit medata single

This commit is contained in:
Charles Haley 2020-04-18 18:32:06 +01:00
parent b468f72ba7
commit 545ce0b6ce

View File

@ -164,12 +164,13 @@ class Bool(Base):
l.addWidget(c) l.addWidget(c)
c.clicked.connect(self.set_to_no) c.clicked.connect(self.set_to_no)
t = _('Clear') if self.db.prefs.get('bools_are_tristate'):
c = QPushButton(t, parent) t = _('Clear')
width = c.fontMetrics().boundingRect(t).width() + 7 c = QPushButton(t, parent)
c.setMaximumWidth(width) width = c.fontMetrics().boundingRect(t).width() + 7
l.addWidget(c) c.setMaximumWidth(width)
c.clicked.connect(self.set_to_cleared) l.addWidget(c)
c.clicked.connect(self.set_to_cleared)
c = QLabel('', parent) c = QLabel('', parent)
c.setMaximumWidth(1) c.setMaximumWidth(1)