From 8b095fd66b99e9df8d357354fd0a98f92fee2093 Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Wed, 23 Jun 2021 21:32:22 +0200 Subject: [PATCH] * Fixed radical list stroke count separator behavior and color. --- kanjidic.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kanjidic.py b/kanjidic.py index 904bf91..8b7c75e 100755 --- a/kanjidic.py +++ b/kanjidic.py @@ -514,10 +514,13 @@ class kdRadicalList(QDialog): continue sep = zRadicalButton(str(stroke)) sep.setEnabled(False) - sep.setStyleSheet('background-color: #ffffff; border: none;') + 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]: - self._add_widget(zRadicalButton(rad)) + btn = zRadicalButton(rad) + btn.is_sep = False + self._add_widget(btn) if geo is not None: self.setGeometry(geo) else: @@ -547,11 +550,11 @@ class kdRadicalList(QDialog): def set_avail(self, avail): if avail is None: for btn in self.btns: - if not btn.isFlat(): + if not btn.is_sep: btn.setEnabled(True) else: for btn in self.btns: - if not btn.isChecked() and not btn.isFlat(): + if not btn.isChecked() and not btn.is_sep: btn.setEnabled(btn.text() in avail) -- 2.30.2