Adding a bit of text to the footer #5286
-
I have been looking for a way to add a bit of text to the footer (more specifically replacing the command palette key description in the right corner) but found no obvious easy way (apologies if I missed it, there is just so much cool features). I came up with the following hack (transcribed from another computer, might contain typOs): class StatusFooter( Footer ):
def __init__( self ):
super().__init__()
self.status = Label("FOO")
self.show_command_palette = False
self.status.styles.dock = "right"
def compose( self ):
yield from super().compose()
yield self.status From looking at _footer.py what I thought would happen is that all the yields there assemble the normal footer as usual and just add mine later. It also first looks like it works fine, however if you remove the dock = right part the label is positioned to the very left of the footer overwriting everything else there. How can I have an extra bit of text (status messages etc.) as the "next" element in the footer after the keybinding descriptions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The |
Beta Was this translation helpful? Give feedback.
Sorry I think I misunderstood where you wanted the label to be positioned. I thought having the status docked to the right would make more sense than displaying it right beside the bindings!
I think incrementing the
grid_size_columns
is probably your best solution in that case, given the styling constraints of the grid. There's not a "canonical" way of extending the footer AFAIK.