da-rth / yasb

A highly configurable cross-platform (Windows) status bar written in Python.
MIT License
1.42k stars 80 forks source link

[BUG] Bar padding behavior #12

Closed Vernetzt closed 2 years ago

Vernetzt commented 2 years ago

Expected Behavior

top changes the top left changes left bottom changes the bottom right changes the right

Current Behavior

top changes the top and right? left changes the bottom? bottom changes the bottom and right? right changes the bottom?

Context (Environment)

This could be me misunderstanding the use of these settings but my assumption would be that changing the top padding to say top: 10 would pad the bar 10 pixels from the top of the screen it was created on. As it stands now doing so seems to do that but also pad the the bar on the right side by the same value. Similar problems exist for left/bottom/right as stated above.

yasb - c03f296 Windows 11 - 22000.438

Example

bars:
  yasb-bar:
    alignment:
      position: "top"
      center: true
    dimensions:
      width: "100%"
      height: 25
    padding:
      top: 10
      left: 0
      bottom: 0
      right: 0

Image showing the top left and right corners with pixel rulers in red. yasb-corners

da-rth commented 2 years ago

@Vernetzt thanks for reporting this. I refactored the Bar widget recently and clearly missed this. The padding is indeed being incorrectly implemented. I have fixed the Bar widget to use the padding correctly.

image

The fix has been implemented in commit https://github.com/denBot/yasb/commit/2c7c5da60f063ea6e5d1aec0ad091917262eef42 and is now on main.

da-rth commented 2 years ago

Closing for now, please re-open this issue if the above change has not resolved the bug.