Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a nice battery that is similar to the one in ios 16 #84

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix an issue when the default padding from widgets_defaults is passed
  • Loading branch information
1fadi committed May 21, 2023
commit 1c7d32614578bc5ca997af5dcaad3e7df841ad33
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