Skip to content

More minimal frame title? #2030

@JDeeth

Description

@JDeeth

Frame formats like this:

┌─| Hello |─┐
│World      │
└───────────┘

Is there a straightforward way to draw a frame without the padding round its title?

┌───Hello───┐
│World      │
└───────────┘

Code for the above:

from prompt_toolkit.application import Application
from prompt_toolkit.layout import Layout, VSplit, Window
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.key_binding.bindings.named_commands import end_of_file
from prompt_toolkit.widgets import Frame, TextArea

kb = KeyBindings()
kb.add("c-c")(end_of_file)

frame = Frame(TextArea(text="World", width=11), title="Hello")
root_container = VSplit([frame, Window()])
layout = Layout(root_container)

app = Application(layout=layout, key_bindings=kb)
app.run()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions