starting work on actually saving settings
This commit is contained in:
21
settings.py
21
settings.py
@@ -1,5 +1,5 @@
|
||||
from textual.screen import ModalScreen
|
||||
from textual.widgets import Label, Select, TabbedContent, TabPane, Checkbox
|
||||
from textual.widgets import Label, Select, TabbedContent, TabPane, Switch
|
||||
from textual.containers import Vertical, HorizontalGroup, VerticalGroup
|
||||
from textual.binding import Binding
|
||||
|
||||
@@ -24,23 +24,25 @@ class SettingsScreen(ModalScreen):
|
||||
|
||||
.setting {
|
||||
padding: 0 2;
|
||||
background: red;
|
||||
content-align: center middle;
|
||||
|
||||
.setting-name {
|
||||
text-style: bold;
|
||||
}
|
||||
|
||||
.setting-desc {
|
||||
text-style: dim;
|
||||
width: 100%;
|
||||
min-width: 30;
|
||||
}
|
||||
|
||||
VerticalGroup {
|
||||
width: 50%;
|
||||
min-width: 20;
|
||||
}
|
||||
|
||||
Select {
|
||||
width: 25;
|
||||
padding: 0;
|
||||
max-width: 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,11 +64,16 @@ class SettingsScreen(ModalScreen):
|
||||
with VerticalGroup():
|
||||
yield Label("Colour Theme", classes="setting-name")
|
||||
yield Label("Colour theme used for the entire Berry app.", classes="setting-desc")
|
||||
yield Select.from_values(["theme 1", "theme 2", "theme 3"], allow_blank=False)
|
||||
yield Select.from_values((theme_name for theme_name in self.app._registered_themes.keys() if theme_name != "textual-ansi"), allow_blank=False)
|
||||
with TabPane("Editor"):
|
||||
with HorizontalGroup(classes="setting"):
|
||||
with VerticalGroup():
|
||||
yield Label("Word Wrap", classes="setting-name")
|
||||
yield Label("Enable word wrap in the code editor.", classes="setting-desc")
|
||||
yield Checkbox(value=True)
|
||||
yield TabPane("Plugins")
|
||||
yield Switch(value=True)
|
||||
with TabPane("Plugins"):
|
||||
with HorizontalGroup(classes="setting"):
|
||||
with VerticalGroup():
|
||||
yield Label("Plugins Enabled", classes="setting-name")
|
||||
yield Label("Enable or disable Lua plugins. This requires a restart.", classes="setting-desc")
|
||||
yield Switch(value=True)
|
||||
|
||||
Reference in New Issue
Block a user