Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(button): render with console markup #4331

Merged

Conversation

TomJGooding
Copy link
Contributor

@TomJGooding TomJGooding commented Mar 24, 2024

Fixes #4328.

I've added a new snapshot test - here's a screenshot showing the difference after/before this change:

image

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

@TomJGooding
Copy link
Contributor Author

TomJGooding commented Mar 24, 2024

Something I noticed is that the shade is red is different comparing against v0.40.0, but it looks like there must have been other changes as Static and Label show the same difference...

Textual v0.40.0

image

Now

image

from textual.app import App, ComposeResult
from textual.widgets import Button, Label, Static


class ButtonsWithMarkupApp(App):
    def compose(self) -> ComposeResult:
        yield Button("[italic red]Focused[/] Button")
        yield Button("[italic red]Blurred[/] Button")
        yield Button("[italic red]Disabled[/] Button", disabled=True)

        yield Static("[italic red]Test[/] Static")
        yield Label("[italic red]Test[/] Label")


if __name__ == "__main__":
    app = ButtonsWithMarkupApp()
    app.run()

@TomJGooding TomJGooding marked this pull request as ready for review March 25, 2024 13:07
@willmcgugan
Copy link
Collaborator

Something I noticed is that the shade is red is different comparing against v0.40.0, but it looks like there must have been other changes as Static and Label show the same difference...

We changed the default dark ansi theme from DIMMED_MONOKAI to MONOKAI. Personally I prefer the dimmed version, but I was outnumbered. 🤷

Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@willmcgugan willmcgugan merged commit 7aa903b into Textualize:main Mar 30, 2024
20 checks passed
@TomJGooding TomJGooding deleted the fix-button-render-with-console-markup branch April 1, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button doesn't render Rich Markup correctly
3 participants