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

some wack(ier) buisness going on #5353

Closed
TryMyWagon opened this issue Dec 6, 2024 · 7 comments
Closed

some wack(ier) buisness going on #5353

TryMyWagon opened this issue Dec 6, 2024 · 7 comments

Comments

@TryMyWagon
Copy link

dock not functioning correctly, can only align widgets to corners(?) for some reason. this is using the 88.1 hotfix (thanks for that btw)

wacky vid part 2..
https://github.com/user-attachments/assets/bdfaa9c4-a608-4e02-921a-7724805f2401

the apparently cursed file, again
test2.zip

# Textual Diagnostics

## Versions

| Name    | Value  |
|---------|--------|
| Textual | 0.88.1 |
| Rich    | 13.9.4 |

## Python

| Name           | Value                                                                                                            |
|----------------|------------------------------------------------------------------------------------------------------------------|
| Version        | 3.12.1                                                                                                           |
| Implementation | CPython                                                                                                          |
| Compiler       | MSC v.1937 64 bit (AMD64)                                                                                        |
| Executable     | C:\Users\Miles\Documents\!Programs(LOCAL)\!Projects\(python) TwitchOW2PredictionBot\src\.venv\Scripts\python.exe |

## Operating System

| Name    | Value      |
|---------|------------|
| System  | Windows    |
| Release | 10         |
| Version | 10.0.19045 |

## Terminal

| Name                 | Value     |
|----------------------|-----------|
| Terminal Application | *Unknown* |
| TERM                 | *Not set* |
| COLORTERM            | *Not set* |
| FORCE_COLOR          | *Not set* |
| NO_COLOR             | *Not set* |

## Rich Console options

| Name           | Value                |
|----------------|----------------------|
| size           | width=151, height=30 |
| legacy_windows | False                |
| min_width      | 1                    |
| max_width      | 151                  |
| is_terminal    | True                 |
| encoding       | utf-8                |
| max_height     | 30                   |
| justify        | None                 |
| overflow       | None                 |
| no_wrap        | False                |
| highlight      | None                 |
| markup         | None                 |
| height         | None                 |
@willmcgugan
Copy link
Collaborator

Could you give me a single example where the output is not what you would expect. Because this looks correct to me.

@Textualize Textualize deleted a comment from github-actions bot Dec 6, 2024
@TryMyWagon
Copy link
Author

apologies for the shitty explanation this illustrates it better.

pt3.mp4

instead of mirroring the image on the right it can instead only be docked to the corners, the position defined by align is being overridden instead of appended by dock (unless this is intentional behavior)

@willmcgugan
Copy link
Collaborator

Docking trumps alignment of the parent.

When you dock something, it takes the widget out of the usual layout and anchors it to an edge. If you want it to appear in the middle of the vertical edge, you could dock a container and set the alignment on the app.

In general though, you shouldn't think of docking as an alignment mechanism. It's purpose is mainly to divide the screen.

@TryMyWagon
Copy link
Author

So if i needed a static sidebar (docked so it dosent scroll) in the center of the vertical axis of the screen, is there a way of doing that without creating another container in which to hold it, eg

(I dont think offset-y accepts scalers but)

dock: right;
offset-y: 50%;

Is there a simple solution like that available or is making another container always necessary?

@willmcgugan
Copy link
Collaborator

Offset does accept scalars, but that wouldn't centre it.

You will need another container. You could use containers.Middle

I get the impression you at trying to avoid that, but it is the best solution and only requires a single additional line.

@TryMyWagon
Copy link
Author

allg, ty

Copy link

github-actions bot commented Dec 8, 2024

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

No branches or pull requests

2 participants