Skip to content

Commit

Permalink
SnapCast fix position and screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
elParaguayo committed Nov 18, 2024
1 parent bd2c0e9 commit 64e011c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
Binary file removed docs/_static/images/snapcast.png
Binary file not shown.
4 changes: 1 addition & 3 deletions qtile_extras/widget/snapcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ class SnapCast(base._Widget):
),
]

_screenshots = [("snapcast.png", "Snapclient active running in background")]

_dependencies = ["requests"]

def __init__(self, **config):
Expand Down Expand Up @@ -188,7 +186,7 @@ def draw(self):
self.drawer.clear(self.background or self.bar.background)

offsety = (self.bar.height - self.img.height) // 2
self.img.draw(colour=self.status_colour, y=offsety)
self.img.draw(colour=self.status_colour, x=self.padding, y=offsety)
self.drawer.draw(offsetx=self.offsetx, offsety=self.offsety, width=self.length)

def finalize(self):
Expand Down
31 changes: 31 additions & 0 deletions test/widget/docs_screenshots/ss_snapcast.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2024 elParaguayo
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import pytest

from qtile_extras.widget.snapcast import SnapCast


@pytest.fixture
def widget():
yield SnapCast


def ss_snapcast(screenshot_manager):
screenshot_manager.take_screenshot()

0 comments on commit 64e011c

Please sign in to comment.