Added widget sorting in the section

parent 61460c7e
......@@ -9,6 +9,7 @@ class ClassicSection(BaseSection):
super().__init__(section_data, module)
self.logger = logging.getLogger(f"{self.__class__.__name__}[{self.name}]")
self.settings = [Setting(s, module) for s in section_data.get('settings', [])]
self.settings = sorted(self.settings, key=lambda s: s.weight, reverse=True)
self.module = module
self.module.add_section(self)
......
......@@ -15,7 +15,7 @@ class BaseSetting:
self.orig_name = setting_data['name']
self.logger = logging.getLogger(f"{self.__class__.__name__}[{self.name}]")
self.weight = setting_data.get('weight', 1)
self.widget = None
self.root = setting_data.get('root', False)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment