From: Urban Wallasch Date: Thu, 24 Jun 2021 13:31:05 +0000 (+0200) Subject: * Minor tweak to radical buttons. X-Git-Tag: v0.1.0~41 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=e4ca689a1cc8050cd0e201e42edb4cc765e703d9;p=jiten-pai.git * Minor tweak to radical buttons. --- diff --git a/kanjidic.py b/kanjidic.py index 677acee..3c5f3ea 100755 --- a/kanjidic.py +++ b/kanjidic.py @@ -480,9 +480,10 @@ class zKanjiButton(QPushButton): self.setFont(font) class zRadicalButton(zKanjiButton): - def __init__(self, *args, **kwargs): + def __init__(self, *args, is_sep=False, **kwargs): super().__init__(*args, **kwargs) - self.setCheckable(True) + self.is_sep = is_sep + self.setCheckable(not self.is_sep) self.toggle_action = None self.toggled.connect(self._toggle) @@ -512,10 +513,9 @@ class kdRadicalList(QDialog): for stroke in range(len(_srad)): if not len(_srad[stroke]): continue - sep = zRadicalButton(str(stroke)) + sep = zRadicalButton(str(stroke), is_sep=True) sep.setEnabled(False) sep.setStyleSheet('background-color: %s; color: #ffffff; border: none;' % cfg['hl_col']) - sep.is_sep = True self._add_widget(sep) for rad in _srad[stroke]: btn = zRadicalButton(rad)