♻️ refactor(dashboard): move ScrolledWindow to notification component for better structure

This commit is contained in:
sankalp committed 2025-07-27 01:33:56 +05:45
1 parent 3e82082ae2
commit e0756beaea
2 files changed
+21 -21

No files matched your search

+1 -18
View File
@@ -1,6 +1,5 @@
from fabric.widgets.box import Box
from fabric.widgets.revealer import Revealer
from fabric.widgets.scrolledwindow import ScrolledWindow
from fabric.core.service import Property
from modules.dashboard.bluetooth import Bluetooth
@@ -32,22 +31,6 @@ class Dashboard(Box):
# Create real notifications component
self.dashboard_notifications = DashboardNotifications()
# Create scrolled window for notifications (matching dock notifications style)
self.notifications_scrolled = ScrolledWindow(
name="notification-history-scrolled-window",
child=self.dashboard_notifications,
h_scrollbar_policy="never",
v_scrollbar_policy="automatic",
min_content_size=(400, 200),
max_content_size=(450, 300),
h_expand=True,
v_expand=True,
h_align="fill",
v_align="fill",
propagate_width=False,
propagate_height=False,
)
self.tiles = Box(
children=[
self.wifi,
@@ -66,7 +49,7 @@ class Dashboard(Box):
spacing=8,
h_expand=True,
v_expand=True,
children=[self.notifications_scrolled],
children=[self.dashboard_notifications],
style_classes=["notification-history-popup"],
),
child_revealed=True,
+20 -3
View File
@@ -7,6 +7,7 @@ from fabric.widgets.box import Box
from fabric.widgets.label import Label
from fabric.widgets.button import Button
from fabric.widgets.centerbox import CenterBox
from fabric.widgets.scrolledwindow import ScrolledWindow
from gi.repository import GLib, Gtk
import os
import json
@@ -238,10 +239,26 @@ class DashboardNotifications(Box):
children=[self.no_notifications_label],
)
# Add components to main container
# Create scrolled window for notifications list only
self.notifications_scrolled = ScrolledWindow(
name="notification-history-scrolled-window",
child=self.notifications_list,
h_scrollbar_policy="never",
v_scrollbar_policy="automatic",
min_content_size=(400, 200),
max_content_size=(450, 300),
h_expand=True,
v_expand=True,
h_align="fill",
v_align="fill",
propagate_width=False,
propagate_height=False,
)
# Add components to main container - header outside, scrolled list inside
self.add(self.history_header)
self.add(self.notifications_list)
self.add(self.notifications_scrolled)
# Add the no notifications box initially to the notifications list
self.notifications_list.add(self.no_notifications_box)