Skip to content

Spacer

A widget to add padding between widgets!

Key
Default
Description
apiThe api object provided within the function
widthThe width of the spacer, set 0 to expand to full width
fgtheme.foreground1Color to show the text in, defaults to theme.foreground1 or white based on theme
bgtheme.primaryColor to show the background in, defaults to theme.primary or accent based on theme

Usage

python
from dooit_extras.bar_widgets import Spacer
from dooit.ui.api.events import subscribe, Startup

@subscribe(Startup)
def setup(api, _):
    api.bar.set( 
        [
            # ....
            Spacer(api, width = 0), # takes all the space
            Spacer(api, width = 20), # takes 20 blocks worth of space
            # ....
        ]
    )