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

Support "relative" Window positions and sizes. #10

Closed
tmontes opened this issue Jun 23, 2018 · 1 comment
Closed

Support "relative" Window positions and sizes. #10

tmontes opened this issue Jun 23, 2018 · 1 comment
Labels
Milestone

Comments

@tmontes
Copy link
Owner

tmontes commented Jun 23, 2018

Not sure if it should be handled by the kernel of the lib... (maybe the kernel as it may simplify handling automatic output terminal resizes).

Ideas:

  • Position
    • Defined by two args: x and y.
    • Positive int values correspond to zero-based, absolute terminal coordinates.
    • Negative int values correspond to "from-right/bottom" absolute terminal coordinates, where -1 corresponds to the last "column/row".
    • Positive float values correspond to zero-based, relative terminal coordinates where 1.0 is the first "column/row" after the visible ones.
    • Negative float values correspond to "from-right/bottom" relative terminal coordinates, where -1.0 is the first "column/row" before the visible ones.
  • Size:
    • Defined by two arguments: w and h.
    • int values correspond to absolute terminal "rows/columns".
    • float values correspond to sizes relative to the terminal geometry with 1.0 represents the full width/height of the terminal.

May be of use:

  • Some kind of dx, dy, dw and dh to somehow manage margins.

Examples:

  • A full-screen window: w = Window(x=0, y=0, w=1.0, h=1.0).
  • A full-screen window with a 1 row/column margin: w = Window(x=0, y=0, w=1.0, h=1.0, dx=1, dy=1, dw=-2, dh=-2)
  • Two side by side windows: w1, w2 = Window(x=0, y=0, w=0.5, h=1.0), Window(x=0.5, y=0, w=0.5, h=1.0) (may need dx/dw adjustments to ensure there is no overlap?)

That's the general idea.

@tmontes
Copy link
Owner Author

tmontes commented Jul 12, 2018

After PR #87 and #88, this is completed. Closing.

@tmontes tmontes closed this as completed Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant