mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-10 09:30:17 +00:00
Added CSS Classes on about_screen.py and new_diary_modal.py and created the classes on the pilgrim.css file
This commit is contained in:
parent
cb31ba5662
commit
5dd8ba398f
@@ -5,21 +5,23 @@ from textual.widgets import Label, Input, Button
|
||||
|
||||
class NewDiaryModal(ModalScreen[str]):
|
||||
BINDINGS = [
|
||||
("escape", "cancel", "Cancelar"),
|
||||
("escape", "cancel", "Cancel"),
|
||||
]
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.name_input = Input(id="NewDiaryModal-NameInput") # This ID is fine, it's specific to the input
|
||||
self.name_input = Input(id="NewDiaryModal-NameInput",classes="NewDiaryModal-NameInput") # This ID is fine, it's specific to the input
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
# CHANGE THIS LINE: Use the ID that matches your CSS
|
||||
with Vertical(id="new_diary_dialog"): # <--- Changed ID here to match CSS
|
||||
yield Label("Create a new diary", classes="dialog-title")
|
||||
|
||||
with Vertical(id="new_diary_dialog",classes="NewDiaryModal-Dialog"):
|
||||
yield Label("Create a new diary", classes="NewDiaryModal-Title")
|
||||
yield Label("Diary Name:")
|
||||
yield self.name_input
|
||||
with Horizontal(classes="dialog-buttons"):
|
||||
yield Button("Create", variant="primary", id="create_diary_button")
|
||||
yield Button("Cancel", variant="default", id="cancel_button")
|
||||
with Horizontal(classes="NewDiaryModal-ButtonsContainer"):
|
||||
yield Button("Create", variant="primary", id="create_diary_button",
|
||||
classes="NewDiaryModal-CreateDiaryButton")
|
||||
yield Button("Cancel", variant="default", id="cancel_button",
|
||||
classes="NewDiaryModal-CancelButton")
|
||||
|
||||
def on_mount(self):
|
||||
self.name_input.focus()
|
||||
|
||||
Reference in New Issue
Block a user