mirror of
https://github.com/gmbrax/Pilgrim.git
synced 2026-11-09 18:30:19 +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
@@ -17,12 +17,16 @@ class AboutScreen(Screen[bool]):
|
||||
super().__init__()
|
||||
self.header = Header()
|
||||
self.footer = Footer()
|
||||
self.app_title = Label("Pilgrim", id="AboutScreen_AboutTitle")
|
||||
self.content = Label("A TUI Based Travel Diary Application", id="AboutScreen_AboutContent")
|
||||
self.version = Label("Version: 0.0.1", id="AboutScreen_AboutVersion")
|
||||
self.app_title = Label("Pilgrim", id="AboutScreen_AboutTitle",classes="AboutScreen_AboutTitle")
|
||||
self.content = Label("A TUI Based Travel Diary Application", id="AboutScreen_AboutContent",
|
||||
classes="AboutScreen_AboutContent")
|
||||
self.version = Label("Version: 0.0.1", id="AboutScreen_AboutVersion",
|
||||
classes="AboutScreen_AboutVersion")
|
||||
self.developer = Label("Developed By: Gustavo Henrique Miranda ", id="AboutScreen_AboutAuthor")
|
||||
self.contact = Label("git.gustavomiranda.xyz", id="AboutScreen_AboutContact")
|
||||
self.license = TextArea(id="AboutScreen_AboutLicense")
|
||||
self.contact = Label("git.gustavomiranda.xyz", id="AboutScreen_AboutContact",
|
||||
classes="AboutScreen_AboutContact")
|
||||
self.license = TextArea(id="AboutScreen_AboutLicense",
|
||||
classes="AboutScreen_AboutLicense")
|
||||
self.license.text = """Copyright (c) 2025 GHMiranda.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
@@ -35,9 +39,11 @@ Redistribution and use in source and binary forms, with or without modification,
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."""
|
||||
self.license.read_only = True
|
||||
self.about_container = Container(self.app_title, self.content, self.version, self.developer, self.contact,
|
||||
id="AboutScreen_SubContainer")
|
||||
self.container = Container(self.about_container, self.license, id="AboutScreen_AboutContainer")
|
||||
self.about_container = Container(self.app_title, self.content, self.version, self.developer,
|
||||
self.contact, id="AboutScreen_SubContainer",
|
||||
classes="AboutScreen_SubContainer")
|
||||
self.container = Container(self.about_container, self.license, id="AboutScreen_AboutContainer",
|
||||
classes="AboutScreen_AboutContainer")
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield self.header
|
||||
@@ -51,8 +57,10 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
elif "about-info-button" in event.button.classes:
|
||||
self.notify("Mais informações seriam exibidas aqui!", title="Info")
|
||||
|
||||
def action_dismiss(self) -> None:
|
||||
"""Fecha o about box usando dismiss."""
|
||||
def action_dismiss(self, **kwargs) -> None:
|
||||
"""Fecha o about box usando dismiss.
|
||||
:param **kwargs:
|
||||
"""
|
||||
self.dismiss(False)
|
||||
|
||||
def on_key(self, event) -> None:
|
||||
|
||||
@@ -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