[SCRIPT] Updated
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,5 @@
|
||||
from ignis.widgets import Widget
|
||||
from .page import SettingsPage
|
||||
from options import settings_last_page
|
||||
|
||||
|
||||
class SettingsEntry(Widget.ListBoxRow):
|
||||
@@ -8,15 +7,10 @@ class SettingsEntry(Widget.ListBoxRow):
|
||||
self,
|
||||
icon: str,
|
||||
label: str,
|
||||
active_page,
|
||||
page: SettingsPage,
|
||||
**kwargs,
|
||||
):
|
||||
def callback(x):
|
||||
active_page.page = page
|
||||
active_page.name = label
|
||||
if self in self.parent.rows:
|
||||
settings_last_page.set_value(self.parent.rows.index(self))
|
||||
from ..active_page import active_page # avoid a circular import
|
||||
|
||||
super().__init__(
|
||||
child=Widget.Box(
|
||||
@@ -26,6 +20,6 @@ class SettingsEntry(Widget.ListBoxRow):
|
||||
],
|
||||
),
|
||||
css_classes=["settings-sidebar-entry"],
|
||||
on_activate=callback,
|
||||
on_activate=lambda x: active_page.set_value(page),
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from typing import List
|
||||
from ignis.widgets import Widget
|
||||
from .row import SettingsRow
|
||||
from ignis.base_widget import BaseWidget
|
||||
@@ -6,7 +5,7 @@ from ignis.base_widget import BaseWidget
|
||||
|
||||
class SettingsGroup(Widget.Box):
|
||||
def __init__(
|
||||
self, name: str | None, rows: List[SettingsRow | BaseWidget] = [], **kwargs
|
||||
self, name: str | None, rows: list[SettingsRow | BaseWidget] = [], **kwargs
|
||||
):
|
||||
super().__init__(
|
||||
vertical=True,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
from ignis.widgets import Widget
|
||||
from typing import List
|
||||
from .group import SettingsGroup
|
||||
from ignis.base_widget import BaseWidget
|
||||
|
||||
|
||||
class SettingsPage(Widget.Scroll):
|
||||
def __init__(self, name: str, groups: List[SettingsGroup | BaseWidget] = []):
|
||||
def __init__(self, name: str, groups: list[SettingsGroup | BaseWidget] = []):
|
||||
super().__init__(
|
||||
hexpand=True,
|
||||
vexpand=True,
|
||||
|
||||
@@ -2,7 +2,12 @@ from ignis.widgets import Widget
|
||||
|
||||
|
||||
class SettingsRow(Widget.ListBoxRow):
|
||||
def __init__(self, label: str | None = None, sublabel: str | None = None, **kwargs):
|
||||
def __init__(
|
||||
self,
|
||||
label: str | None = None,
|
||||
sublabel: str | None = None,
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(
|
||||
css_classes=["settings-row"],
|
||||
child=Widget.Box(
|
||||
|
||||
Reference in New Issue
Block a user