more settings
This commit is contained in:
24
settings.py
24
settings.py
@@ -1,5 +1,5 @@
|
|||||||
from textual.screen import ModalScreen
|
from textual.screen import ModalScreen
|
||||||
from textual.widgets import Label, TabbedContent, TabPane, Checkbox
|
from textual.widgets import Label, Select, TabbedContent, TabPane, Checkbox
|
||||||
from textual.containers import Vertical, HorizontalGroup, VerticalGroup
|
from textual.containers import Vertical, HorizontalGroup, VerticalGroup
|
||||||
from textual.binding import Binding
|
from textual.binding import Binding
|
||||||
|
|
||||||
@@ -24,16 +24,23 @@ class SettingsScreen(ModalScreen):
|
|||||||
|
|
||||||
.setting {
|
.setting {
|
||||||
padding: 0 2;
|
padding: 0 2;
|
||||||
|
background: red;
|
||||||
.setting-name {
|
.setting-name {
|
||||||
text-style: bold;
|
text-style: bold;
|
||||||
}
|
}
|
||||||
.setting-desc {
|
.setting-desc {
|
||||||
text-style: dim;
|
text-style: dim;
|
||||||
text-wrap: wrap;
|
width: 100%;
|
||||||
width: 1fr;
|
min-width: 30;
|
||||||
}
|
}
|
||||||
VerticalGroup {
|
VerticalGroup {
|
||||||
max-width: 30%;
|
width: 50%;
|
||||||
|
min-width: 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
Select {
|
||||||
|
width: 25;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,11 +57,16 @@ class SettingsScreen(ModalScreen):
|
|||||||
with Vertical(id="window") as window:
|
with Vertical(id="window") as window:
|
||||||
window.border_title = "Settings"
|
window.border_title = "Settings"
|
||||||
with TabbedContent():
|
with TabbedContent():
|
||||||
yield TabPane("Appearance")
|
with TabPane("Appearance"):
|
||||||
|
with HorizontalGroup(classes="setting"):
|
||||||
|
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)
|
||||||
with TabPane("Editor"):
|
with TabPane("Editor"):
|
||||||
with HorizontalGroup(classes="setting"):
|
with HorizontalGroup(classes="setting"):
|
||||||
with VerticalGroup():
|
with VerticalGroup():
|
||||||
yield Label("Word Wrap", classes="setting-name")
|
yield Label("Word Wrap", classes="setting-name")
|
||||||
yield Label("Enable word wrap in the code editor.", classes="setting-desc")
|
yield Label("Enable word wrap in the code editor.", classes="setting-desc")
|
||||||
yield Checkbox(value=True)
|
yield Checkbox(value=True)
|
||||||
yield TabPane("Plugins")
|
yield TabPane("Plugins")
|
||||||
|
|||||||
Reference in New Issue
Block a user