Skip to content

Commit

Permalink
Fix an issue when the default padding from widgets_defaults is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
1fadi committed May 21, 2023
1 parent a4966e3 commit 1c7d326
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions ibattery.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,13 @@ class Battery(base._Widget):
),
]

def __init__(self, padding=None, **config):
def __init__(self, **config):
base._Widget.__init__(self, bar.CALCULATED, **config)
self.add_defaults(Battery.defaults)

self.HEIGHT, self.BAR_WIDTH = self.size # battery bar
self.padding = padding if padding else 2
self.margin = 2
self.length = self.padding * 2 + self.BAR_WIDTH + 7.5 + self.margin * 2

self._has_notified = False
self.timeout = int(self.notification_timeout * 1000)

self._foreground = self.foreground if self.foreground else "d5d5d5"

def _notify(self, percent):
Expand Down

0 comments on commit 1c7d326

Please sign in to comment.