♻️ refactor(dock): use HyprlandWorkspaces and HyprlandLanguage widgets

This commit is contained in:
sankalp committed 2025-07-29 00:49:03 +05:45
1 parent e61fadd43c
commit 7bcd9b27b2
3 files changed
+26 -26

No files matched your search

+2 -2
View File
@@ -5,7 +5,7 @@ import os
import gi
from fabric.hyprland.service import HyprlandEvent
from fabric.hyprland.widgets import Language, get_hyprland_connection
from fabric.hyprland.widgets import HyprlandLanguage, get_hyprland_connection
from fabric.utils import get_relative_path
from fabric.widgets.box import Box
from fabric.widgets.button import Button
@@ -174,7 +174,7 @@ class DockComponents(Box):
lang_data = (
event.data[1]
if event and event.data and len(event.data) > 1
else Language().get_label()
else HyprlandLanguage().get_label()
)
self.language.set_tooltip_text(lang_data)
if not data.VERTICAL:
+5 -5
View File
@@ -2,7 +2,7 @@ import json
import subprocess
from fabric.hyprland.service import Hyprland
from fabric.hyprland.widgets import WorkspaceButton, Workspaces
from fabric.hyprland.widgets import WorkspaceButton, HyprlandWorkspaces
from fabric.widgets.box import Box
from fabric.widgets.button import Button
@@ -83,7 +83,7 @@ class Workspace(Button):
self.set_label(str(self.activeWorkspace))
workspaces = Workspaces(
workspaces = HyprlandWorkspaces(
name="workspaces",
invert_scroll=True,
empty_scroll=True,
@@ -104,10 +104,10 @@ workspaces = Workspaces(
],
buttons_factory=None
if data.DOCK_HIDE_SPECIAL_WORKSPACE
else Workspaces.default_buttons_factory,
else HyprlandWorkspaces.default_buttons_factory,
)
workspaces_num = Workspaces(
workspaces_num = HyprlandWorkspaces(
name="workspaces-num",
invert_scroll=True,
empty_scroll=True,
@@ -129,7 +129,7 @@ workspaces_num = Workspaces(
],
buttons_factory=None
if data.DOCK_HIDE_SPECIAL_WORKSPACE
else Workspaces.default_buttons_factory,
else HyprlandWorkspaces.default_buttons_factory,
)