Comments (2)
It looks like the key difference is that the Button
text can wrap, so the container's auto
width is calcuated based on the minimum width of the widget rather than the optimal width of the renderable?
from textual.app import App, ComposeResult
from textual.containers import Horizontal
from textual.widgets import Button
class HorizontalWidthAutoApp(App[None]):
CSS = """
Horizontal {
border: solid red;
height: auto;
width: auto;
}
Button {
margin-left: 1;
}
"""
def compose(self) -> ComposeResult:
with Horizontal(classes="auto"):
yield Button("This is a very wide button")
with Horizontal(classes="auto"):
yield Button("This is a very wide button")
yield Button("This is a very wide button")
if __name__ == "__main__":
HorizontalWidthAutoApp().run()
from textual.
Don't forget to star the repository!
Follow @textualizeio for Textual updates.
from textual.
Related Issues (20)
- Helper `tools/widget_documentation.py` script fails HOT 2
- Help panel isn't helpful for bindings without descriptions HOT 2
- Footer tooltip appears away from cursor
- Awaiting pop_screen in @on causes app to freeze HOT 3
- self.batch_update not working / Calling pop_screen multiple times causes a flickering effect / A new method to pop more screens at once HOT 1
- Investigate Screen._modal_binding_chain behaviour
- Improve cosmetics on Linux vconsole HOT 5
- Quitting the calculator app with the command palette causes escape sequences to be emitted at the prompt HOT 3
- DataTable Cell Borders? HOT 6
- Inline glitch with 1 line screen HOT 4
- Quitting inline app without padding will also clear the line above HOT 3
- `inline_no_clear` broken in v0.77.0 HOT 3
- Can't seem to bind an action to shift+space HOT 3
- Support type specification in `get_screen` HOT 2
- New widgets being ignored HOT 11
- Crash when instancing a SelectionList with disabled=True HOT 4
- Suggester docs HOT 3
- `Binding.key_display` and help panel interact poorly for comma-separated Binding definitions
- Running self.exit() in on_mount() throws exception HOT 4
- Textualize v0.80.0 Textarea tries to set cursor position before its mounted and throws error textual._context.NoActiveAppError HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from textual.