chore: refactor imports and adopt new utils utilities

This commit is contained in:
sankalp committed 2026-07-14 18:45:52 +05:45
1 parent b2114f52b1
commit 6f2d0bf444
65 files changed
+221 -266

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ from services.bluetooth import BluetoothClient, BluetoothDevice
from shared.widgets.smooth_switch import SmoothSwitch
from shared.window.animated_scrollwindow import AnimatedScrollable
from utils.functions import spawn_detached
from utils.utils import svg_file
from utils.gtk_utils import svg_file
def get_battery_icon_file(
+6 -6
View File
@@ -11,7 +11,7 @@ from fabric.widgets.stack import Stack
from fabric.widgets.wayland import WaylandWindow as Window
from services.mpris import PlayerManager, PlayerService
from utils.utils import svg_file
from utils.gtk_utils import svg_file
from window.controlcenter.player import (
PLAYER_FALLBACK_ART,
apply_player_art,
@@ -416,7 +416,7 @@ class PlayerBox(Box):
initial_status = str(self.player.playback_status).lower()
icon_file = (
"player/play.svg" if initial_status == "paused" else "player/Pause.svg"
"player/play.svg" if initial_status == "paused" else "player/pause.svg"
)
self.play_pause_icon = svg_file(icon_file, size=22)
self.play_pause_button = Button(
@@ -433,7 +433,7 @@ class PlayerBox(Box):
)
self.prev_button = Button(
name="macos-control-button",
child=svg_file("player/Rewind.svg", size=22),
child=svg_file("player/rewind.svg", size=22),
style_classes=["control-buttons"],
on_clicked=self._on_player_prev,
)
@@ -638,7 +638,7 @@ class PlayerBox(Box):
try:
status = str(self.player.playback_status).lower()
self.play_pause_icon.dynamic_file(
"player/play.svg" if status == "paused" else "player/Pause.svg"
"player/play.svg" if status == "paused" else "player/pause.svg"
)
except Exception as e:
logger.error(f"An error occurred: {e}")
@@ -651,7 +651,7 @@ class PlayerBox(Box):
self._last_notified_status = current_status
icon_file = (
"player/play.svg" if current_status == "paused" else "player/Pause.svg"
"player/play.svg" if current_status == "paused" else "player/pause.svg"
)
if hasattr(self, "play_pause_icon"):
self.play_pause_icon.dynamic_file(icon_file)
@@ -659,7 +659,7 @@ class PlayerBox(Box):
# Fallback if play_pause_icon isn't available
import os
from utils.utils import get_relative_path
from utils.gtk_utils import get_relative_path
self.play_pause_button.get_child().set_from_file(
os.path.join(get_relative_path("assets/icons/"), icon_file)
+1 -1
View File
@@ -11,8 +11,8 @@ from services.inhibit import get_inhibit_service
from services.network import NetworkClient
from shared.widgets.flat_scale import FlatScale
from shared.window.applet_window import AppletWindow
from utils.gtk_utils import svg_file
from utils.roam import audio_service, modus_service
from utils.utils import svg_file
from window.controlcenter.bluetooth import (
BluetoothConnections,
set_bluetooth_enabled_with_fallback,
+1 -1
View File
@@ -6,7 +6,7 @@ from services.modus import (
is_night_light_active,
toggle_night_light,
)
from utils.utils import svg_file
from utils.gtk_utils import svg_file
def create_night_light_widget(control_center):
+3 -6
View File
@@ -193,12 +193,9 @@ class PerAppVolumeControl(Box):
def _populate_apps(self):
"""Populate the widget with current audio applications"""
# Clear and DESTROY existing widgets to prevent memory leaks
for child in list(self.apps_container.get_children()):
try:
child.destroy()
except Exception as e:
logger.error(f"An error occurred: {e}")
from utils.functions import clear_children
clear_children(self.apps_container)
self.apps_container.children = []
self._app_widgets.clear()
+4 -4
View File
@@ -9,7 +9,7 @@ from fabric.widgets.stack import Stack
import shared.data as data
from services.mpris import PlayerManager, PlayerService
from utils.utils import svg_file
from utils.gtk_utils import svg_file
CACHE_DIR = f"{data.CACHE_DIR}/media"
PLAYER_FALLBACK_ART = get_relative_path("../../assets/icons/music.svg")
@@ -357,7 +357,7 @@ class PlayerBox(Box):
initial_status = str(self.player.playback_status).lower()
icon_file = (
"player/play.svg" if initial_status == "paused" else "player/Pause.svg"
"player/play.svg" if initial_status == "paused" else "player/pause.svg"
)
self.play_pause_icon = svg_file(icon_file, size=22)
self.play_pause_button = Button(
@@ -538,7 +538,7 @@ class PlayerBox(Box):
try:
status = str(self.player.playback_status).lower()
self.play_pause_icon.dynamic_file(
"player/play.svg" if status == "paused" else "player/Pause.svg"
"player/play.svg" if status == "paused" else "player/pause.svg"
)
except Exception as e:
logger.error(f"An error occurred: {e}")
@@ -553,7 +553,7 @@ class PlayerBox(Box):
self._last_notified_status = current_status
self.play_pause_icon.dynamic_file(
"player/play.svg" if current_status == "paused" else "player/Pause.svg"
"player/play.svg" if current_status == "paused" else "player/pause.svg"
)
if self.player_stack:
self.player_stack.on_player_playback_changed(self, current_status)
+1 -1
View File
@@ -15,7 +15,7 @@ from utils.functions import (
get_wifi_icon_for_strength,
spawn_detached,
)
from utils.utils import svg_file
from utils.gtk_utils import svg_file
class WifiNetworkSlot(Box):