diff --git a/modules/dock/components/battery.py b/modules/dock/components/battery.py index 5cef535..eed2a10 100644 --- a/modules/dock/components/battery.py +++ b/modules/dock/components/battery.py @@ -337,8 +337,8 @@ class BatteryPopup(Window): anchor_map = { "Top": "top", "Bottom": "bottom right", - "Left": "left", - "Right": "right", + "Left": "top left", + "Right": "top right", } return anchor_map.get(dock_position, "bottom") @@ -347,8 +347,8 @@ class BatteryPopup(Window): margin_map = { "Top": "60px 10px 10px 10px", "Bottom": "10px 650px 60px 10px", - "Left": "10px 10px 10px 60px", - "Right": "10px 60px 10px 10px", + "Left": "600px 10px 10px 60px", + "Right": "600px 60px 10px 10px", } return margin_map.get(dock_position, "10px 10px 60px 10px") @@ -444,7 +444,8 @@ class Battery(Box): self.add(self.battery_box) - self.popup = None + # Pre-create popup for immediate display on hover + self.popup = BatteryPopup(dock_component=self) # Hover timeout for debouncing self._hover_timeout = None @@ -462,8 +463,8 @@ class Battery(Box): GLib.source_remove(self._hover_timeout) self._hover_timeout = None - # Clean up popup - if hasattr(self, 'popup') and self.popup: + # Clean up popup (popup is always created now) + if self.popup: try: self.popup.destroy() self.popup = None @@ -480,11 +481,8 @@ class Battery(Box): GLib.source_remove(self._hover_timeout) self._hover_timeout = None - # Show popup immediately on hover - if not self.popup or not self.popup.get_visible(): - # Create popup on-demand if it doesn't exist - if not self.popup: - self.popup = BatteryPopup(dock_component=self) + # Show popup immediately on hover (popup is pre-created) + if not self.popup.get_visible(): self.popup.show_popup() return False diff --git a/modules/dock/components/music_player.py b/modules/dock/components/music_player.py index 4a493c2..4b236f7 100644 --- a/modules/dock/components/music_player.py +++ b/modules/dock/components/music_player.py @@ -98,8 +98,8 @@ class MusicPlayerPopup(Window): anchor_map = { "Top": "top", "Bottom": "bottom", - "Left": "left", - "Right": "right", + "Left": "top left", + "Right": "top right", } return anchor_map.get(dock_position, "bottom") @@ -108,8 +108,8 @@ class MusicPlayerPopup(Window): margin_map = { "Top": "60px 10px 10px 10px", "Bottom": "10px 10px 60px 10px", - "Left": "10px 10px 10px 60px", - "Right": "10px 60px 10px 10px", + "Left": "330px 10px 10px 60px", + "Right": "330px 60px 10px 10px", } return margin_map.get(dock_position, "10px 10px 60px 10px") @@ -202,8 +202,8 @@ class MusicPlayer(Box): self.add(self.event_box) - # Popup window will be created on-demand - self.popup = None + # Pre-create popup for immediate display on hover + self.popup = MusicPlayerPopup(dock_component=self) # Hover timeout for debouncing self._hover_timeout = None @@ -654,11 +654,8 @@ class MusicPlayer(Box): GLib.source_remove(self._hover_timeout) self._hover_timeout = None - # Show popup immediately on hover - if not self.popup or not self.popup.get_visible(): - # Create popup on-demand if it doesn't exist - if not self.popup: - self.popup = MusicPlayerPopup(dock_component=self) + # Show popup immediately on hover (popup is pre-created) + if not self.popup.get_visible(): self.popup.show_popup() return False diff --git a/modules/dock/components/notifications.py b/modules/dock/components/notifications.py index e0f5d36..6f8fee7 100644 --- a/modules/dock/components/notifications.py +++ b/modules/dock/components/notifications.py @@ -212,7 +212,8 @@ class NotificationIndicator(EventBox): self.connect("leave-notify-event", self.on_leave_notify) self.add_events(Gdk.EventMask.ENTER_NOTIFY_MASK | Gdk.EventMask.LEAVE_NOTIFY_MASK) - self.popup = None + # Pre-create popup for immediate display on hover + self.popup = NotificationHistoryPopup(dock_component=self) self._hover_timeout = None self._connect_to_dnd_state() @@ -228,8 +229,8 @@ class NotificationIndicator(EventBox): GLib.source_remove(self._hover_timeout) self._hover_timeout = None - # Clean up popup - if hasattr(self, 'popup') and self.popup: + # Clean up popup (popup is always created now) + if self.popup: try: self.popup.destroy() self.popup = None @@ -247,10 +248,8 @@ class NotificationIndicator(EventBox): GLib.source_remove(self._hover_timeout) self._hover_timeout = None - # Show popup immediately on hover - if not self.popup or not self.popup.get_visible(): - if not self.popup: - self.popup = NotificationHistoryPopup(dock_component=self) + # Show popup immediately on hover (popup is pre-created) + if not self.popup.get_visible(): self.popup.show_popup() return False diff --git a/styles/components.css b/styles/components.css index 42eb671..486030d 100644 --- a/styles/components.css +++ b/styles/components.css @@ -115,7 +115,7 @@ border: 1px solid var(--surface); border-radius: 12px; padding: 16px; - margin: 4px; + margin: 8px; } .power-profiles {