+14
-5
lines changedFilter options
+14
-5
lines changed Original file line number Diff line number Diff line change
@@ -531,8 +531,9 @@ def build_theme_model_rows(self): # pylint: disable=too-many-branches
531
531
self._error_messages_row = SeparatorListBoxRow()
532
532
self.mainbox.add(self._error_messages_row)
533
533
self._all_rows = {}
534
+
self._all_section_boxes = {}
534
535
for section_id, section in THEME_MODEL_NEW.items():
535
-
section_box = SectionListBox()
536
+
self._all_section_boxes[section_id] = section_box = SectionListBox()
536
537
for option_idx, theme_value in enumerate(section):
537
538
key = theme_value.get('key')
538
539
display_name = theme_value.get('display_name', key)
@@ -629,6 +630,7 @@ def open_theme(self, theme): # pylint: disable=too-many-branches
629
630
error_messages.append(_("Can't Be Edited in GUI"))
630
631
631
632
for section_id, section in THEME_MODEL_NEW.items():
633
+
rows_displayed_in_section = 0
632
634
for option_idx, theme_value in enumerate(section):
633
635
key = theme_value.get('key')
634
636
if isinstance(theme.get(key), Exception):
@@ -654,11 +656,18 @@ def open_theme(self, theme): # pylint: disable=too-many-branches
654
656
]:
655
657
row.set_value(theme[key])
656
658
row.show()
657
-
if error_messages:
658
-
self._error_messages_row.set_markup('\n'.join(error_messages))
659
-
self._error_messages_row.show()
659
+
rows_displayed_in_section += 1
660
+
661
+
section_box = self._all_section_boxes[section_id]
662
+
if rows_displayed_in_section == 0:
663
+
section_box.hide()
660
664
else:
661
-
self._error_messages_row.hide()
665
+
section_box.show()
666
+
if error_messages:
667
+
self._error_messages_row.set_markup('\n'.join(error_messages))
668
+
self._error_messages_row.show()
669
+
else:
670
+
self._error_messages_row.hide()
662
671
663
672
def hide_all_rows(self):
664
673
self._error_messages_row.hide()
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4